ipyleaflet icon indicating copy to clipboard operation
ipyleaflet copied to clipboard

Popups with geodataframe/`GeoData`/`GeoJSON`

Open xoolive opened this issue 4 years ago • 2 comments

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)

xoolive avatar Jun 07 '21 08:06 xoolive

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

giswqs avatar Jun 11 '21 01:06 giswqs

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.

giswqs avatar Jun 11 '21 04:06 giswqs