Solar Terminator with layers clipping
This example displays a world map with a day/night terminator boundary that updates in real time, and uses that boundary to clip an overlaid tile layer so the dark side of the Earth appears grayscale while the lit side remains colored. A red star marks the user’s current location. The terminator path is generated by the Leaflet.Terminator plugin, which computes the sun’s position and latitude per longitude; a D3-selected SVG clipPath is updated every 500 milliseconds and applied via CSS `clip-path` to the overlay’s container. The overlay uses Stamen toner tiles, and a luminance-to-alpha SVG filter enables the masking effect.
AI-generated descriptionSolar Terminator with layers clipping.
Path generated by Leaflet.Terminator plugin used for clipping layers, night effect on tiles created with help of SVG filter. Your location marked with red star. All works great on firefox.
Leaflet + Leaflet.Terminator.