Move olx.ViewState to ol/View
This commit is contained in:
@@ -37,7 +37,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @typedef {Object} FrameState
|
||||
* @property {number} pixelRatio The pixel ratio of the frame.
|
||||
* @property {number} time The time when rendering of the frame was requested.
|
||||
* @property {olx.ViewState} viewState The state of the current view.
|
||||
* @property {module:ol/View~State} viewState The state of the current view.
|
||||
* @property {boolean} animate
|
||||
* @property {module:ol/transform~Transform} coordinateToPixelTransform
|
||||
* @property {null|module:ol/extent~Extent} extent
|
||||
|
||||
@@ -155,6 +155,16 @@ import Units from './proj/Units.js';
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} State
|
||||
* @property {module:ol/coordinate~Coordinate} center
|
||||
* @property {module:ol/proj/Projection~Projection} projection
|
||||
* @property {number} resolution
|
||||
* @property {number} rotation
|
||||
* @property {number} zoom
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Default min zoom level for the map view.
|
||||
* @type {number}
|
||||
@@ -918,14 +928,14 @@ View.prototype.getValueForResolutionFunction = function(opt_power) {
|
||||
|
||||
|
||||
/**
|
||||
* @return {olx.ViewState} View state.
|
||||
* @return {module:ol/View~State} View state.
|
||||
*/
|
||||
View.prototype.getState = function() {
|
||||
const center = /** @type {module:ol/coordinate~Coordinate} */ (this.getCenter());
|
||||
const projection = this.getProjection();
|
||||
const resolution = /** @type {number} */ (this.getResolution());
|
||||
const rotation = this.getRotation();
|
||||
return /** @type {olx.ViewState} */ ({
|
||||
return /** @type {module:ol/View~State} */ ({
|
||||
center: center.slice(),
|
||||
projection: projection !== undefined ? projection : null,
|
||||
resolution: resolution,
|
||||
|
||||
@@ -75,7 +75,7 @@ const ScaleLine = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?olx.ViewState}
|
||||
* @type {?module:ol/View~State}
|
||||
*/
|
||||
this.viewState_ = null;
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ CanvasImageLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
||||
getWidth(renderedExtent) / viewResolution,
|
||||
getHeight(renderedExtent) / viewResolution
|
||||
],
|
||||
viewState: /** @type {olx.ViewState} */ (assign({}, frameState.viewState, {
|
||||
viewState: /** @type {module:ol/View~State} */ (assign({}, frameState.viewState, {
|
||||
rotation: 0
|
||||
}))
|
||||
}));
|
||||
|
||||
@@ -183,7 +183,7 @@ const RasterSource = function(options) {
|
||||
tileQueue: this.tileQueue_,
|
||||
time: Date.now(),
|
||||
usedTiles: {},
|
||||
viewState: /** @type {olx.ViewState} */ ({
|
||||
viewState: /** @type {module:ol/View~State} */ ({
|
||||
rotation: 0
|
||||
}),
|
||||
viewHints: [],
|
||||
@@ -232,7 +232,7 @@ RasterSource.prototype.updateFrameState_ = function(extent, resolution, projecti
|
||||
|
||||
const frameState = /** @type {module:ol/PluggableMap~FrameState} */ (assign({}, this.frameState_));
|
||||
|
||||
frameState.viewState = /** @type {olx.ViewState} */ (assign({}, frameState.viewState));
|
||||
frameState.viewState = /** @type {module:ol/View~State} */ (assign({}, frameState.viewState));
|
||||
|
||||
const center = getCenter(extent);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user