Move ol.DRAGROTATEANDZOOM_ANIMATION_DURATION const to a constructor option

This commit is contained in:
Frederic Junod
2015-04-13 15:21:45 +02:00
parent 1daf4628b7
commit a94a87323d
3 changed files with 17 additions and 10 deletions

View File

@@ -1,7 +1,6 @@
goog.provide('ol.interaction.DragRotateAndZoom');
goog.require('goog.math.Vec2');
goog.require('ol');
goog.require('ol.ViewHint');
goog.require('ol.events.ConditionType');
goog.require('ol.events.condition');
@@ -60,6 +59,12 @@ ol.interaction.DragRotateAndZoom = function(opt_options) {
*/
this.lastScaleDelta_ = 0;
/**
* @private
* @type {number}
*/
this.duration_ = goog.isDef(options.duration) ? options.duration : 400;
};
goog.inherits(ol.interaction.DragRotateAndZoom, ol.interaction.Pointer);
@@ -120,8 +125,7 @@ ol.interaction.DragRotateAndZoom.handleUpEvent_ = function(mapBrowserEvent) {
var direction = this.lastScaleDelta_ - 1;
ol.interaction.Interaction.rotate(map, view, viewState.rotation);
ol.interaction.Interaction.zoom(map, view, viewState.resolution,
undefined, ol.DRAGROTATEANDZOOM_ANIMATION_DURATION,
direction);
undefined, this.duration_, direction);
this.lastScaleDelta_ = 0;
return false;
};

View File

@@ -48,12 +48,6 @@ ol.DEFAULT_TILE_SIZE = 256;
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.
*/