Companion
Properties
Spacing, in seconds, between global timeline ticks for the current range. Recalculated by generateHourlyIntervals from the total range length — finer (down to 1 hour) for short ranges, coarser for long ones so the tick count stays near maxIntervalsForLongRange.
Monotonic id for the active com.xweather.mapsgl.map.MapController. Incremented on each resetForNewController so async tile completions from a finished activity cannot mark com.xweather.mapsgl.data.TileList.readyList for a new map session.
Download-progress percentage (0-100) shown in the UI, recomputed by calcDLPercent. When isCoarsePlayback progressive loading is active, this covers the whole two-phase process (0-50% coarse pass, 50-100% background full-grid pass) rather than just whichever sub-target calcDLPercent is currently computing against.
Read-only count of vector (GeoJSON) downloads still pending, updated via updatePendingVectorDownloads/incrementPendingVectorDownloads/decrementPendingVectorDownloads.
Functions
Registers item (e.g. a tile hash) as pending for source id, updating the encoded- download counters and publishing a fresh snapshot to pendingEncodedDownloadsLiveData. No-op if either argument is empty or item is already pending for id.
Authoritative count from pendingEncodedDownloadsState (not the LiveData snapshot).
Converts the LayerTimeline registered under sourceId's timeDates into matching timeStrings/timeLongs, then notifies it via LayerTimeline.onValidTimesUpdated. No-op if no timeline is registered for sourceId.
Demo/debug-only: layer ids still building meshes for the full timeline (not just the rolling window around the playhead) — see beginPlaybackFullTimelinePriming. Background full-timeline priming does not hold the play-button load spinner; that spinner clears once the current blend pair is drawable.
Demo/debug-only: number of phases the active timeline is configured with (see timeStrings, built by generateHourlyIntervals from a start/end date range). This — not a source's full product valid-times list — is what full-timeline-priming loops in the renderers (fill/line/circle) actually iterate over per tile.
Decrements the pending vector-download count by one, floored at 0.
Removes and returns source ids that need a fill-interval download pass.
Converts a Date object to an ISO 8601 string in UTC.
Increments the pending vector-download count by one.
True when the global timeline is parked on the final interval (playing or stopped).
Authoritative read used by the GL render thread to gate tile binding. Reads the in-memory state under pendingEncodedDownloadLock rather than the LiveData snapshot (which can lag behind rapid writes).
Removes a download item from the pending list for a given ID. If the list becomes empty, the ID is removed from the map.
Marks sourceId as needing a fill-interval download pass (the remaining odd-indexed intervals of a staggered sparse-then-fill load). Queued ids are drained via drainStaggeredFillDownloadRequests.
Wipes every process-wide static this companion object holds and bumps mapSessionId, so a freshly created MapController starts from a clean slate instead of inheriting stale per-source state (timelines, valid-time lists, download counters) from a previous controller instance. Call from MapController's constructor.
Sets the total encoded-download count expected for this play session (from preflight), used by effectiveEncodedDownloadDenominator/calcDLPercent as the percent denominator until per-layer downloads are actually scheduled via addPendingEncodedDownload.
Recomputes the display meld/phase for every registered LayerTimeline (in sourceTimeHash) from the current global playhead and downloaded intervals.
Publishes newValue (floored at 0) as the current pending vector-download count.