ipyleaflet
ipyleaflet copied to clipboard
Popups with geodataframe/`GeoData`/`GeoJSON`
It would be great to be able to parametrize popups so that elements added with a GeoData are clickable and properties associated with each shape can be accessed.
Maybe it's not the best, but I would imagine a basic api along the following:
GeoData(geo_dataframe=..., popup: str | List[str] = single_or_list_of_features)
This would be a nice feature to add. Currently, it seems only Marker has a popup attribute. My workaround in leafmap is to use an HTML widget and update it with GeoJSON on_hover and on_click.
https://leafmap.org/notebooks/10_add_vector/
https://user-images.githubusercontent.com/5016453/121617468-facf5780-ca32-11eb-9f48-2fd63b810199.mp4
I just added a add_point_layer() function to leafmap that can display popup attributes with a single line of code. See notebook example https://leafmap.org/notebooks/18_point_layer.
