While working on improving FileSource and DataSourceProvider (#1033), I encountered some weird behavior, that is already present in iTowns. When adding a not tiled color layer (with FileSource), textures on affected tiles are badly cleaned and it results in a visual glitch (no texture at all on those tiles) that is only fixed when executing a view.notifyChange(view.tileLayer);.
Overall, from what I understood while looking into it, it seems to come from when a layer is added and it is added on a node. After this, when logging things in LayeredMaterial, we can see that other layers (apart from the added one) are not present anymore in the material. Things have been disposed in TiledLayerGeometry#update, and commenting all ObjectRemovalHelper calls results in partially fixing the problem (but create others problems, so not a solution at all).
I don't know where I could continue looking, so if someone can led a hand, that would be great.
Context
While working on improving
FileSource
andDataSourceProvider
(#1033), I encountered some weird behavior, that is already present in iTowns. When adding a not tiled color layer (withFileSource
), textures on affected tiles are badly cleaned and it results in a visual glitch (no texture at all on those tiles) that is only fixed when executing aview.notifyChange(view.tileLayer);
.I'm looking for a better way to fix this problem.
Steps to Reproduce
globe_vector
exampleview.addLayer(gpxLayer);
lineview.addLayer(gpxLayer);
and see the problemExpected Behavior
The added layer should simply appear on top of the existing one.
Actual Behavior
The added layer appears partially, and some of the existing one is not visible anymore.
Possible Cause/Fix/Solution
Some ideas that could be looked into:
update
process ofTiledGeometryLayer
ColorLayer
inLayeredMaterialNodeProcessing
Overall, from what I understood while looking into it, it seems to come from when a layer is added and it is added on a node. After this, when logging things in LayeredMaterial, we can see that other layers (apart from the added one) are not present anymore in the material. Things have been disposed in
TiledLayerGeometry#update
, and commenting allObjectRemovalHelper
calls results in partially fixing the problem (but create others problems, so not a solution at all).I don't know where I could continue looking, so if someone can led a hand, that would be great.