diff --git a/externs/olx.js b/externs/olx.js index 5035b7d904..4b3c65a68d 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -2534,12 +2534,21 @@ olx.interaction.MouseWheelZoomOptions.prototype.duration; /** - * @typedef {{threshold: (number|undefined)}} + * @typedef {{threshold: (number|undefined), + * duration: (number|undefined)}} * @api */ olx.interaction.PinchRotateOptions; +/** + * The duration of the animation in milliseconds. Default is `250`. + * @type {number|undefined} + * @api + */ +olx.interaction.PinchRotateOptions.prototype.duration; + + /** * Minimal angle in radians to start a rotation. Default is `0.3`. * @type {number|undefined} diff --git a/src/ol/interaction/pinchrotateinteraction.js b/src/ol/interaction/pinchrotateinteraction.js index ebb1a08247..7cae131e17 100644 --- a/src/ol/interaction/pinchrotateinteraction.js +++ b/src/ol/interaction/pinchrotateinteraction.js @@ -3,7 +3,6 @@ goog.provide('ol.interaction.PinchRotate'); goog.require('goog.asserts'); goog.require('goog.functions'); goog.require('goog.style'); -goog.require('ol'); goog.require('ol.Coordinate'); goog.require('ol.ViewHint'); goog.require('ol.interaction.Interaction'); @@ -61,6 +60,12 @@ ol.interaction.PinchRotate = function(opt_options) { */ this.threshold_ = goog.isDef(options.threshold) ? options.threshold : 0.3; + /** + * @private + * @type {number} + */ + this.duration_ = goog.isDef(options.duration) ? options.duration : 250; + }; goog.inherits(ol.interaction.PinchRotate, ol.interaction.Pointer); @@ -131,7 +136,7 @@ ol.interaction.PinchRotate.handleUpEvent_ = function(mapBrowserEvent) { if (this.rotating_) { var rotation = view.getRotation(); ol.interaction.Interaction.rotate( - map, view, rotation, this.anchor_, ol.ROTATE_ANIMATION_DURATION); + map, view, rotation, this.anchor_, this.duration_); } return false; } else { diff --git a/src/ol/ol.js b/src/ol/ol.js index 0bcaa08976..b0af1db4cb 100644 --- a/src/ol/ol.js +++ b/src/ol/ol.js @@ -198,12 +198,6 @@ ol.OVERVIEWMAP_MAX_RATIO = 0.75; ol.OVERVIEWMAP_MIN_RATIO = 0.1; -/** - * @define {number} Rotate animation duration. - */ -ol.ROTATE_ANIMATION_DURATION = 250; - - /** * @define {number} Tolerance for geometry simplification in device pixels. */