Move ol.ROTATE_ANIMATION_DURATION const to a constructor option

This commit is contained in:
Frederic Junod
2015-04-13 15:05:35 +02:00
parent 2fcdc48d20
commit 1daf4628b7
3 changed files with 17 additions and 9 deletions

View File

@@ -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 {