Merge pull request #13799 from M393/dont-touch-tiles-used-time-when-expiring
Do not refresh use time for tiles when collecting used source tiles
This commit is contained in:
@@ -240,8 +240,9 @@ class VectorTile extends UrlTile {
|
|||||||
const tileCache = this.getTileCacheForProjection(projection);
|
const tileCache = this.getTileCacheForProjection(projection);
|
||||||
const usedSourceTiles = Object.keys(usedTiles).reduce((acc, key) => {
|
const usedSourceTiles = Object.keys(usedTiles).reduce((acc, key) => {
|
||||||
const cacheKey = getCacheKeyForTileKey(key);
|
const cacheKey = getCacheKeyForTileKey(key);
|
||||||
if (tileCache.containsKey(cacheKey)) {
|
const tile = tileCache.peek(cacheKey);
|
||||||
const sourceTiles = tileCache.get(cacheKey).sourceTiles;
|
if (tile) {
|
||||||
|
const sourceTiles = tile.sourceTiles;
|
||||||
for (let i = 0, ii = sourceTiles.length; i < ii; ++i) {
|
for (let i = 0, ii = sourceTiles.length; i < ii; ++i) {
|
||||||
acc[sourceTiles[i].getKey()] = true;
|
acc[sourceTiles[i].getKey()] = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,6 +214,18 @@ class LRUCache {
|
|||||||
return this.newest_.key_;
|
return this.newest_.key_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an entry without updating least recently used time.
|
||||||
|
* @param {string} key Key.
|
||||||
|
* @return {T} Value.
|
||||||
|
*/
|
||||||
|
peek(key) {
|
||||||
|
if (!this.containsKey(key)) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return this.entries_[key].value_;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {T} value Value.
|
* @return {T} value Value.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user