Move AnimationOptions to ol/View
This commit is contained in:
@@ -5,81 +5,6 @@
|
|||||||
let olx;
|
let olx;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{
|
|
||||||
* center: (ol.Coordinate|undefined),
|
|
||||||
* zoom: (number|undefined),
|
|
||||||
* resolution: (number|undefined),
|
|
||||||
* rotation: (number|undefined),
|
|
||||||
* anchor: (ol.Coordinate|undefined),
|
|
||||||
* duration: (number|undefined),
|
|
||||||
* easing: (undefined|function(number):number)
|
|
||||||
* }}
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The center of the view at the end of the animation.
|
|
||||||
* @type {ol.Coordinate|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions.prototype.center;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The zoom level of the view at the end of the animation. This takes
|
|
||||||
* precedence over `resolution`.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions.prototype.zoom;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The resolution of the view at the end of the animation. If `zoom` is also
|
|
||||||
* provided, this option will be ignored.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions.prototype.resolution;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The rotation of the view at the end of the animation.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions.prototype.rotation;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optional anchor to remained fixed during a rotation or resolution animation.
|
|
||||||
* @type {ol.Coordinate|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions.prototype.anchor;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The duration of the animation in milliseconds (defaults to `1000`).
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions.prototype.duration;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The easing function used during the animation (defaults to {@link ol.easing.inAndOut}).
|
|
||||||
* The function will be called for each frame with a number representing a
|
|
||||||
* fraction of the animation's duration. The function should return a number
|
|
||||||
* between 0 and 1 representing the progress toward the destination state.
|
|
||||||
* @type {undefined|function(number):number}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.AnimationOptions.prototype.easing;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace.
|
* Namespace.
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
|
|||||||
@@ -1,21 +1,4 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} AnimationOptions
|
|
||||||
* @property {ol.Coordinate|undefined} center The center of the view at the end of the animation.
|
|
||||||
* @property {number|undefined} zoom The zoom level of the view at the end of the animation. This takes
|
|
||||||
* precedence over `resolution`.
|
|
||||||
* @property {number|undefined} resolution The resolution of the view at the end of the animation. If `zoom` is also
|
|
||||||
* provided, this option will be ignored.
|
|
||||||
* @property {number|undefined} rotation The rotation of the view at the end of the animation.
|
|
||||||
* @property {ol.Coordinate|undefined} anchor Optional anchor to remained fixed during a rotation or resolution animation.
|
|
||||||
* @property {number|undefined} duration The duration of the animation in milliseconds (defaults to `1000`).
|
|
||||||
* @property {undefined|function(number):number} easing The easing function used during the animation (defaults to {@link ol.easing.inAndOut}).
|
|
||||||
* The function will be called for each frame with a number representing a
|
|
||||||
* fraction of the animation's duration. The function should return a number
|
|
||||||
* between 0 and 1 representing the progress toward the destination state.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} control_AttributionOptions
|
* @typedef {Object} control_AttributionOptions
|
||||||
* @property {string|undefined} className CSS class name. Default is `ol-attribution`.
|
* @property {string|undefined} className CSS class name. Default is `ol-attribution`.
|
||||||
|
|||||||
+24
-2
@@ -134,6 +134,28 @@ import Units from './proj/Units.js';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} AnimationOptions
|
||||||
|
* @property {ol.Coordinate|undefined} center The center of the view at the end of
|
||||||
|
* the animation.
|
||||||
|
* @property {number|undefined} zoom The zoom level of the view at the end of the
|
||||||
|
* animation. This takes precedence over `resolution`.
|
||||||
|
* @property {number|undefined} resolution The resolution of the view at the end
|
||||||
|
* of the animation. If `zoom` is also provided, this option will be ignored.
|
||||||
|
* @property {number|undefined} rotation The rotation of the view at the end of
|
||||||
|
* the animation.
|
||||||
|
* @property {ol.Coordinate|undefined} anchor Optional anchor to remained fixed
|
||||||
|
* during a rotation or resolution animation.
|
||||||
|
* @property {number|undefined} duration The duration of the animation in milliseconds
|
||||||
|
* (defaults to `1000`).
|
||||||
|
* @property {undefined|function(number):number} easing The easing function used
|
||||||
|
* during the animation (defaults to {@link ol.easing.inAndOut}).
|
||||||
|
* The function will be called for each frame with a number representing a
|
||||||
|
* fraction of the animation's duration. The function should return a number
|
||||||
|
* between 0 and 1 representing the progress toward the destination state.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default min zoom level for the map view.
|
* Default min zoom level for the map view.
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@@ -372,7 +394,7 @@ View.prototype.getUpdatedOptions_ = function(newOptions) {
|
|||||||
* calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`
|
* calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`
|
||||||
* (or another method that calls one of these).
|
* (or another method that calls one of these).
|
||||||
*
|
*
|
||||||
* @param {...(olx.AnimationOptions|function(boolean))} var_args Animation
|
* @param {...(module:ol/View~AnimationOptions|function(boolean))} var_args Animation
|
||||||
* options. Multiple animations can be run in series by passing multiple
|
* options. Multiple animations can be run in series by passing multiple
|
||||||
* options objects. To run multiple animations in parallel, call the method
|
* options objects. To run multiple animations in parallel, call the method
|
||||||
* multiple times. An optional callback can be provided as a final
|
* multiple times. An optional callback can be provided as a final
|
||||||
@@ -412,7 +434,7 @@ View.prototype.animate = function(var_args) {
|
|||||||
let rotation = this.getRotation();
|
let rotation = this.getRotation();
|
||||||
const series = [];
|
const series = [];
|
||||||
for (let i = 0; i < animationCount; ++i) {
|
for (let i = 0; i < animationCount; ++i) {
|
||||||
const options = /** @type {olx.AnimationOptions} */ (arguments[i]);
|
const options = /** @type {module:ol/View~AnimationOptions} */ (arguments[i]);
|
||||||
|
|
||||||
const animation = /** @type {module:ol/View~Animation} */ ({
|
const animation = /** @type {module:ol/View~Animation} */ ({
|
||||||
start: start,
|
start: start,
|
||||||
|
|||||||
Reference in New Issue
Block a user