ExpressionContext

data class ExpressionContext(val properties: Map<String, Any?> = emptyMap(), val zoom: Double? = null, val mapTimeSeconds: Double = 0.0, val nowSeconds: () -> Double = { System.currentTimeMillis() / 1000.0 })

Inputs an expression is evaluated against.

Constructors

Link copied to clipboard
constructor(properties: Map<String, Any?> = emptyMap(), zoom: Double? = null, mapTimeSeconds: Double = 0.0, nowSeconds: () -> Double = { System.currentTimeMillis() / 1000.0 })

Properties

Link copied to clipboard

Timeline playhead for ["map-time"], in Unix seconds. JS 1.9.4 made seconds the contract for every time operator; milliseconds here would compare three orders of magnitude off against a feature timestamp, and silently.

Link copied to clipboard
val nowSeconds: () -> Double

Wall clock for ["now"], in Unix seconds. Injectable so tests are not racing the clock.

Link copied to clipboard

Feature properties. Dotted keys (report.cat) walk nested maps.

Link copied to clipboard
val zoom: Double? = null

Current map zoom for ["zoom"]. When null, falls back to a $zoom or zoom property, then 0 — the same lookup order MapsGL JS uses.