Allow tile cache key calculation to be overridden

This commit is contained in:
Tom Payne
2013-08-20 18:40:57 +02:00
committed by Éric Lemoine
parent 9fb4514b4e
commit 4f27dd35d8
3 changed files with 16 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ ol.source.Tile.prototype.findLoadedTiles = function(loadedTilesByZ,
var tile, tileCoordKey, x, y;
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
tileCoordKey = ol.TileCoord.getKeyZXY(z, x, y);
tileCoordKey = this.getKeyZXY(z, x, y);
if (loadedTilesByZ[z] && loadedTilesByZ[z][tileCoordKey]) {
continue;
}
@@ -104,6 +104,18 @@ ol.source.Tile.prototype.findLoadedTiles = function(loadedTilesByZ,
};
/**
* @param {number} z Z.
* @param {number} x X.
* @param {number} y Y.
* @return {string} Key.
* @protected
*/
ol.source.Tile.prototype.getKeyZXY = function(z, x, y) {
return ol.TileCoord.getKeyZXY(z, x, y);
};
/**
* @return {boolean} Opaque.
*/