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

mousemove event does not report correct coordinates when over a marker #1217

Closed
charliedaly opened this issue Jul 15, 2024 · 2 comments
Closed

Comments

@charliedaly
Copy link

Mouse events can be captured using the on interaction method of map. One of these events is mousemove. This reports the coordinates of the mouse but if the mouse is over a marker, it reports the coordinates of the marker instead.

@charliedaly
Copy link
Author

The following code shows the problem.

import ipyleaflet

m = ipyleaflet.Map(center = (52, -8))

def handler(**kwargs):
    print(kwargs)

m.add(ipyleaflet.CircleMarker(location = (52, -8), radius = 40))
    
m.on_interaction(handler)
m

It prints out the mouse position. But when the mouse is over the marker, it doesn't show the mouse coordinates, only the location of the marker.

@charliedaly
Copy link
Author

It seems to work for CircleMarker! I should have checked before submitting. It doesn't work with DivIcon.

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

1 participant