python-visualization / folium

Python Data. Leaflet.js Maps.
https://python-visualization.github.io/folium/
MIT License
6.93k stars 2.23k forks source link

Update VectorGridProtobuf to include popups when clicked #1933

Closed christianaaronschroeder closed 4 months ago

christianaaronschroeder commented 7 months ago

I've tried using VectorGridProtobuf several times in the past and almost always found myself making a copy of this class and adding functionality to click a polygon and get the properties.

Open to suggestions, or other options, just putting this out there.

hansthen commented 7 months ago

@christianaaronschroeder Thanks for your contribution. This would be useful to add. I do have some questions and suggestions mostly having to do with configurability from the Python side.

Before going any further, there is an open Pull Request that does something similar. Could you have a look https://github.com/python-visualization/folium/pull/1903?

It allows you to set event handlers (on) from the Python side. Would this also solve your needs?

christianaaronschroeder commented 7 months ago

@christianaaronschroeder Thanks for your contribution. This would be useful to add. I do have some questions and suggestions mostly having to do with configurability from the Python side.

Before going any further, there is an open Pull Request that does something similar. Could you have a look #1903?

It allows you to set event handlers (on) from the Python side. Would this also solve your needs?

I believe so! I'm open to trying that before moving forward with this one.

hansthen commented 7 months ago

@christianaaronschroeder Thanks for your contribution. This would be useful to add. I do have some questions and suggestions mostly having to do with configurability from the Python side. Before going any further, there is an open Pull Request that does something similar. Could you have a look #1903? It allows you to set event handlers (on) from the Python side. Would this also solve your needs?

I believe so! I'm open to trying that before moving forward with this one.

Great!

I will try to get that PR approved.

hansthen commented 4 months ago

@christianaaronschroeder By now PR https://github.com/python-visualization/folium/pull/1959 has been merged and I think also released into the new folium version. This feature allows you to add event handlers to arbitrary Layers. Can you have a look if this satisfies your need? If so, we can close this ticket.

christianaaronschroeder commented 4 months ago

@hansthen looks good, thank you!