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

get pixel coordinates for mouse events #18

Open
mwallisch opened this issue Jun 19, 2013 · 1 comment
Open

get pixel coordinates for mouse events #18

mwallisch opened this issue Jun 19, 2013 · 1 comment

Comments

@mwallisch
Copy link

so this is more of a question than a real issue. Is it possible to get Screen coordinates for mouse events e.g. mouseover/mousemove? The only thing that I saw that might help me was the latlng Object that contains the map coordinates of the event. Is there any map-coordinates-to-pixel-coordinates conversion available for leaflet?

Regards,
Markus

@danzel
Copy link
Owner

danzel commented Jun 20, 2013

Right now we don't pass through the original mouse event or any of those bits, looks like it should be easy to add if you check out the _move function, probably just add the original event in there. (Would gladly accept a PR for this)

Otherwise in leaflet there is map.latLngToLayerPoint (and many other methods) that convert a latlng into pixels.
See: http://leafletjs.com/reference.html#map-class and scroll down to "Conversion Methods"

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

2 participants