Python Folium:如何创建带有多个弹出文本行的 folium.map.Marker()?

是否可以为弹出文本创建第二行或第三行,包括调整弹出框的宽度和高度?

在 GitHub 上找到了一些东西,但这是唯一的方法吗? https://github.com/python-visualization/folium/pull/294


千巷猫影
浏览 104回答 1
1回答

芜湖不芜

您可以通过以下方式将 html 代码放入弹出窗口中IFrame:import foliumm = folium.Map(location=[43.775, 11.254],&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;zoom_start=5)html = '''1st line<br>2nd line<br>3rd line'''iframe = folium.IFrame(html,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width=100,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height=100)popup = folium.Popup(iframe,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;max_width=100)marker = folium.Marker([43.775, 11.254],&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;popup=popup).add_to(m)m你得到:
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go