addWeatherLayer

fun addWeatherLayer(layerCode: LayerCode, id: String? = null, beforeId: String? = null): TileLayer?

Adds a weather layer from a LayerCode preset (source + descriptor + paint from service).

Return

The primary new TileLayer, or null if configuration is invalid.

Parameters

layerCode

Built-in or configured weather product.

id

Optional stable id prefix; composite children get derived ids.

beforeId

Optional existing layer id to insert below in the stack.


fun addWeatherLayer(config: WeatherConfiguration, id: String? = null, beforeId: String? = null, isCompoundLayer: Boolean = false): TileLayer?

Adds a weather layer from an explicit WeatherConfiguration (use when you built the config from WeatherService factories instead of LayerCode).

Return

The primary new TileLayer, or null if the configuration cannot be applied.

Parameters

config

Source + layer descriptor + optional legend; composites recurse into sub-configs.

id

Optional id prefix for the new layer(s).

beforeId

Optional insertion anchor in the layer stack.

isCompoundLayer

Internal flag when recursing for composite layers.