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