Allow tile cache key calculation to be overridden
This commit is contained in:
@@ -125,7 +125,7 @@ ol.source.TileDebug.prototype.expireCache = function(usedTiles) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.TileDebug.prototype.getTile = function(z, x, y) {
|
ol.source.TileDebug.prototype.getTile = function(z, x, y) {
|
||||||
var tileCoordKey = ol.TileCoord.getKeyZXY(z, x, y);
|
var tileCoordKey = this.getKeyZXY(z, x, y);
|
||||||
if (this.tileCache_.containsKey(tileCoordKey)) {
|
if (this.tileCache_.containsKey(tileCoordKey)) {
|
||||||
return /** @type {!ol.DebugTile_} */ (this.tileCache_.get(tileCoordKey));
|
return /** @type {!ol.DebugTile_} */ (this.tileCache_.get(tileCoordKey));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ ol.source.TileImage.prototype.expireCache = function(usedTiles) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.TileImage.prototype.getTile = function(z, x, y, projection) {
|
ol.source.TileImage.prototype.getTile = function(z, x, y, projection) {
|
||||||
var tileCoordKey = ol.TileCoord.getKeyZXY(z, x, y);
|
var tileCoordKey = this.getKeyZXY(z, x, y);
|
||||||
if (this.tileCache_.containsKey(tileCoordKey)) {
|
if (this.tileCache_.containsKey(tileCoordKey)) {
|
||||||
return /** @type {!ol.Tile} */ (this.tileCache_.get(tileCoordKey));
|
return /** @type {!ol.Tile} */ (this.tileCache_.get(tileCoordKey));
|
||||||
} else {
|
} else {
|
||||||
@@ -112,7 +112,7 @@ ol.source.TileImage.prototype.getTile = function(z, x, y, projection) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.TileImage.prototype.useTile = function(z, x, y) {
|
ol.source.TileImage.prototype.useTile = function(z, x, y) {
|
||||||
var tileCoordKey = ol.TileCoord.getKeyZXY(z, x, y);
|
var tileCoordKey = this.getKeyZXY(z, x, y);
|
||||||
if (this.tileCache_.containsKey(tileCoordKey)) {
|
if (this.tileCache_.containsKey(tileCoordKey)) {
|
||||||
this.tileCache_.get(tileCoordKey);
|
this.tileCache_.get(tileCoordKey);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ ol.source.Tile.prototype.findLoadedTiles = function(loadedTilesByZ,
|
|||||||
var tile, tileCoordKey, x, y;
|
var tile, tileCoordKey, x, y;
|
||||||
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
|
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
|
||||||
for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
|
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]) {
|
if (loadedTilesByZ[z] && loadedTilesByZ[z][tileCoordKey]) {
|
||||||
continue;
|
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.
|
* @return {boolean} Opaque.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user