简介
这个网络应用展示了如何使用leafmap和streamlit创建交互式地图。
import leafmap.foliumap as leafmap
filepath = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv"
m = leafmap.Map(tiles="stamentoner")
m.add_heatmap(
filepath,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
m.to_streamlit(width=700, height=500)
1.创建交互式地图
选择一个绘图的后端
import leafmap.foliumap as leafmap
m = leafmap.Map()
m.to_streamlit()