Creating a split-panel map with only one line of code
Uncomment the following line to install leafmap if needed.
# !pip install leafmap
This notebook example requires the ipyleaflet plotting backend. Folium is not supported.
import leafmap.leafmap as leafmap
Print out the list of available basemaps.
print(leafmap.basemaps.keys())
Create a split-panel map by specifying the left_layer
and right_layer
, which can be chosen from the basemap names, or any custom XYZ tile layer.
leafmap.split_map(left_layer="ROADMAP", right_layer="HYBRID")
Hide the zoom control from the map.
leafmap.split_map(
left_layer="Esri.WorldTopoMap", right_layer="OpenTopoMap", zoom_control=False
)
Add labels to the map and change the default map center and zoom level.
leafmap.split_map(
left_layer="NLCD 2001 CONUS Land Cover",
right_layer="NLCD 2016 CONUS Land Cover",
left_label="2001",
right_label="2016",
label_position="bottom",
center=[36.1, -114.9],
zoom=10,
)