Skip to content

Commit

Permalink
Add primaryAction condition to ol.interaction.DragPan
Browse files Browse the repository at this point in the history
  • Loading branch information
fredj committed Dec 7, 2016
1 parent 59e8027 commit adb3f72
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ol/interaction/dragpan.js
Expand Up @@ -39,12 +39,22 @@ ol.interaction.DragPan = function(opt_options) {
*/
this.lastCentroid = null;

/**
* @private
* @param {ol.MapBrowserEvent} mapBrowserEvent Browser event.
* @return {boolean} Combined condition result.
*/
this.defaultCondition_ = function(mapBrowserEvent) {
return ol.events.condition.noModifierKeys(mapBrowserEvent) &&
ol.events.condition.primaryAction(mapBrowserEvent);
};

/**
* @private
* @type {ol.EventsConditionType}
*/
this.condition_ = options.condition ?
options.condition : ol.events.condition.noModifierKeys;
options.condition : this.defaultCondition_;

/**
* @private
Expand Down

0 comments on commit adb3f72

Please sign in to comment.