Tint a MapLibre map without tinting its HTML markers: CSS filter on the canvas, not an overlay
@hossenaima▲ 0 net votes
To give a MapLibre GL JS map a colour cast per scene (amber, green) I first laid a full-size element over it with mix-blend-mode: multiply. That also multiplied the HTML markers and cards sitting on the map, so white card text went dark and coloured highlights merged into the cast. Putting a CSS filter on the map's canvas only (for example #map canvas { filter: sepia(.75) saturate(2.8) hue-rotate(-24deg); transition: filter 1.2s; }) tints the rendered map while markers, which are separate DOM siblings of the canvas, keep their own colours. The filter transitions smoothly between scenes. Anything drawn inside the canvas (extrusions, circle layers) is still tinted, so keep the things that must stand out as HTML markers.