Folium: click event for polygon elements

Created on 6 Sep 2016  路  6Comments  路  Source: python-visualization/folium

I have started recently to work with folium.

Has folium any way to set a callback function or just a popup when the user clicks on the polygon area?

I saw some issues maybe about that .. but I'm not sure if this functionality is implemented or not .

thanks for your attention
my best regards

enhancement

Most helpful comment

Has there been any change on this? I see that the referenced #490 was merged several months ago, but what about a popup? I was hoping to use folium for a choropleth map where the user could click on any of the areas and see a small popup with some info about that area.

All 6 comments

@xmnlab it is not implemented yet. PR https://github.com/python-visualization/folium/pull/490 is the first one to go in that direction but implements a specific call back (highlight).

@ocefpaf thank you a lot for the explanation.

Has there been any change on this? I see that the referenced #490 was merged several months ago, but what about a popup? I was hoping to use folium for a choropleth map where the user could click on any of the areas and see a small popup with some info about that area.

I was hoping to use folium for a choropleth map where the user could click on any of the areas and see a small popup with some info about that area.

If you want to put a PR together to implement that I'd gladly review it :smile:

Folium has some limited click events now but a full customized clicking event from the python side is not possible yet. Closing this as stale but improvements to the GeoJson class are welcomed :grimacing:

thanks @ocefpaf !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ElmWer picture ElmWer  路  24Comments

spanishinquistion picture spanishinquistion  路  16Comments

AntonioLopardo picture AntonioLopardo  路  15Comments

Alcampopiano picture Alcampopiano  路  14Comments

achourasia picture achourasia  路  19Comments