addRasterLayer

fun addRasterLayer(code: String, id: String? = null, beforeId: String? = null): TileLayer?

Adds a raster layer for any Xweather Raster Maps product code.

The five satellite products in weather/groups/Raster.kt have LayerCode entries and go through addWeatherLayer; every other code the Raster Maps API serves has no enum entry, and a com.xweather.mapsgl.weather.WeatherConfiguration cannot be built without one. This is the path for those -- MapsGL JS's getRasterLayerConfig, which takes a bare code string.

mapController.addRasterLayer("radar-hybrid")

Registers the source and the layer together, both under raster.<code> as JS does. To adjust the paint first, build the pair with com.xweather.mapsgl.weather.WeatherService.makeRasterLayer and add it yourself.

Return

The new TileLayer, or null if the layer could not be added.

Parameters

code

Product code used in AMP raster tile and metadata endpoints.

id

Id for the source and layer; defaults to raster.<code>.

beforeId

Existing layer id to insert below; null appends on top.