Skip to content

clear children after dispose in imageFormatPlugin#1556

Open
WilliamLiu-1997 wants to merge 2 commits intoNASA-AMMOS:masterfrom
WilliamLiu-1997:imagePluginTreeNodeFix
Open

clear children after dispose in imageFormatPlugin#1556
WilliamLiu-1997 wants to merge 2 commits intoNASA-AMMOS:masterfrom
WilliamLiu-1997:imagePluginTreeNodeFix

Conversation

@WilliamLiu-1997
Copy link
Copy Markdown
Contributor

relate to #1554

@gkjohnson
Copy link
Copy Markdown
Contributor

Thanks! Can you make sure you've tested with "TilesRenderer.optimizedLoadStrategy = true", as well, and test for regressions when scrolling around in the "mapTiles" and "wmtsTiles" demos, as well? They both use plugins that are based on ImageFormatsPlugin.

@gkjohnson gkjohnson added this to the v0.4.25 milestone Apr 11, 2026
@WilliamLiu-1997
Copy link
Copy Markdown
Contributor Author

WilliamLiu-1997 commented Apr 11, 2026

optimizedLoadStrategy

optimizedLoadStrategy and mapTiles/wmtsTiles work, but I found an issue on this change:

If we set children.length = 0 in disposeTile(), then when we access this node later, the ensureChildrenArePreprocessed function in TilesRendererBase.js will see children.length === 0 and skip preprocessing the children. As a result, the level of detail gets stuck at a mid-level and cannot progress further.

I will investigate this and will let you know when I fix this issue

@gkjohnson
Copy link
Copy Markdown
Contributor

I think it's worth reviewing what QuatizedMeshPlugin is doing more completely. In that plugin children are expanded in the "parseToMesh" function which means that children will only be available once the parent tile has been loaded and then, symmetrically, those children are deleted when the tile is unloaded in "disposeTile". We should follow this same pattern in "ImageFormat" plugin.

@WilliamLiu-1997
Copy link
Copy Markdown
Contributor Author

I think it's worth reviewing what QuatizedMeshPlugin is doing more completely. In that plugin children are expanded in the "parseToMesh" function which means that children will only be available once the parent tile has been loaded and then, symmetrically, those children are deleted when the tile is unloaded in "disposeTile". We should follow this same pattern in "ImageFormat" plugin.

Thanks, I have updated it according to what QuatizedMeshPlugin is doing. And I have tested it works fine with optimizedLoadStrategy and mapTiles/wmtsTiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants