Closed fogfish closed 6 years ago
The issue is reproducible when you are using the gl layer in react base application together with react-leaflet.
It crashes with following error when component is destroyed:
TypeError: undefined is not an object (evaluating 'obj[eventsKey]') at removeOne leaflet-src 2708
The original TileLayer works as expected.
It is hard to say what component is root cause. However, it is trigged due to undefined _map._proxy at onRemove. https://github.com/mapbox/mapbox-gl-leaflet/blob/master/leaflet-mapbox-gl.js#L87
_map._proxy
onRemove
It see extremely trivial fix here.
The issue is reproducible when you are using the gl layer in react base application together with react-leaflet.
It crashes with following error when component is destroyed:
The original TileLayer works as expected.
It is hard to say what component is root cause. However, it is trigged due to undefined
_map._proxy
atonRemove
. https://github.com/mapbox/mapbox-gl-leaflet/blob/master/leaflet-mapbox-gl.js#L87It see extremely trivial fix here.