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-clicking on map does not fire 'click' event #1416

Closed
misterfresh opened this issue Aug 9, 2015 · 5 comments
Closed

Right-clicking on map does not fire 'click' event #1416

misterfresh opened this issue Aug 9, 2015 · 5 comments

Comments

@misterfresh
Copy link

also related to #1405

@mourner
Copy link
Member

mourner commented Oct 7, 2015

Most mapping libraries including Leaflet don't fire click on right click — only on left click. Instead, right click fires a separate contextmenu event (already supported in GL JS). I believe we should follow the same convention here instead of c5fc748. @bhousel @jfirebaugh

@misterfresh
Copy link
Author

I wanted to get a behavior where if I left-click on the map, it adds a
marker, and if I right-click on a marker, it removes it from the map.

Le mer. 7 oct. 2015 à 08:22, Vladimir Agafonkin [email protected]
a écrit :

Most mapping libraries including Leaflet don't fire click on right click —
only on left click. Instead, right click fires a separate contextmenu
event (already supported in GL JS). I believe we should follow the same
convention here instead of c5fc748
c5fc748.
@bhousel https://github.com/bhousel @jfirebaugh
https://github.com/jfirebaugh


Reply to this email directly or view it on GitHub
#1416 (comment)
.

@mourner
Copy link
Member

mourner commented Oct 7, 2015

@misterfresh that's a perfect use case for separate events (click for adding marker, contextmenu for removing it).

@bhousel
Copy link
Contributor

bhousel commented Oct 7, 2015

I agree that we should generally just pass the DOM events as-is to the user.

@misterfresh, I'll back out the change in c5fc748, but you can look at that for how to implement a right (or middle) click event by using mousedown and mouseup events and keeping track of the buttons that were pressed and their coordinates.

@bhousel bhousel closed this as completed Oct 7, 2015
@misterfresh
Copy link
Author

Interesting, thanks.

2015-10-07 14:14 GMT+02:00 Bryan Housel [email protected]:

I agree that we should generally just pass the DOM events as-is to the
user.

@misterfresh https://github.com/misterfresh, I'll back out the change
in c5fc748
c5fc748,
but you can look at that for how to implement a right (or middle) click
event by using mousedown and mouseup events and keeping track of the
buttons that were pressed and their coordinates.


Reply to this email directly or view it on GitHub
#1416 (comment)
.

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

No branches or pull requests

3 participants