Back to all examples
Map styling playground
Restyle the map from panels built off the knob catalogues of each module drawing it: sizes, road markings, hillshade, POI and traffic colours, map presets, and whole layer groups
Every control restyles the map live: sizes, road markings, base-map groups, hillshade, and POI, traffic and map colours.
- The panel is generated from the knob catalogues of the modules that draw the map:
stylingFoundationsKnobCataloguefor the foundations (sizes, map colours, projection), and the look knobs ofBaseMapModule(road markings),POIsModule, the traffic modules andTerrainModule(hillshade). Each control starts fromgetKnoband sets its value withsetKnob, so no layer or paint property is yours to find. - Map presets come from
mapPresetCatalogue, andapplyMapPresetsets each one across those modules. - Whole layer groups (water, railways, 3D buildings, road shields…) are
BaseMapModule’s, so their toggles come frombaseMapKnobCatalogue, through the same control builder. - The knobs survive a
setStyle, as do the two layer edits throughstyling.layers.query, which reset keeps because they are not settings. A query’sgroupnames base-map layers or another module’s, here the traffic flow lines.
Related examples
Layer group toggling
Control individual base map layer groups
Customization
Base Map
Map Style
Web
Map layer groups visibility animation
Making key layers of the map appear in an animation.
Base Map
Customization
Map Style
Web
Map Chat Agent
Interactive map assistant using AI to control maps and services
AI
Places and Search
Map Style
Base Map
Geometry
Traffic
Routing
Web
Playground
Plugins
Map Chat Agent State Playground
Interactive map assistant using AI to control maps and services
AI
Places and Search
Map Style
Base Map
Geometry
Traffic
Routing
Web
Playground
Plugins