Configure ol.interaction.TouchPan with options
This commit is contained in:
@@ -224,6 +224,11 @@
|
||||
* @property {number|undefined} delta Delta.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ol.interaction.TouchPanOptions
|
||||
* @property {ol.Kinetic|undefined} kinetic Kinetic.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ol.layer.LayerOptions
|
||||
* @property {number|undefined} brightness Brightness.
|
||||
|
||||
@@ -44,8 +44,9 @@ ol.interaction.defaults = function(opt_options, opt_interactions) {
|
||||
var touchPan = goog.isDef(options.touchPan) ?
|
||||
options.touchPan : true;
|
||||
if (touchPan) {
|
||||
interactions.push(new ol.interaction.TouchPan(
|
||||
new ol.Kinetic(-0.005, 0.05, 100)));
|
||||
interactions.push(new ol.interaction.TouchPan({
|
||||
kinetic: new ol.Kinetic(-0.005, 0.05, 100)
|
||||
}));
|
||||
}
|
||||
|
||||
var touchRotate = goog.isDef(options.touchRotate) ?
|
||||
|
||||
@@ -15,17 +15,19 @@ goog.require('ol.interaction.Touch');
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.interaction.Touch}
|
||||
* @param {ol.Kinetic=} opt_kinetic Kinetic object.
|
||||
* @param {ol.interaction.TouchPanOptions=} opt_options Options.
|
||||
*/
|
||||
ol.interaction.TouchPan = function(opt_kinetic) {
|
||||
ol.interaction.TouchPan = function(opt_options) {
|
||||
|
||||
goog.base(this);
|
||||
|
||||
var options = goog.isDef(opt_options) ? opt_options : {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Kinetic|undefined}
|
||||
*/
|
||||
this.kinetic_ = opt_kinetic;
|
||||
this.kinetic_ = options.kinetic;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
Reference in New Issue
Block a user