Do not abort and dispose of tiles

This commit is contained in:
Andreas Hocevar
2020-01-03 18:59:24 +01:00
parent 6063021792
commit b91e1a893d
11 changed files with 11 additions and 139 deletions
+1 -11
View File
@@ -6,15 +6,6 @@ import {fromKey, getKey} from './tilecoord.js';
class TileCache extends LRUCache {
/**
* @param {number=} opt_highWaterMark High water mark.
*/
constructor(opt_highWaterMark) {
super(opt_highWaterMark);
}
/**
* @param {!Object<string, import("./TileRange.js").default>} usedTiles Used tiles.
*/
@@ -24,7 +15,7 @@ class TileCache extends LRUCache {
if (tile.getKey() in usedTiles) {
break;
} else {
this.pop().dispose();
this.pop();
}
}
}
@@ -42,7 +33,6 @@ class TileCache extends LRUCache {
this.forEach(function(tile) {
if (tile.tileCoord[0] !== z) {
this.remove(getKey(tile.tileCoord));
tile.dispose();
}
}.bind(this));
}