Merge pull request #9072 from fredj/rm_layerStates

Remove 'layerStates' property from the FrameState
This commit is contained in:
Frédéric Junod
2019-01-07 10:11:52 +01:00
committed by GitHub
8 changed files with 37 additions and 59 deletions
+2 -9
View File
@@ -41,7 +41,6 @@ import {create as createTransform, apply as applyTransform} from './transform.js
* @property {null|import("./extent.js").Extent} extent
* @property {import("./coordinate.js").Coordinate} focus
* @property {number} index
* @property {Object<string, import("./layer/Layer.js").State>} layerStates
* @property {Array<import("./layer/Layer.js").State>} layerStatesArray
* @property {import("./transform.js").Transform} pixelToCoordinateTransform
* @property {Array<PostRenderFunction>} postRenderFunctions
@@ -55,7 +54,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
/**
* @typedef {function(PluggableMap, ?FrameState): boolean} PostRenderFunction
* @typedef {function(PluggableMap, ?FrameState): any} PostRenderFunction
*/
@@ -1161,11 +1160,6 @@ class PluggableMap extends BaseObject {
let frameState = null;
if (size !== undefined && hasArea(size) && view && view.isDef()) {
const viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);
const layerStatesArray = this.getLayerGroup().getLayerStatesArray();
const layerStates = {};
for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {
layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
}
viewState = view.getState(this.pixelRatio_);
frameState = /** @type {FrameState} */ ({
animate: false,
@@ -1173,8 +1167,7 @@ class PluggableMap extends BaseObject {
extent: extent,
focus: this.focus_ ? this.focus_ : viewState.center,
index: this.frameIndex_++,
layerStates: layerStates,
layerStatesArray: layerStatesArray,
layerStatesArray: this.getLayerGroup().getLayerStatesArray(),
pixelRatio: this.pixelRatio_,
pixelToCoordinateTransform: this.pixelToCoordinateTransform_,
postRenderFunctions: [],