Configure ol.interaction.TouchPan with options

This commit is contained in:
Tom Payne
2013-04-22 16:11:22 +02:00
parent a36b4a0466
commit 2dff59a4d4
3 changed files with 13 additions and 5 deletions
+5
View File
@@ -224,6 +224,11 @@
* @property {number|undefined} delta Delta. * @property {number|undefined} delta Delta.
*/ */
/**
* @typedef {Object} ol.interaction.TouchPanOptions
* @property {ol.Kinetic|undefined} kinetic Kinetic.
*/
/** /**
* @typedef {Object} ol.layer.LayerOptions * @typedef {Object} ol.layer.LayerOptions
* @property {number|undefined} brightness Brightness. * @property {number|undefined} brightness Brightness.
+3 -2
View File
@@ -44,8 +44,9 @@ ol.interaction.defaults = function(opt_options, opt_interactions) {
var touchPan = goog.isDef(options.touchPan) ? var touchPan = goog.isDef(options.touchPan) ?
options.touchPan : true; options.touchPan : true;
if (touchPan) { if (touchPan) {
interactions.push(new ol.interaction.TouchPan( interactions.push(new ol.interaction.TouchPan({
new ol.Kinetic(-0.005, 0.05, 100))); kinetic: new ol.Kinetic(-0.005, 0.05, 100)
}));
} }
var touchRotate = goog.isDef(options.touchRotate) ? var touchRotate = goog.isDef(options.touchRotate) ?
+5 -3
View File
@@ -15,17 +15,19 @@ goog.require('ol.interaction.Touch');
/** /**
* @constructor * @constructor
* @extends {ol.interaction.Touch} * @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); goog.base(this);
var options = goog.isDef(opt_options) ? opt_options : {};
/** /**
* @private * @private
* @type {ol.Kinetic|undefined} * @type {ol.Kinetic|undefined}
*/ */
this.kinetic_ = opt_kinetic; this.kinetic_ = options.kinetic;
/** /**
* @private * @private