nah*_*end 4 python maps popup python-3.x folium
是否可以为弹出文本创建第二行或第三行,包括调整弹出框的宽度和高度?
在 GitHub 上找到了一些东西,但这是唯一的方法吗? https://github.com/python-visualization/folium/pull/294
您可以通过以下方式将 html 代码放入弹出窗口中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
Run Code Online (Sandbox Code Playgroud)
你得到: