From b8488de3a4d557b78aa9d427cf0fd334063aa06c Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Tue, 9 Jan 2024 13:45:43 +0900 Subject: [PATCH] Add fix for case where google tiles contains empty tiles with no children at all --- src/base/traverseFunctions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/base/traverseFunctions.js b/src/base/traverseFunctions.js index 281f3c088..cc76e8b16 100644 --- a/src/base/traverseFunctions.js +++ b/src/base/traverseFunctions.js @@ -244,15 +244,22 @@ export function markUsedSetLeaves( tile, renderer ) { if ( isUsedThisFrame( c, frameCount ) ) { + // consider a child to be loaded if + // - the children's children have been loaded + // - the tile content has loaded + // - the tile is completely empty - ie has no children and no content + // - the child tileset has tried to load but failed const childLoaded = c.__allChildrenLoaded || ( ! c.__contentEmpty && isDownloadFinished( c.__loadingState ) ) || + ( ! c.__externalTileSet && c.__contentEmpty && c.children.length === 0 ) || ( c.__externalTileSet && c.__loadingState === FAILED ); allChildrenLoaded = allChildrenLoaded && childLoaded; } } + tile.__childrenWereVisible = childrenWereVisible; tile.__allChildrenLoaded = allChildrenLoaded;