Open charliedaly opened 1 month ago
This happens even when the DivIcon is covered by another marker. In the following case, it's covered by a CircleMarker:
from ipyleaflet import Map, Marker, DivIcon, CircleMarker
m = Map(center = (52, -8))
def get_handler(m):
m.coords = None
def handler(**kwargs):
if kwargs['type'] == 'mousemove':
if m.coords == kwargs['coordinates']:
print('.', end='')
else:
m.coords = kwargs['coordinates']
print(kwargs)
return handler
icon = DivIcon(icon_size = [100, 100])
marker = Marker(location = (52, -8), icon = icon)
cm = CircleMarker(location = (52, -8), radius = 80)
m.add(marker)
m.add(cm)
m.on_interaction(get_handler(m))
m
The mouse coordinates are correctly reported everywhere except where the DivIcon is.
The following code shows the problem:
When the mouse is over the marker, it shows the coordinates of the marker rather than the mouse.