@@=[...] — Inline Expressions

Evaluate MapLibre expressions for data-driven styling and dynamic accessors.

@@=[expression]

How it works

Strings starting with @@= are treated as inline expressions. The converter strips the prefix and converts the value into a function or expression that MapLibre evaluates at render time.

This is commonly used for accessor functions (e.g., extracting coordinates from GeoJSON features) and for data-driven styling with MapLibre expressions.

Syntax

Property accessor
{
  "getPosition": "@@=geometry.coordinates"
}
MapLibre case expression
{
  "fill-color": [
    "case",
    [
      ">",
      [
        "get",
        "pop_est"
      ],
      50000000
    ],
    "#dc2626",
    "#3b82f6"
  ]
}

Examples

Conditional styling with case expression
Combine @@#params with MapLibre expressions for parameterized data-driven styles.
Input
{
  "paint": {
    "fill-color": [
      "case",
      [
        ">",
        [
          "get",
          "pop_est"
        ],
        "@@#params.threshold"
      ],
      "@@#params.above_color",
      "@@#params.below_color"
    ],
    "fill-opacity": "@@#params.opacity"
  }
}
Controls
50M
0.7
Output
{
  "paint": {
    "fill-color": [
      "case",
      [
        ">",
        [
          "get",
          "pop_est"
        ],
        50000000
      ],
      "#dc2626",
      "#3b82f6"
    ],
    "fill-opacity": 0.7
  }
}
Tips & Gotchas
  • Expressions follow MapLibre expression syntax — the same format used in MapLibre style specs.
  • @@= is resolved in Stage 2 by the JSONConverter.
  • For accessors, the expression after @@= is converted into a function that receives each data feature.