joergdietrich / Leaflet.Terminator

Night and day regions on Earth
MIT License
120 stars 20 forks source link

How to remove terminator from the map? #19

Closed kevisong closed 4 years ago

kevisong commented 4 years ago

Hey guys.

This plugin is great. But I can't figure out how to remove the overlay from the map after adding it. I tried terminator().remove() but it didn't work. May be I did wrong.

Please advice! thx.

joergdietrich commented 4 years ago

You need to assign the terminator to a variable:

var t = L.terminator()

Then t.remove() will work. Note not parentheses after t.