astrosat / windgl

A WebGL wind particle simulation as a Mapbox custom layer
https://astrosat.github.io/windgl/
ISC License
170 stars 45 forks source link

Delete commands destroy context #19

Open maeneak opened 5 years ago

maeneak commented 5 years ago

delete commands destroy the gl context causing failure when removing and adding layers to re-create the source.

maeneak commented 5 years ago

Also added line to remove 'move' hook #16

gampleman commented 5 years ago

I'm not sure this is the right way to handle this. In theory the map and gl references are no longer valid after onRemove (and potentially should be allowed to be garbage collected). These references should be re-added when onAdd gets called again.

So if this is causing errors, the bug is likely somewhere else (i.e. code assuming gl context is running after onRemove has been called).