#!/usr/bin/env python # coding: utf-8 # ## Demo of a Minimap in Folium # In[1]: import folium from folium.plugins import MiniMap # In[2]: m = folium.Map(location=(30, 20), zoom_start=4) minimap = MiniMap() m.add_child(minimap) m # ### Make the minimap collapsable # In[3]: m = folium.Map(location=(30, 20), zoom_start=4) minimap = MiniMap(toggle_display=True) minimap.add_to(m) m # ### Change the minimap tile layer # In[4]: m = folium.Map(location=(30, 20), zoom_start=4) minimap = MiniMap(tile_layer='Stamen Toner') minimap.add_to(m) m # ### Change the minimap position # In[5]: m = folium.Map(location=(30, 20), zoom_start=4) minimap = MiniMap(position='topleft') minimap.add_to(m) m # ### Change the minimap size # In[6]: m = folium.Map(location=(30, 20), zoom_start=4) minimap = MiniMap(width=400, height=100) minimap.add_to(m) m # ### Change the zoom offset # In[7]: m = folium.Map(location=(30, 20), zoom_start=8) minimap = MiniMap(zoom_level_offset=-8) minimap.add_to(m) m