Improve type checking in ol.TileCache

This commit is contained in:
Tom Payne
2013-11-20 11:07:22 +01:00
parent d91479df06
commit a646753124

View File

@@ -48,7 +48,7 @@ ol.TileCache.prototype.canExpireCache = function() {
ol.TileCache.prototype.expireCache = function(usedTiles) { ol.TileCache.prototype.expireCache = function(usedTiles) {
var tile, zKey; var tile, zKey;
while (this.canExpireCache()) { while (this.canExpireCache()) {
tile = this.peekLast(); tile = /** @type {ol.Tile} */ (this.peekLast());
zKey = tile.tileCoord.z.toString(); zKey = tile.tileCoord.z.toString();
if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) { if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) {
break; break;