Python Folium: how to create a folium.map.Marker() with multiple popup text lines?

Viewed 8815
1 Answers

You can put html code inside a popup by means of IFrame:

import folium

m = folium.Map(location=[43.775, 11.254],
               zoom_start=5)

html = '''1st line<br>
2nd line<br>
3rd line'''

iframe = folium.IFrame(html,
                       width=100,
                       height=100)

popup = folium.Popup(iframe,
                     max_width=100)

marker = folium.Marker([43.775, 11.254],
                       popup=popup).add_to(m)
m

and you get:

enter image description here

Related