Move olx.ViewState to ol/View

This commit is contained in:
Frederic Junod
2018-03-23 09:14:11 +01:00
parent 1963e6088e
commit 29b37b179c
6 changed files with 17 additions and 53 deletions
+12 -2
View File
@@ -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,