Skip to main content

Module expr

Module expr 

Source
Expand description

MapLibre style-spec values: colors, property functions, expressions, and filters (both legacy and expression syntax).

Semantics follow @maplibre/maplibre-gl-style-spec so renders can match MapLibre GL JS pixel-for-pixel. Colors are stored premultiplied, as in the style-spec Color class, and are interpolated in premultiplied space.

Structs§

Color
Premultiplied RGBA in 0..=1, like the style-spec Color.
Ctx

Enums§

Kind
Kind of value a property expects; affects legacy-function defaults and how string constants are coerced.
Val

Functions§

eval_expr
Evaluate an expression. Non-array JSON evaluates to itself.
eval_filter
Evaluate a layer filter (legacy or expression) against a feature.
eval_property
Evaluate a paint/layout property value.
is_data_driven
True if evaluating j requires feature data (so it can’t be hoisted to once per layer).
is_expression_filter
MapLibre’s isExpressionFilter: decides legacy vs expression syntax.
layout_enum
An enum layout property (plain string or expression, e.g. [“step”, [“zoom”], “point”, 11, “line”]) evaluated at zoom (bucket layout properties use the tile zoom).