Skip to main content

Cubic Bézier style interpolation

Standard nonlinear numeric and color curves driven by properties or zoom

Supported numeric and color paint properties accept cubic-bezier. All four controls must be finite constants; x controls range from 0 to 1, while y controls may overshoot. Stops remain strictly increasing constants. A zoom input must remain in an outer interpolation, optionally as the final expression of let.

map.setPaintProperty('points', 'circle-radius', [
  'interpolate', ['cubic-bezier', 0.42, 0, 1, 1],
  ['get', 'value'], 0, 10, 1, 30
]);
await map.sqs.flush({ render: true });

At input 0.5 this curve produces approximately 16.3071. Numeric results retain overshoot; RGBA channels are clamped to valid ranges. Outside the stops, endpoint values apply. Invalid curves fail and preserve the previous style. Runtime feature type failures retain existing default/warning behavior.

The shared core uses a solver with at most 32 steps across native and WASM/Worker, with no new host method. Existing ordinary paint expressions support property, state and zoom inputs. Dedicated heatmap-density/elevation ramps still require linear interpolation; LAB/HCL and array interpolation remain pending.

The complete HTML example includes all controls, data, style and attribution text. Syntax follows the public MapLibre specification; SqsMap implements its own mathematics.