Dispose the tiles removed from the cache
This commit is contained in:
@@ -48,7 +48,7 @@ ol.TileCache.prototype.expireCache = function(usedTiles) {
|
|||||||
if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) {
|
if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
this.pop();
|
this.pop().dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -64,7 +64,7 @@ ol.TileCache.prototype.pruneTileRange = function(tileRange) {
|
|||||||
while (i--) {
|
while (i--) {
|
||||||
key = this.peekLastKey();
|
key = this.peekLastKey();
|
||||||
if (tileRange.contains(ol.TileCoord.createFromString(key))) {
|
if (tileRange.contains(ol.TileCoord.createFromString(key))) {
|
||||||
this.pop();
|
this.pop().dispose();
|
||||||
} else {
|
} else {
|
||||||
this.get(key);
|
this.get(key);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user