Closed charliedaly closed 3 months ago
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.
It seems to work for CircleMarker! I should have checked before submitting. It doesn't work with DivIcon.
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.