makeRasterLayer

Source and layer for any Xweather Raster Maps product code, whether or not it has a LayerCode of its own.

weather/groups/Raster.kt hand-writes five satellite products; every other code the Raster Maps API serves had to be assembled by the caller. This is MapsGL JS's getRasterLayerConfig, which builds the same pair from a bare code string, and it uses JS's ids: raster.<code> for both the source and the layer.

It deliberately returns the two descriptors rather than a com.xweather.mapsgl.weather.WeatherLayerConfiguration. That interface requires a LayerCode, which is a generated enum with no entry for an arbitrary code and no way to add one, so a configuration cannot be expressed for a product the enum has never heard of. The descriptors carry everything com.xweather.mapsgl.map.MapController.addRasterLayer needs, and a caller who wants to adjust paint or quality before adding can do it here.

val (source, layer) = service.makeRasterLayer("radar-hybrid")
layer.paint.opacity = 0.6f

Parameters

code

Product code used in AMP raster tile and metadata endpoints.

id

Id for both descriptors; defaults to JS's raster.<code>.