XweatherEncodedTileSource

XweatherEncodedTileSource.kt

A subclass of EncodedTileSource that is used to request and process encoded tile data from the MapsGL server.

Based on the IOS version.

Author

Jason Suto 01/08/24

Constructors

Link copied to clipboard
constructor(id: String, authenticator: XweatherAuthenticator?)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var bounds: LatLonBounds?
Link copied to clipboard
open override var datasets: List<DatasetType>
Link copied to clipboard
open override val eventDispatcher: EventDispatcher
Link copied to clipboard
open override var id: String

Same id as the registered style source / descriptor.

Link copied to clipboard
open override val isEncoded: Boolean = true
Link copied to clipboard
Link copied to clipboard
open override var isReady: Boolean

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var kind: DataSourceKind

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

com.xweather.mapsgl.map.MapController.mapSessionId that owns in-flight / ready tile bookkeeping.

Link copied to clipboard
Link copied to clipboard
val requests: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
open override var tileCache: TileCache<DataType>
Link copied to clipboard
open override var tileManager: TileRequestManager<DataType>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var timeRange: ClosedRange<Date>?

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

Link copied to clipboard
Link copied to clipboard

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

Functions

Link copied to clipboard
open override fun addConsumer(consumer: DataSourceConsumer)

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

Link copied to clipboard
fun addOnEncodedTileReadyListener(listener: (TileCoord) -> Unit)
Link copied to clipboard
fun addToAnimationQueue(inputString: String)
Link copied to clipboard
fun adjustDateBySeconds(dateString: String, offsetSeconds: Long): String?

Used by prepareTileRequest() to increment or decremnet the time and reformate it for sources with time offets

Link copied to clipboard
fun cleanup()
Link copied to clipboard
open fun contains(coord: TileCoord): Boolean
Link copied to clipboard
fun <DataType : TileData> TileSource<DataType>.contains(coord: TileCoord): Boolean
Link copied to clipboard

Returns the data range for the specified channel.

Link copied to clipboard
fun extractValidTimes(jsonString: String): List<String>
Link copied to clipboard
open suspend override fun fetchMetadata(startDate: Date?, endDate: Date?): Result<Unit>

Returns the metadata for the source, which can be loaded from a remote source.

Link copied to clipboard
Link copied to clipboard

Test function to detect color format of image

Link copied to clipboard
Link copied to clipboard
open override fun getMetadataURL(): URL?
Link copied to clipboard
open fun getTileData(coord: TileCoord): Any?
Link copied to clipboard
fun <DataType : TileData> TileSource<DataType>.init(id: String, authenticator: Authenticator<MediaSession.Token>?)
Link copied to clipboard
fun intervalToIsoPathTime(intervalTime: String): String

Plain ISO-8601 for URL path {time} segments (encoded tile GET). Cache keys and POST validTimes still use bracketed ["…"] strings.

Link copied to clipboard
fun intervalToURLTime(intervalTime: String): String

convert from \"2025-04-22T03:49:31Z\" to 20250422030000

Link copied to clipboard
fun makeTileURL(coord: TileCoord, variables: Map<String, Any>?): URL
Link copied to clipboard

Returns the metadata for the specified channel, if available.

Link copied to clipboard
Link copied to clipboard
fun onTileError(tile: TileType, error: Error)
Link copied to clipboard
suspend fun onTileLoaded(tile: TileType, intervals: List<String>?, mode: Int, imageBytes: ByteArray? = null)

Backfills the edges of the tile with its neighbors' data and vice versa. This mirrors the logic found in the JavaScript SDK for seamless tile stitching.

Link copied to clipboard
suspend fun parseTile(tile: TileType, data: ByteArray, headers: <Error class: unknown class><Any, Any>?): Bitmap
Link copied to clipboard
open fun prepareTileRequest(request: URLRequest, timeString: String?)
fun prepareTileRequest(request: URLRequest, timeString: String?, intervals: List<String>?)
Link copied to clipboard
inline fun <EventType : Event> EventSource.publisher(eventType: Class<EventType>): Flow<EventType>
Link copied to clipboard
open override fun removeConsumer(layerId: String)

Removes a consumer

Link copied to clipboard
Link copied to clipboard
open suspend override fun requestTiles(coord: TileCoord, options: TileRequestOptions, currentDate: String, fromAnimation: Boolean, intervals: List<String>?, trackDownloadProgress: Boolean): Any
Link copied to clipboard
fun setObserver(observer: Observer<String>, layerID: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline suspend fun <EventType : Event> EventSource.subscribe(eventType: Class<EventType>, crossinline handler: (EventType) -> Unit)
Link copied to clipboard