I'm working with Leaflet and I'd like to show the day and night zones adding a dynamic layer to my map. I was thinking to add a static layer with some transparency and make it move every x minutes but it's tricky because the shape of the shadow... changes all the time during the year.

Does anyone know if there exists some open source layers for every season or better if I could find a way to calculate an accurate geojson layer for the earth's shadow ?


There is a plugin for that: Leaflet.Terminator.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • Is there anything that is not present as a plugin for leaflet? – Devdatta Tengshe Jul 10 '14 at 15:16
  • @Ilja Zverev, thanks a lot it works perfectly ! a snapshot of the result here : twitter.com/PopTweetsLive – Julien_ Jul 19 '14 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.