Back to all examples
Map colours
Recolour the whole base map with ten semantic colours in one call: every shade, outline and variant the style derived from one of them follows it
Pick a colour set from the panel, or set one of the ten colours by hand, and the map redraws under it.
setMapColorstakes any subset of the ten and re-derives every shade the style built from each one, by the style’s own offsets, so a set recolours the map rather than inverting it.- Each picker starts from
styling.get, which reads the colour in force off the loaded style, so the pickers follow a style switch with no colour table of their own. exportStylereturns the recoloured style as a MapLibreStyleSpecification, ready to store or diff.
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 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
Map theme from colours, an image or CSS
Theme the whole map from a few colours (a brand, an artist, a mood), an image's dominant colours or a website's stylesheet
Customization
Base Map
Map Style
Plugins
Web