iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.08k stars 293 forks source link

[Bug - ElevationLayer] Issues caused by the removal of an ElevationLayer #2221

Closed AnthonyGlt closed 5 months ago

AnthonyGlt commented 8 months ago

When we remove an ElevationLayer, the map bugs, tiles has faulty loading and may crash the browser

Your Environment

Master Branch

Context

On this video, I've implemented 2 buttons to use on the view_25d_map example "Terrain IN" does view.addLayer(wmsElevationLayer); "Terrain OUT" does view.removeLayer('wms_elevation');

Screencast from 06-11-2023 16:21:03.webm

You can notice that the behavior is not the same before adding the terrain and after removing it. It should be the same

I tried it on the globe using view_3d_map example. The terrain is already added at the beginning, I juste remove it using the button, which does

//ids => list of the elevation layers ids
for (id of ids) {
 view.removeLayer(id);
}

Screencast from 06-11-2023 16:36:26.webm

Same weird behavior and a huge decrease in performances. I've tried with the cache boolean view.removeLayer(id, cacheBoolHere);, the behavior differs but no improvement.

Expected Behavior

I expect when deleting the elevationlayer to have the same behavior as if the elevationlayer was never added

jailln commented 6 months ago

I tried it on my end and removing the cache seems to correct the issue for me. Can you test again @AnthonyGlt ?