set Paint Property
Sets a paint style property on a layer at runtime, addressed by key path.
Array entries use bracket notation, matching MapsGL JS. text[0] is the first text paint on a symbol layer, such as a place-name layer:
mapController.setPaintProperty("admin.place_city.text", "text[0].size", 20.0)
mapController.setPaintProperty(layerId, "sample.colorscale", colorScale)value may be a ready com.xweather.mapsgl.style.StyleValue -- including an com.xweather.mapsgl.style.StyleValue.Expression, so text can scale with zoom -- or a plain Number, Color or hex String, which is wrapped as a constant.
One call covers everything applying a paint change needs, which is what MapsGL JS's setPaintProperty does: it writes the value, lets the paint emit its own PAINT_CHANGE where it has one (so a bar legend follows a sample.colorscale change), asks the renderer to rebuild any GL state that is built once rather than per frame, and invalidates the layer. The equivalent by hand is three steps and easy to get half right.
See PaintPropertyWriter for the supported paths. An unknown layer, malformed path, unsupported property or uncoercible value is logged and ignored rather than throwing, but never silently succeeds: previously this method accepted every call and did nothing.
Parameters
Target layer id, as returned by addLayer / addWeatherLayer.
Key path of the paint field, e.g. "text[0].size".
New value to apply.