Streamline tile preparation and remove unused code

This commit is contained in:
ahocevar
2018-11-21 23:59:48 +01:00
parent 2ce8fa6f10
commit fbf98a44ea
9 changed files with 104 additions and 95 deletions

View File

@@ -1,7 +1,6 @@
/**
* @module ol/VectorTile
*/
import {containsExtent} from './extent.js';
import Tile from './Tile.js';
import TileState from './TileState.js';
@@ -147,30 +146,6 @@ class VectorTile extends Tile {
return this.executorGroups_[layerId + ',' + key];
}
/**
* Get the best matching lower resolution replay group for a given zoom and extent.
* @param {string} layerId UID of the layer.
* @param {number} zoom Zoom.
* @param {import("./extent").Extent} extent Extent.
* @return {import("./render/canvas/ExecutorGroup.js").default} Executor groups.
*/
getLowResExecutorGroup(layerId, zoom, extent) {
let bestZoom = 0;
let replayGroup = null;
for (const key in this.executorGroups_) {
const keyData = key.split(',');
const candidateZoom = Number(keyData[1]);
if (keyData[0] === layerId && candidateZoom <= zoom) {
const candidate = this.executorGroups_[key];
if (containsExtent(candidate.getMaxExtent(), extent) && candidateZoom > bestZoom) {
replayGroup = candidate;
bestZoom = candidateZoom;
}
}
}
return replayGroup;
}
/**
* @inheritDoc
*/