Move ol.DRAGZOOM_ANIMATION_DURATION const to a constructor option
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.interaction.DragZoom');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol');
|
||||
goog.require('ol.events.condition');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.interaction.DragBox');
|
||||
@@ -28,6 +27,12 @@ ol.interaction.DragZoom = function(opt_options) {
|
||||
var condition = goog.isDef(options.condition) ?
|
||||
options.condition : ol.events.condition.shiftKeyOnly;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.duration_ = goog.isDef(options.duration) ? options.duration : 200;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.style.Style}
|
||||
@@ -61,5 +66,5 @@ ol.interaction.DragZoom.prototype.onBoxEnd = function() {
|
||||
goog.asserts.assert(goog.isDef(size), 'size should be defined');
|
||||
ol.interaction.Interaction.zoom(map, view,
|
||||
view.getResolutionForExtent(extent, size),
|
||||
center, ol.DRAGZOOM_ANIMATION_DURATION);
|
||||
center, this.duration_);
|
||||
};
|
||||
|
||||
@@ -60,12 +60,6 @@ ol.DRAGROTATEANDZOOM_ANIMATION_DURATION = 400;
|
||||
ol.DRAGROTATE_ANIMATION_DURATION = 250;
|
||||
|
||||
|
||||
/**
|
||||
* @define {number} Drag-zoom animation duration.
|
||||
*/
|
||||
ol.DRAGZOOM_ANIMATION_DURATION = 200;
|
||||
|
||||
|
||||
/**
|
||||
* @define {number} Hysteresis pixels.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user