opendata-stuttgart / feinstaub-map-v2

23 stars 19 forks source link

Disable wind layer when the tab is inactive #41

Open LuchtwachtersDelft opened 2 years ago

LuchtwachtersDelft commented 2 years ago

The wind layer is leaking a huge amount of RAM. If you leave the website running in a tab and forget about it, the browser eventually eats several GB worth of memory.

I suggest to disable the wind layer automatically when the tab is inactive, and/or to not start the wind layer on page visit.

To detect tab activity, maybe look into the document.hidden property.