Reuse existing canvases from vector render tiles

This commit is contained in:
Andreas Hocevar
2020-01-08 10:42:34 +01:00
parent 5a8df1d4e2
commit 9f4dbd3c35
4 changed files with 27 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ class TileCache extends LRUCache {
if (tile.getKey() in usedTiles) {
break;
} else {
this.pop();
this.pop().release();
}
}
}
@@ -33,6 +33,7 @@ class TileCache extends LRUCache {
this.forEach(function(tile) {
if (tile.tileCoord[0] !== z) {
this.remove(getKey(tile.tileCoord));
tile.release();
}
}.bind(this));
}