Configure ol.interaction.DragPan with options

This commit is contained in:
Tom Payne
2013-04-22 16:05:24 +02:00
parent 3b9699fbc8
commit a36b4a0466
3 changed files with 17 additions and 9 deletions

View File

@@ -11,30 +11,33 @@ goog.require('ol.ViewHint');
goog.require('ol.coordinate');
goog.require('ol.interaction.ConditionType');
goog.require('ol.interaction.Drag');
goog.require('ol.interaction.condition');
/**
* @constructor
* @extends {ol.interaction.Drag}
* @param {ol.interaction.ConditionType} condition Condition.
* @param {ol.Kinetic=} opt_kinetic Kinetic object.
* @param {ol.interaction.DragPanOptions=} opt_options Options.
*/
ol.interaction.DragPan = function(condition, opt_kinetic) {
ol.interaction.DragPan = function(opt_options) {
goog.base(this);
var options = goog.isDef(opt_options) ? opt_options : {};
/**
* @private
* @type {ol.interaction.ConditionType}
*/
this.condition_ = condition;
this.condition_ = goog.isDef(options.condition) ?
options.condition : ol.interaction.condition.noModifierKeys;
/**
* @private
* @type {ol.Kinetic|undefined}
*/
this.kinetic_ = opt_kinetic;
this.kinetic_ = options.kinetic;
/**
* @private