Config playground

Interactive controls for map styling and layer management

View on GitHub
SDK 1.0.0-rc.7

The toggles turn traffic incidents, their icons, traffic flow, POIs and terrain shading on and off over one London map. The dropdown reloads all of it under another style.

  • Every layer here belongs to a style-owned module reached with get, which hands back one shared instance per map.
  • setVisible flips a whole module, and setIconsVisible splits the incident icons from the incidents themselves so each is its own switch.
  • setStyle reloads the style while those modules keep their visibility, so the toggles mean the same thing after the switch.
  • Hovering a module’s toggle shows its setting’s description, read by the setting’s id (visible, icons.visible or hillshade.visible) from that module’s knob catalogue: poisKnobCatalogue, trafficFlowKnobCatalogue, trafficIncidentsKnobCatalogue or terrainKnobCatalogue.

Related examples