Skip to content

Commit 077e670

Browse files
committed
dynamic maxCacheSize, fix #1466
1 parent a3c454c commit 077e670

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/renderer/layer/tilelayer/TileLayerCanvasRenderer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ class TileLayerCanvasRenderer extends CanvasRenderer {
6262
this.completeRender();
6363
return;
6464
}
65+
const count = tileGrids.reduce((acc, curr) => acc + curr.count, 0);
66+
if (count >= (this.tileCache.max / 2)) {
67+
this.tileCache.setMaxSize(count * 2 + 1);
68+
}
6569
let loadingCount = 0;
6670
let loading = false;
6771
const checkedTiles = {};

0 commit comments

Comments
 (0)