12 split map
Creating a split-panel map with only one line of code
Uncomment the following line to install leafmap if needed.
In [ ]:
Copied!
# !pip install leafmap
# !pip install leafmap
This notebook example requires the ipyleaflet plotting backend. Folium is not supported.
In [ ]:
Copied!
import leafmap.leafmap as leafmap
import leafmap.leafmap as leafmap
Print out the list of available basemaps.
In [ ]:
Copied!
print(leafmap.basemaps.keys())
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.
In [ ]:
Copied!
leafmap.split_map(left_layer="ROADMAP", right_layer="HYBRID")
leafmap.split_map(left_layer="ROADMAP", right_layer="HYBRID")
Hide the zoom control from the map.
In [ ]:
Copied!
leafmap.split_map(
left_layer="Esri.WorldTopoMap", right_layer="OpenTopoMap", zoom_control=False
)
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.
In [ ]:
Copied!
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,
)
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,
)
