Move ol.DRAGROTATEANDZOOM_ANIMATION_DURATION const to a constructor option
This commit is contained in:
+10
-1
@@ -2251,7 +2251,8 @@ olx.interaction.DragPanOptions.prototype.kinetic;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{condition: (ol.events.ConditionType|undefined)}}
|
* @typedef {{condition: (ol.events.ConditionType|undefined),
|
||||||
|
* duration: (number|undefined)}}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.interaction.DragRotateAndZoomOptions;
|
olx.interaction.DragRotateAndZoomOptions;
|
||||||
@@ -2267,6 +2268,14 @@ olx.interaction.DragRotateAndZoomOptions;
|
|||||||
olx.interaction.DragRotateAndZoomOptions.prototype.condition;
|
olx.interaction.DragRotateAndZoomOptions.prototype.condition;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animation duration in milliseconds. Default is `400`.
|
||||||
|
* @type {number|undefined}
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
olx.interaction.DragRotateAndZoomOptions.prototype.duration;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{condition: (ol.events.ConditionType|undefined)}}
|
* @typedef {{condition: (ol.events.ConditionType|undefined)}}
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.interaction.DragRotateAndZoom');
|
goog.provide('ol.interaction.DragRotateAndZoom');
|
||||||
|
|
||||||
goog.require('goog.math.Vec2');
|
goog.require('goog.math.Vec2');
|
||||||
goog.require('ol');
|
|
||||||
goog.require('ol.ViewHint');
|
goog.require('ol.ViewHint');
|
||||||
goog.require('ol.events.ConditionType');
|
goog.require('ol.events.ConditionType');
|
||||||
goog.require('ol.events.condition');
|
goog.require('ol.events.condition');
|
||||||
@@ -60,6 +59,12 @@ ol.interaction.DragRotateAndZoom = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.lastScaleDelta_ = 0;
|
this.lastScaleDelta_ = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.duration_ = goog.isDef(options.duration) ? options.duration : 400;
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.interaction.DragRotateAndZoom, ol.interaction.Pointer);
|
goog.inherits(ol.interaction.DragRotateAndZoom, ol.interaction.Pointer);
|
||||||
|
|
||||||
@@ -120,8 +125,7 @@ ol.interaction.DragRotateAndZoom.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
var direction = this.lastScaleDelta_ - 1;
|
var direction = this.lastScaleDelta_ - 1;
|
||||||
ol.interaction.Interaction.rotate(map, view, viewState.rotation);
|
ol.interaction.Interaction.rotate(map, view, viewState.rotation);
|
||||||
ol.interaction.Interaction.zoom(map, view, viewState.resolution,
|
ol.interaction.Interaction.zoom(map, view, viewState.resolution,
|
||||||
undefined, ol.DRAGROTATEANDZOOM_ANIMATION_DURATION,
|
undefined, this.duration_, direction);
|
||||||
direction);
|
|
||||||
this.lastScaleDelta_ = 0;
|
this.lastScaleDelta_ = 0;
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,12 +48,6 @@ ol.DEFAULT_TILE_SIZE = 256;
|
|||||||
ol.DEFAULT_WMS_VERSION = '1.3.0';
|
ol.DEFAULT_WMS_VERSION = '1.3.0';
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @define {number} Drag-rotate-zoom animation duration.
|
|
||||||
*/
|
|
||||||
ol.DRAGROTATEANDZOOM_ANIMATION_DURATION = 400;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @define {number} Drag-rotate animation duration.
|
* @define {number} Drag-rotate animation duration.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user