Back to all examples
Traffic incident focus
Bring a city's traffic incidents forward and push the rest of the map back, with one switch
One switch brings London’s incidents and boundary forward and pushes traffic flow, POIs and road labels back; switch it off and every layer returns to its default.
styling.layers.queryselects the style’s layers by group,trafficFlowandpoisincluded, so one call fades a whole module’s layers andresetundoes it.- Those queries reach only the style’s own layers:
the incidents and the boundary take theirs through each module’s
layersconfig, set withupdateConfigand merged over the defaults rather than replacing them.
Related 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
Customization
Base Map
Map Style
Traffic
Web
Borrowed looks
Places, a route and fetched traffic incidents drawn in the style's own look, following the styling knobs that restyle it, live
Customization
Map Style
Places and Search
Routing
Traffic
Web
Globe and 3D terrain
Switch the map to a globe with an atmosphere with the styling foundations module's view knobs, or raise it in 3D with the terrain module
Customization
Map Style
3d
Web
Layer group toggling
Control individual base map layer groups
Customization
Base Map
Map Style
Web