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
+5
View File
@@ -229,6 +229,11 @@
* @property {ol.Kinetic|undefined} kinetic Kinetic. * @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 * @typedef {Object} ol.layer.LayerOptions
* @property {number|undefined} brightness Brightness. * @property {number|undefined} brightness Brightness.
+5 -4
View File
@@ -21,13 +21,14 @@ ol.interaction.TOUCHROTATE_ANIMATION_DURATION = 250;
/** /**
* @constructor * @constructor
* @extends {ol.interaction.Touch} * @extends {ol.interaction.Touch}
* @param {number=} opt_threshold Minimal angle to start a rotation. * @param {ol.interaction.TouchRotateOptions=} opt_options Options.
* Default to 0.3 (radian).
*/ */
ol.interaction.TouchRotate = function(opt_threshold) { ol.interaction.TouchRotate = function(opt_options) {
goog.base(this); goog.base(this);
var options = goog.isDef(opt_options) ? opt_options : {};
/** /**
* @private * @private
* @type {ol.Coordinate} * @type {ol.Coordinate}
@@ -56,7 +57,7 @@ ol.interaction.TouchRotate = function(opt_threshold) {
* @private * @private
* @type {number} * @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); goog.inherits(ol.interaction.TouchRotate, ol.interaction.Touch);