Folium: Easy way to add title for folium maps

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

#Here is my contribution to include title to folium maps:
m = folium.Map()

title_html = '''
             <h3 align="center" style="font-size:20px"><b>Your map title</b></h3>
             '''
m.get_root().html.add_child(folium.Element(title_html))

m

Problem description

There is currently no argument for title in the the folium.Map() method.

The current available method to include title is quite difficult requiring some lines of html code and then passing that through get_root().html.add_child()

Expected Output

It would be great to have something like:
folium.Map(title="Your map title")

Output of folium.__version__

Most helpful comment

Well, alternatives like bokeh offer an easier way to add title and even legends unless folium is strictly for software developers.

All 6 comments

folium.Map(title="Your map title")

It is folium.Map(titles=url, attr="attribution"). Please check the docs!

Please pay attention to my comment. This is not a tile issue. The issue is about an easy way to add a TITLE at the top of the map.

Thanks.

There is no title! The HTML canvas is for mapping. Anything else should be done editing HTML or using branca.

Well, alternatives like bokeh offer an easier way to add title and even legends unless folium is strictly for software developers.

Bokeh is a plotting library and not a exclusive mapping library. Please, go for Bokeh for those needs! Better yet, check geoviews.

No worries.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wangchenwc picture wangchenwc  路  18Comments

themiurgo picture themiurgo  路  19Comments

achourasia picture achourasia  路  15Comments

Alcampopiano picture Alcampopiano  路  14Comments

olibchr picture olibchr  路  19Comments