Configure ol.interaction.TouchRotate with options
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user