Change between light and dark mode based on the time of day

This example shows how to change the map mode between light and dark based on the time of day.

This example uses the MapTiler Geolocation API to get the user’s location and the SunCalc library to calculate sunrise and sunset times based on the user’s location.

An extension of MapLibre GL JS