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.
In [1]:
Copied!
# %pip install "leafmap[maplibre]"
# %pip install "leafmap[maplibre]"
In [2]:
Copied!
import leafmap.maplibregl as leafmap
import leafmap.maplibregl as leafmap
In [3]:
Copied!
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.creater_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
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.creater_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
An API key is required to use the 3D terrain feature.