From 2eedffa1002d2514b1fe60ab5ecb074b959b3c5d Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 6 Nov 2016 10:40:27 -0700 Subject: [PATCH] Separate olx.OverlayPanOptions from olx.animation.PanOptions --- externs/olx.js | 38 ++++++++++++++++++++++++++++++++------ src/ol/overlay.js | 4 ++-- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index f1caefaf37..7808ae5948 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -312,7 +312,7 @@ olx.MapOptions.prototype.view; * stopEvent: (boolean|undefined), * insertFirst: (boolean|undefined), * autoPan: (boolean|undefined), - * autoPanAnimation: (olx.animation.PanOptions|undefined), + * autoPanAnimation: (olx.OverlayPanOptions|undefined), * autoPanMargin: (number|undefined)}} */ olx.OverlayOptions; @@ -401,7 +401,7 @@ olx.OverlayOptions.prototype.autoPan; * The animation options used to pan the overlay into view. This animation * is only used when `autoPan` is enabled. A `duration` and `easing` may be * provided to customize the animation. - * @type {olx.animation.PanOptions|undefined} + * @type {olx.OverlayPanOptions|undefined} * @api */ olx.OverlayOptions.prototype.autoPanAnimation; @@ -416,6 +416,32 @@ olx.OverlayOptions.prototype.autoPanAnimation; olx.OverlayOptions.prototype.autoPanMargin; +/** + * @typedef {{ + * duration: (number|undefined), + * easing: (function(number):number|undefined) + * }} + */ +olx.OverlayPanOptions; + + +/** + * The duration of the animation in milliseconds. Default is `1000`. + * @type {number|undefined} + * @api + */ +olx.OverlayPanOptions.prototype.duration; + + +/** + * The easing function to use. Can be an {@link ol.easing} or a custom function. + * Default is {@link ol.easing.inAndOut}. + * @type {function(number):number|undefined} + * @api + */ +olx.OverlayPanOptions.prototype.easing; + + /** * Object literal with config options for the projection. * @typedef {{code: string, @@ -787,10 +813,10 @@ olx.animation.BounceOptions.prototype.easing; /** - * @typedef {{ - * duration: (number|undefined), - * easing: (function(number):number|undefined) - * }} + * @typedef {{source: ol.Coordinate, + * start: (number|undefined), + * duration: (number|undefined), + * easing: (function(number):number|undefined)}} */ olx.animation.PanOptions; diff --git a/src/ol/overlay.js b/src/ol/overlay.js index 1cecab6717..506fe92800 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -68,10 +68,10 @@ ol.Overlay = function(options) { /** * @private - * @type {olx.animation.PanOptions} + * @type {olx.OverlayPanOptions} */ this.autoPanAnimation_ = options.autoPanAnimation || - /** @type {olx.animation.PanOptions} */ ({}); + /** @type {olx.OverlayPanOptions} */ ({}); /** * @private