Paint Spec
Bundle of zoom-interpolated paint properties for one rule. Fields default to "draw nothing"; supply only what your rule needs and the rest stays inert.
Shape paint (polygons / lines):
fillColor (+ optional fillOpacity) → polygon fill
lineColor + lineWidth (+ optional lineOpacity) → polygon/line stroke Both shape paint groups can coexist on one rule — a polygon with both fill and outline.
Text paint (point labels):
textField → name of the feature property whose value becomes the label text. If null, this rule produces no label. If the property is missing/empty on a given feature, that feature is skipped silently.
textColor, textSize → the text glyphs; textSize is in pixels.
textHaloColor + textHaloWidth → optional outline behind text for readability over busy backgrounds.
fontFamily, fontWeight → platform-resolved (system default if null).
Shape and text paint are independent: a rule with both will produce both renderable types for matching features. In practice text rules apply to POINT features and shape rules to POLYGON/LINESTRING, so the geometryType gate keeps them separate.
Constructors
Properties
Optional fill-extrusion-base — height of the building's base above terrain (meters). Defaults to 0 = ground-rooted. Use for upper-floor extrusions (tower on a podium).
Mapbox fill-extrusion-height — when set, polygon features are extruded as 3D boxes from the ground up to this height (meters). Routed through earth.worldwind.layer.buildings.OsmBuildingsTile. Mutually exclusive with the flat-fill path: features matching a rule with extrusion bypass MvtBatchedPolygonTile.
True when this rule emits 3D extruded polygons (e.g. buildings).
True when this rule paints a varying color along the line's arc-length parameter.
One of "center" | "top" | "bottom" | "left" | "right" controlling where on the icon the geographic anchor sits. Defaults to center.
Mapbox-style icon-image — name of the icon to look up in the layer's sprite atlas. Strings can include {property} placeholders for per-feature substitution (e.g. "poi-{kind}"), matching Mapbox GL's icon-image template form.
Offset in icon-pixel space, applied to the icon's anchor point. Mapbox's icon-offset is a 2D vector; we accept the X component here for the common case of horizontal text-anchored icons.
Multiplier applied to the icon's pixel size; defaults to 1.0.
True iff any of this paint's zoom/expression-driven outputs vary per feature within a single tile — i.e. some expression references feature data (get/has/feature-state/ geometry-type/line-progress). Computed once (lazily) by walking every paint expression's tree; constant literals and ["zoom"] interpolations don't count (zoom is fixed within a tile). When false, MvtVectorLayer resolves this rule's paint ONCE per tile and reuses the result for every matching feature.
Optional casing stroke — Mapbox's "road shoulder" effect. When set, the layer emits a SECOND line stroke for the same feature at a wider lineCasingWidth in lineCasingColor, painted under the main line. Used for road outlines (white road over dark grey casing), railway double-stripes, etc.
Casing width in pixels. Should be >lineWidth; the visible casing thickness on either side of the fill line is (lineCasingWidth - lineWidth) / 2.
Mapbox line-dasharray — alternating dash + gap lengths in line-width multiples. [2, 2] = 2 units on, 2 off, repeating. [3, 1, 1, 1] = long-short-short pattern.
Mapbox line-gradient — a color expression that varies along the line's arc-length parameter via ["line-progress"]. The layer subdivides each polyline into GRADIENT_SUBDIVISIONS segments and samples the gradient at each segment's midpoint to produce a piecewise-constant approximation that flows through the existing batched line path (no shader changes). Visually close enough for standard "elevation-tinted route" use; near-instant transitions look slightly stepped at the segment boundaries.
Mapbox text-max-width — maximum label width in em units (multiples of font size). When set, buildText inserts \n at the last word boundary before each overflow, producing a multi-line label. Default unset = no wrapping.
Placement strategy for labels. LabelPlacement.POINT is the default and matches POINT features at their geographic anchor; LabelPlacement.LINE places one label per matching LINESTRING feature at its midpoint, rotated to follow the local tangent. Set via the DSL's text(field) { placement = ... } block.
Mapbox text-transform: uppercase — render the label in all caps (country/region convention).
Functions
Resolve the casing-stroke ShapeAttributes for one feature. Returns null if this rule has no casing paint. The result is meant to be emitted as a SEPARATE line shape at a slightly lower z-order than build's result, so the wider casing paints underneath the narrower fill.
Sample lineGradient at the given progress (arc-length parameter ∈ 0, 1) for one feature. Returns null when the rule has no line-gradient.
Resolve this rule's icon paint for one feature. Returns null when iconImage is unset, or when the resolved icon name (after {property} substitution) is empty. Caller is responsible for looking up the name in an MvtSpriteAtlas.
Resolve the label text + TextAttributes for one feature. Returns null if this rule isn't a text rule (hasText is false), or if the feature has no value for textField, or the value's string form is empty.