Skip to content

Commit eaf3cc6

Browse files
committed
Prevent repeated tiles from colliding and becoming invisible
Signed-off-by: Tim Deubler <tim.deubler@here.com>
1 parent 8401b37 commit eaf3cc6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/display/src/displays/webgl/CollisionHandler.ts

+8
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,17 @@ export class CollisionHandler {
443443
) {
444444
const layerId = this.getLayerId(layer);
445445

446+
// When tiles are repeated due to the singleWorldView setting, we skip processing them for collision detection.
447+
// This prevents redundant checks and ensures they don't incorrectly collide with themselves,
448+
// which could cause them to become invisible.
449+
const skipRepeatedTiles = new Set<string>();
450+
446451
for (let screentile of tiles) {
447452
const {quadkey, scale: tileScale} = screentile;
448453

454+
if (skipRepeatedTiles.has(quadkey)) continue;
455+
skipRepeatedTiles.add(quadkey);
456+
449457
const zoom = quadkey.length;
450458
const tileCache = this.getTileCache(zoom);
451459
const tileCollisionData = tileCache.get(quadkey);

0 commit comments

Comments
 (0)