Companion

object Companion

Properties

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
val pendingEncodedDownloadsLiveData: LiveData<<Error class: unknown class><String, List<String>>>

Snapshot of pendingEncodedDownloadsState. Each posted HashMap and its List values are not mutated after publish; readers (UI observers, GL thread) can iterate safely.

Link copied to clipboard

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.

Link copied to clipboard

Functions

Link copied to clipboard

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.

Link copied to clipboard

Authoritative count from pendingEncodedDownloadsState (not the LiveData snapshot).

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Decrements the pending vector-download count by one, floored at 0.

Link copied to clipboard

Removes and returns source ids that need a fill-interval download pass.

Link copied to clipboard

Converts a Date object to an ISO 8601 string in UTC.

Link copied to clipboard

Increments the pending vector-download count by one.

Link copied to clipboard

True when the global timeline is parked on the final interval (playing or stopped).

Link copied to clipboard
fun isEncodedBindPending(sourceId: String, tileHashShort: String, phaseString: String): Boolean

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).

Link copied to clipboard

Removes a download item from the pending list for a given ID. If the list becomes empty, the ID is removed from the map.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Recomputes the display meld/phase for every registered LayerTimeline (in sourceTimeHash) from the current global playhead and downloaded intervals.

Link copied to clipboard

Publishes newValue (floored at 0) as the current pending vector-download count.