Configure ol.interaction.TouchRotate with options

This commit is contained in:
Tom Payne
2013-04-22 16:30:55 +02:00
parent 9e8d20aee4
commit 4da61e8ae9
2 changed files with 10 additions and 4 deletions

View File

@@ -229,6 +229,11 @@
* @property {ol.Kinetic|undefined} kinetic Kinetic.
*/
/**
* @typedef {Object} ol.interaction.TouchRotateOptions
* @property {number|undefined} threshold Minimal angle to start a rotation.
*/
/**
* @typedef {Object} ol.layer.LayerOptions
* @property {number|undefined} brightness Brightness.

View File

@@ -21,13 +21,14 @@ ol.interaction.TOUCHROTATE_ANIMATION_DURATION = 250;
/**
* @constructor
* @extends {ol.interaction.Touch}
* @param {number=} opt_threshold Minimal angle to start a rotation.
* Default to 0.3 (radian).
* @param {ol.interaction.TouchRotateOptions=} opt_options Options.
*/
ol.interaction.TouchRotate = function(opt_threshold) {
ol.interaction.TouchRotate = function(opt_options) {
goog.base(this);
var options = goog.isDef(opt_options) ? opt_options : {};
/**
* @private
* @type {ol.Coordinate}
@@ -56,7 +57,7 @@ ol.interaction.TouchRotate = function(opt_threshold) {
* @private
* @type {number}
*/
this.threshold_ = goog.isDef(opt_threshold) ? opt_threshold : 0.3;
this.threshold_ = goog.isDef(options.threshold) ? options.threshold : 0.3;
};
goog.inherits(ol.interaction.TouchRotate, ol.interaction.Touch);