kalisio / kano

Map and weather forecast data explorer in 2D/3D
https://kalisio.github.io/kano/
MIT License
24 stars 7 forks source link

Switching from 2D to 3D activity if a GeoJson layer is visible raises an error #169

Closed claustres closed 2 years ago

claustres commented 3 years ago

The following error is raised when switching from 2D to 3D activity if a GeoJson layer has been imported and is visible: TypeError: Cannot read property 'features' of undefined.

Linked to https://github.com/kalisio/kdk/issues/328.

robinbourianes-kalisio commented 3 years ago

What happens is destroyed gets called from mixin.base-map which calls this.map.remove() this.map.remove() iterate over it's layer calling remove() on them Realtime layer's remove method expects a geojson parameter which is then undefined, generating an exception.

We probably should clear the map before this.map.remove() in mixin.base-map destroyed.

robinbourianes-kalisio commented 3 years ago

The layer on which the error occurs is the selection layer that is added by mixin.feature-selection

claustres commented 3 years ago

Right, the issue has been identified in https://github.com/kalisio/kdk/issues/328, waiting for maintainer feedback.

What is strange is that the map should have been already cleaned here but it seems the layer is still referenced in Leaflet.

claustres commented 2 years ago

Seems to be closed now, possibly linked to https://github.com/kalisio/kdk/issues/328.