WeatherService

class WeatherService(val account: XweatherAccount)

High-level factory/service for MapsGL weather products and source descriptors.

WeatherService centralizes:

  • account-aware authentication (authenticator) for MapsGL/AMP requests,

  • sprite/style bootstrapping via loadStyles,

  • optional product metadata loading via loadLayerMetadata,

  • construction of source descriptors for raster, encoded, vector, AMP vector, and GeoJSON endpoints,

  • and convenient static product builders in the companion object (for example Temperatures, Radar, RoadMotorway).

Typical flow:

  1. Create service with XweatherAccount.

  2. Call loadStyles once the map object is available.

  3. Build weather layer configurations (for example through companion product functions).

  4. Register resulting sources/layers with MapController.

See also

Constructors

Link copied to clipboard
constructor(account: XweatherAccount)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val account: XweatherAccount

Account credentials used to sign and build weather API requests.

Link copied to clipboard

Shared request authenticator used by descriptor factories that require MapsGL auth.

Link copied to clipboard

true when loadStyles completes with no sprite generation/download failures.

Link copied to clipboard

Sprite/style loader used by loadStyles.

Functions

Link copied to clipboard

Fetches user-facing weather product metadata from layerMetadataURLPath.

Link copied to clipboard
suspend fun loadStyles(map: ImageRegisteringMap, dpr: Float = 1.0f)

Loads SDK sprite sheets and registers generated fallback assets used by weather symbol layers.

Link copied to clipboard

Creates an AMP vector source descriptor for a weather product code using default id format wx::<code>.

Creates an AMP vector tile source descriptor.

Link copied to clipboard

Creates an encoded source descriptor from a grouped dataset definition.

Creates a MapsGL encoded source descriptor for one or more encoded datasets.

Link copied to clipboard

Creates a GeoJSON source descriptor for an Xweather Data API route.

Link copied to clipboard

Creates a raster source descriptor for a weather product code using default id format wx::raster.<code>.

Creates a raster image source descriptor for tile-based weather imagery.

Link copied to clipboard

Creates a vector source descriptor for a weather product code using default id format wx::<code>.

Creates a MapsGL vector tile source descriptor.