Используйте folium.Choropleth
и folium.LayerControl
:
import folium
m = folium.Map(location=[37.773972, -122.43],
zoom_start=10,
control_scale=True)
folium.Choropleth(geo_data=sanfran_geo,
name='choropleth',
data=df_sf,
columns=['Neighborhood', 'Count'],
key_on='feature.properties.DISTRICT',
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.2,
legend_name='Crime Rate in San Francisco').add_to(m)
folium.LayerControl().add_to(m)
m