Skip to content

ExpressionSchema

const ExpressionSchema: z.ZodType<any[]>

Defined in: packages/core/src/schemas/base.schema.ts:224

MapLibre expression for data-driven styling.

MapLibre expressions provide powerful data-driven styling capabilities. An expression is an array where the first element is the operator name.

Common Operators:

  • get - Get feature property
  • interpolate - Interpolate between values
  • match - Match values
  • case - Conditional logic
  • step - Step function

This schema provides basic validation (array starting with string). Full expression syntax is validated by MapLibre at runtime.

Get Property

text-field: ["get", "name"]

Interpolate by Zoom

circle-radius:
- interpolate
- ["linear"]
- ["zoom"]
- 5
- 2
- 15
- 10

Match Values

circle-color:
- match
- ["get", "type"]
- "park"
- "#228B22"
- "water"
- "#4169E1"
- "#808080"

MapLibre Expressions