map = folium.Map(zoom_start=6)
# coordinates to locate your marker
COORDINATE = [(333,333)] # example coordinate
COORDINATE2 = [(444,444)]
# add marker to your map
folium.Marker(location=COORDINATE).add_to(feature_group)
folium.Marker(location=COORDINATE2).add_to(feature_group2)
map.add_child(feature_group)
map.add_child(feature_group2)
# turn on layer control
map.add_child(folium.map.LayerControl())
#specify the min and max values of your data
colormap = branca.colormap.linear.YlOrRd_09.scale(0, 8500)
colormap = colormap.to_step(index=[0, 1000, 3000, 5000, 8500])
colormap.caption = 'Incidents of Crime in Victoria (year ending June 2018)'
colormap.add_to(world_map)
尝试使用
然后添加到地图中
Folium现在有一种方法可以在0.15版本中轻松添加图像。
你可以很容易地添加一个传说
你可以在这里看到我完整的例子
Folium Map with legend example
相关问题 更多 >
编程相关推荐