Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right click pan #795

Merged
merged 1 commit into from
Jun 19, 2013
Merged

Right click pan #795

merged 1 commit into from
Jun 19, 2013

Conversation

fredj
Copy link
Member

@fredj fredj commented Jun 18, 2013

Only pan the map when the action button of the mouse is pressed (aka left button)

(see ol.MapBrowserEvent.prototype.isMouseActionButton)

@twpayne
Copy link
Contributor

twpayne commented Jun 18, 2013

I think you should create an ol.interaction.condition for this, see:
https://github.com/openlayers/ol3/blob/master/src/ol/interaction/condition.js

I think you'll need to create ol.interaction.condition.isMouseActionButton and a suitable way of combining conditions so that both ol.interaction.condition.noModifierKeys and ol.interaction.condition.isMouseActionButton` can be combined (a simple function should be OK for the moment).

@twpayne
Copy link
Contributor

twpayne commented Jun 18, 2013

Hmmm, on further reflection with @fredj and @elemoine, we agree that an ol.interaction.condition is not (yet) needed here. We noted:

  • The other mouse interactions call isMouseActionButton() directly.
  • If people do want to configure mouse-based interactions to use a different button then we can implement ol.interaction.condition.isMouseActionButton and similar at that time. However, in practice they are unlikely to want to do this for the core navigation actions because: (1) some popular platforms (e.g. Mac OS X) only have one button and (2) it will be confusing for the user if the map navigation is non-standard.

So, all this to say: LGTM.

fredj added a commit that referenced this pull request Jun 19, 2013
@fredj fredj merged commit 79980bc into openlayers:master Jun 19, 2013
@fredj fredj deleted the pan_actionbutton branch June 19, 2013 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants