terriajs
terriajs copied to clipboard
Leaflet rendering issue on multiple geojsons with same source
When having multiple GeoJSON items with the same URL, there is a rendering issue in Leaflet that GeoJson will be visible on the map when hidden or removed. Sometimes it happens that it doesn't render anything when only one item is shown. Everything works correctly in Cesium viewer Steps to reproduce:
- open http://ci.terria.io/next/#clean&https://gist.githubusercontent.com/zoran995/a8f0df9fdd22551e59d3270986051576/raw/f29c43bb69b0eff2b311337797609d05063a6217/simple.json
- change to leaflet viewer
- hide both layers
- show first layer (nothing renders - if the order of removing was the first layer and the second layer)
- show the second layer - the first one is rendered on the map
- try hiding or removing layers (points are rendered no matter what you do)
Haven't checked with other layer types. I was sure that something similar was happening with GeoJSON layers (and resolved) but can't find it anywhere edit: I was thinking that this is similar to #4342 but it is not
I can confirm similar behavior with multiple CZML datasources, it seems related to visualizers not being deleted correctly when disabling a catalog item. They seem to add up when enabling it again.
Still been struggling with this issue: Using entities.id check instead of contains when adding datasources to leaflet and removing the raiseToTop re stacking seems to fix the problem.
Maybe others can confirm my findings.
(Leaflet.ts)
This might be related to
- https://github.com/TerriaJS/terriajs/issues/6399
- https://github.com/TerriaJS/terriajs/issues/6344