Style Value
Paint or layout property value: either a constant literal or a Mapbox-style expression.
MapsGL uses StyleValue anywhere a style property can be static or data-driven (for example StrokePaint.thickness, colors in FillPaint, or zoom interpolation). Constants serialize to JSON literals; StyleValue.Expression variants serialize to Mapbox expression arrays/objects via com.xweather.mapsgl.style.Expression.toJSONObject.
Use Constant for fixed values known at compile time. Use StyleValue.Expression (or fromExpressionArray) when the value should follow feature data, zoom, or other runtime inputs, matching the JavaScript SDK’s expression arrays.
Parameters
Type of the value held by Constant (covariant; StyleValue.Expression uses Nothing because it does not carry a single Kotlin-typed literal).
See also
Inheritors
Types
Properties
The Constant.value when this is a Constant; otherwise null.
The wrapped com.xweather.mapsgl.style.Expression when this is a StyleValue.Expression; otherwise null.
JSON-ready representation: constants pass through makeJSONObject, expressions through com.xweather.mapsgl.style.Expression.toJSONObject. Useful for debugging or custom style serialization.