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

Changing tiles #16

Open maeneak opened 5 years ago

maeneak commented 5 years ago

What is the recommended way to change tiles (json) at runtime? I have tried removing the layer and re-creating it but i end up with gl context is null errors. Im using this in react so its possible its purely a react issue.

maeneak commented 5 years ago

Ok so i had to add an onRemove handler in the particle class and disconnect the Particle class 'move' event from the map. map.off("move", this.move);

maeneak commented 5 years ago

Actually just adding the line in the 'Layer' onRemove handler did the trick

learnurban commented 7 months ago

@maeneak Sorry for taking your time. Can you provide the detailed trick method for changing tiles (json) at runtime?