Switch to dark mode inside tunnels

This example shows how to change the map mode (light/dark) based on the position in a route.

This example uses the animation of a point along a route to simulate the movement of a vehicle. In the example we simulate that the vehicle enters a tunnel to change the map style to dark and then change it back to light when the vehicle exits the tunnel. Download the vehicle image here and download the route geoJSON here

An extension of MapLibre GL JS