jmp75 / ipyleaflet-dashboard-tools

Experimental reusable componentry for ipywidgets
Other
0 stars 0 forks source link

On clicking a marker, event handling leads to KeyError: (-34.67698205588844, 139.24381256103518) not found in the marker_info property #2

Open jmp75 opened 1 month ago

jmp75 commented 1 month ago

Environment Information

Description

Trying to explore time series of streafmlw over the murray-darling basin

In some circumstances if two locations are very nearby the on_click event does not return the exact coordinates that were sourced in the xarray data. The on_click event handler fails to locate the coordinates in the marker_info dictionary. For instance clicking on one of the markers for two stations very close:

[((-34.6743, 139.2319), 'A4260529'), ((-34.6741, 139.2317), 'A4260605')]

and the lat/lon are exact, not rounded approximations

the jupyter output console reports the exception:

KeyError: (-34.67698205588844, 139.24381256103518)

The markers for these two stations are displaied apart with an arrow to the real location, to show them apart. However I suspect the event arguments are using the display coordinates, not the coordinates of the streamflow station.

I initially thought I had a case of duplicate lat/lon, but this is more complicated than this.

jmp75 commented 1 month ago

Even at max zoom one needs to click on the cluster to have two markers displayed:
image