Dispose the tiles removed from the cache

This commit is contained in:
Frederic Junod
2014-07-22 17:49:26 +02:00
parent 312d5a87b8
commit 02ede1eafa

View File

@@ -48,7 +48,7 @@ ol.TileCache.prototype.expireCache = function(usedTiles) {
if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) {
break;
} else {
this.pop();
this.pop().dispose();
}
}
};
@@ -64,7 +64,7 @@ ol.TileCache.prototype.pruneTileRange = function(tileRange) {
while (i--) {
key = this.peekLastKey();
if (tileRange.contains(ol.TileCoord.createFromString(key))) {
this.pop();
this.pop().dispose();
} else {
this.get(key);
}