add Weather Layer
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
Built-in or configured weather product.
Optional stable id prefix; composite children get derived ids.
Optional existing layer id to insert below in the stack.
Optional callback to adjust the configuration before layers are added. Each call receives a new configuration instance (safe to mutate). Example — motorways with stroke thickness 5 (JS paint.stroke.thickness):
controller.addWeatherLayer(LayerCode.ROAD_MOTORWAY) { it.setLineStrokeThickness(5.0) }For CompositeWeatherLayerConfiguration, configure receives the composite; use com.xweather.mapsgl.weather.setLineStrokeThicknessOnAllLineLayers or edit CompositeWeatherLayerConfiguration.layers explicitly.
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
Source + layer descriptor + optional legend; composites recurse into sub-configs.
Optional id prefix for the new layer(s).
Optional insertion anchor in the layer stack.
Internal flag when recursing for composite layers.