DataSource

Runtime data provider backing one or more com.xweather.mapsgl.layers.tile.MapLayer instances.

Created from a com.xweather.mapsgl.sources.source.spec.SourceDescriptor via com.xweather.mapsgl.map.MapController.addSource. Subtypes include raster, encoded grid, vector, and GeoJSON sources.

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard
abstract val id: String

Same id as the registered style source / descriptor.

Link copied to clipboard
abstract var isReady: Boolean

true when metadata (and any bootstrap work) is available so layers can request tiles safely.

Link copied to clipboard
abstract val kind: DataSourceKind

High-level source family (raster, encoded, vector, …).

Link copied to clipboard
abstract var timeRange: ClosedRange<Date>?

Optional interval filter for time-series products; drives tile requests with timeline state.

Link copied to clipboard

Alias for DataSource.kind (matches JS naming type).

Functions

Link copied to clipboard
abstract fun addConsumer(consumer: DataSourceConsumer)

Register a layer that should receive updates when this source loads or changes.

Link copied to clipboard
inline fun <EventType : Event> EventSource.publisher(eventType: Class<EventType>): Flow<EventType>
Link copied to clipboard
abstract fun removeConsumer(layerId: String)

Unregister a layer previously added with addConsumer.

Link copied to clipboard
inline suspend fun <EventType : Event> EventSource.subscribe(eventType: Class<EventType>, crossinline handler: (EventType) -> Unit)
Link copied to clipboard