Open roddc opened 4 years ago
It appears to me that the layer of this plugin implements the remove layer interface in order to manage the removal of some features. However, when destroying the map Leaflet calls remove()
on each added layer so that the interface will be called without any argument, causing an exception as the plugin always expects a geoJson object input. In this specific case we should simply remove all features, but not sure of side-effects of doing so, maybe @perliedman could provide some feedback?
Maybe a workaround is to remove the layer before destroying the map using map.removeLayer(layer)
.
Would be happy to push a PR but only if it's relevant, @perliedman I hope you will be able to provide some feedback, thanks.
Seems to be fixed by PR https://github.com/perliedman/leaflet-realtime/pull/146.
I am using leaflet-realtime in Angular as a directive with @asymmetrik/ngx-leaflet. I got an error 'TypeError: Cannot read property 'features' of undefined' when removing the map. How do I fix this?