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

Add a rightclick handler for map interaction #58

Merged
merged 6 commits into from
Aug 6, 2019

Conversation

pludov
Copy link
Contributor

@pludov pludov commented Aug 4, 2019

This PR adds a callback to get notified for right click in the map. The callback will receive an event object including the location of the click (RA, DEC) and the id of the closest marker if present.

This partially resolves issue #25 since it provides RA and DEC in the callback.

WIP: works for gnomic and polar projections
Still missing calling the callback on long touch
The previous code was redrawing for each event. Meaning if the browser send 1 events every 10ms,
virtualsky must be able to draw in 10ms or less to keep smooth.
A small delay is introduced (20ms), so accumulated events can be dequeued between redraws.
@slowe
Copy link
Owner

slowe commented Aug 6, 2019

Good work pludov. I'd almost be tempted to do some of this through a plugin to keep the main file size down for those who don't need a context menu.

@slowe
Copy link
Owner

slowe commented Aug 6, 2019

Having said that... I've just seen your comment on #25 (comment) and you are right that it solves that.

@slowe slowe merged commit 91fced8 into slowe:gh-pages Aug 6, 2019
@slowe
Copy link
Owner

slowe commented Aug 6, 2019

@pludov Would you object to me renaming the rightclick event as contextmenu just to keep it matching with https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event ? That also avoids it containing "click" which is very mouse-centric.

@pludov
Copy link
Contributor Author

pludov commented Aug 6, 2019 via email

@slowe
Copy link
Owner

slowe commented Aug 6, 2019

OK. I've made some changes and cleaned up the code a bit using jshint.com. Thanks for all your contributions @pludov! Make sure to update before making more changes. :)

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.

3 participants