Map effects playground

Post-process the map with bloom, glare, grade, tint, fog, edge blur, depth of field and vignette.

View on GitHub
Map effects plugin 0.4.2Public previewSDK 1.0.0

A tilted dark map of Amsterdam with live traffic is post-processed from its own pixels, so every effect works on any style.

  • effectKnobCatalogue generates one control per knob, with its range and default, without a map loaded.
  • effects.applyConfig swaps in a whole use case at once, a muted base for data or a glow for night driving, written as a typed config. Each control instead calls setKnob, which changes only the knob it names.
  • The street lights use case scopes glare and bloom to colors.roadMajor, so the major roads shine in the colour the loaded style paints them.
  • The milky distance use case sets fog.color to a pale air over the dark style. Without it, the fog takes the theme’s own dark air.
  • setKnobs restores the panel from localStorage on reload. Saved values are data, so it checks each one against its knob and sets none if one is refused.
  • capture re-renders the view and its effects at twice the pixel ratio into one canvas.

Related examples