From 274a6ab6e4001b8b6937558d9de541d40bdae3c2 Mon Sep 17 00:00:00 2001 From: hu de yi Date: Mon, 19 May 2025 16:17:41 +0800 Subject: [PATCH] TileLayer.getTiles null defense --- packages/maptalks/src/layer/tile/TileLayer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/maptalks/src/layer/tile/TileLayer.ts b/packages/maptalks/src/layer/tile/TileLayer.ts index cd855e0f72..374029aa51 100644 --- a/packages/maptalks/src/layer/tile/TileLayer.ts +++ b/packages/maptalks/src/layer/tile/TileLayer.ts @@ -312,7 +312,7 @@ class TileLayer extends Layer { const parentIds = tileGrid.tiles.map(tile => { return tile.parent; }); - tileGrid.parents = tileGrid.parents.filter(parent => { + tileGrid.parents = (tileGrid.parents || []).filter(parent => { return parentIds.indexOf(parent.id) > -1; }); });