Sidebar

Add a sidebar widget
Create a sidebar widget to display the layer manager and custom widgets.
Uncomment the following line to install leafmap if needed.
| # %pip install "leafmap[maplibre]"
|
| import leafmap.maplibregl as leafmap
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | m = leafmap.Map(style="3d-terrain", projection="globe", height="700px")
m.add_ee_layer(asset_id="ESA/WorldCover/v200", opacity=0.5)
m.add_overture_3d_buildings()
container = m.create_container()
m.add_legend_to_sidebar(
builtin_legend="ESA_WorldCover", title="Land Cover Type", shape_type="rectangle"
)
m.add_colorbar_to_sidebar(cmap="terrain", label="Elevation")
image = "https://i.imgur.com/KeiAsTv.gif"
m.add_image_to_sidebar(image=image, expanded=False)
video = "https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4"
m.add_video_to_sidebar(video, expanded=False)
m.set_sidebar_width(680)
m
|
