Skip to content

Commit 0884b64

Browse files
committed
stronger tile counting
1 parent 077e670 commit 0884b64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/renderer/layer/tilelayer/TileLayerCanvasRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer {
6262
this.completeRender();
6363
return;
6464
}
65-
const count = tileGrids.reduce((acc, curr) => acc + curr.count, 0);
65+
const count = tileGrids.reduce((acc, curr) => acc + (curr && curr.tiles && curr.tiles.length || 0), 0);
6666
if (count >= (this.tileCache.max / 2)) {
6767
this.tileCache.setMaxSize(count * 2 + 1);
6868
}

0 commit comments

Comments
 (0)