Enqueue tiles at the next resolution in the animation

This commit is contained in:
Tim Schaub
2021-09-22 22:10:18 +00:00
parent 2435321133
commit 4dc66ef8e3
4 changed files with 93 additions and 28 deletions
+13
View File
@@ -48,6 +48,7 @@ import {removeNode} from './dom.js';
* @property {import("./transform.js").Transform} coordinateToPixelTransform CoordinateToPixelTransform.
* @property {import("rbush").default} declutterTree DeclutterTree.
* @property {null|import("./extent.js").Extent} extent Extent.
* @property {import("./extent.js").Extent} [nextExtent] Next extent during an animation series.
* @property {number} index Index.
* @property {Array<import("./layer/Layer.js").State>} layerStatesArray LayerStatesArray.
* @property {number} layerIndex LayerIndex.
@@ -1436,6 +1437,18 @@ class PluggableMap extends BaseObject {
viewHints: viewHints,
wantedTiles: {},
};
if (viewState.nextCenter && viewState.nextResolution) {
const rotation = isNaN(viewState.nextRotation)
? viewState.rotation
: viewState.nextRotation;
frameState.nextExtent = getForViewAndSize(
viewState.nextCenter,
viewState.nextResolution,
rotation,
size
);
}
}
this.frameState_ = frameState;