Skip to main content

Scalar math style expressions

Shared numeric functions, constants and invalid-data behavior

Supported ordinary paint and numeric filter/cluster expressions use the same native/WASM implementation:

CategoryOperators
Zero-argument constantsln2, pi, e
Unary functionssqrt, log10, ln, log2, sin, cos, tan, asin, acos, atan, round, abs, ceil, floor
Binary functions%, ^, /, binary -
OtherUnary -; +, *, min, max accept one or more numbers
map.setPaintProperty('points', 'circle-radius', [
  '*', 5, ['sqrt', ['get', 'value']]
]);
await map.sqs.flush({ render: true });

Trigonometric units are radians. Halfway round values go toward positive infinity: -1.5 becomes -1. Remainders retain the dividend's sign. Domain errors, division by zero and nonfinite results cannot return valid numbers. Invalid runtime feature data uses existing paint defaults/warnings and recovers on valid updates; direct numeric evaluation reports an error. Invalid arity/static types fail before mutation and preserve the previous style.

Existing 8,192-step/64-depth budgets apply, with no new dependency or host method. Spatial distance/within and special values remain separate work. Caught command errors still remain in history: pass the observed error watermark as subsequent flush.since, following command confirmation.

The complete HTML includes data, four controls, formulas and credits. Names and argument shapes follow the public MapLibre specification; SqsMap implements them independently.