Folium: adding tooltip to geojson

Created on 4 Sep 2018  路  3Comments  路  Source: python-visualization/folium

Hi everyone,

Please to see that I can add tooltips to geojson!

I've been following this notebook example and I see that I can hover over different areas and get tooltips.

In that example the geometry and tooltip data appear to all be in a DataFrame. Is there a way to get tooltip data if the polygons are in a dictionary structure but the values for the tooltips (e.g., employment rates) are in a DataFrame?

Most helpful comment

@Alcampopiano check the current (>v0.6.0 or current master) docstring in GeoJson, this feature wound up getting split into two separate classes - GeoJsonTooltip and Tooltip. GeoJsonTooltip allows you to access the properties keys in each GeoJson feature with a fields kwarg, while Tooltip will write the same text string as Tooltip content for each feature.

I'm going to add a new notebook example to the directory now to have some better examples of it.

All 3 comments

Okay I just looped through and added a new field to the dictionary. Thanks very much.

@Alcampopiano check the current (>v0.6.0 or current master) docstring in GeoJson, this feature wound up getting split into two separate classes - GeoJsonTooltip and Tooltip. GeoJsonTooltip allows you to access the properties keys in each GeoJson feature with a fields kwarg, while Tooltip will write the same text string as Tooltip content for each feature.

I'm going to add a new notebook example to the directory now to have some better examples of it.

Thanks for the helpful information. I was confused by the split, but this clears it up. Thanks very much.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olibchr picture olibchr  路  19Comments

reaganch picture reaganch  路  13Comments

EMarcantonio picture EMarcantonio  路  41Comments

ibayer picture ibayer  路  21Comments

agravier picture agravier  路  26Comments