Include context options in reprojection cache key
override the inherited getKey() method
This commit is contained in:
@@ -207,6 +207,18 @@ class TileImage extends UrlTile {
|
|||||||
getGutter() {
|
getGutter() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the key to be used for all tiles in the source.
|
||||||
|
* @return {string} The key for all tiles.
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
getKey() {
|
||||||
|
return super.getKey() +
|
||||||
|
(this.contextOptions_
|
||||||
|
? '\n' + JSON.stringify(this.contextOptions_)
|
||||||
|
: '');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("../proj/Projection.js").default} projection Projection.
|
* @param {import("../proj/Projection.js").default} projection Projection.
|
||||||
@@ -328,11 +340,7 @@ class TileImage extends UrlTile {
|
|||||||
const cache = this.getTileCacheForProjection(projection);
|
const cache = this.getTileCacheForProjection(projection);
|
||||||
const tileCoord = [z, x, y];
|
const tileCoord = [z, x, y];
|
||||||
let tile;
|
let tile;
|
||||||
const tileCoordKey =
|
const tileCoordKey = getKey(tileCoord);
|
||||||
getKey(tileCoord) +
|
|
||||||
(this.contextOptions_
|
|
||||||
? '\n' + JSON.stringify(this.contextOptions_)
|
|
||||||
: '');
|
|
||||||
if (cache.containsKey(tileCoordKey)) {
|
if (cache.containsKey(tileCoordKey)) {
|
||||||
tile = cache.get(tileCoordKey);
|
tile = cache.get(tileCoordKey);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user