150 maplibre
Visualizing Earth Engine data in 3D with MapLibre
This notebook demonstrates how to add Google Earth Engine data layers to a map.
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# %pip install "geemap[maplibre]"
# %pip install "geemap[maplibre]"
In [ ]:
Copied!
import ee
import geemap.maplibregl as geemap
import ee
import geemap.maplibregl as geemap
In [ ]:
Copied!
geemap.ee_initialize()
geemap.ee_initialize()
In [ ]:
Copied!
m = geemap.Map()
m.add_basemap("HYBRID")
m
m = geemap.Map()
m.add_basemap("HYBRID")
m
In [ ]:
Copied!
# import os
# os.environ["MAPTILER_KEY"] = "YOUR_API_KEY"
# import os
# os.environ["MAPTILER_KEY"] = "YOUR_API_KEY"
In [ ]:
Copied!
m = geemap.Map(
center=[-120.4482, 38.03994], zoom=13, pitch=60, bearing=30, style="3d-terrain"
)
dataset = ee.ImageCollection("ESA/WorldCover/v200").first()
vis_params = {"bands": ["Map"]}
m.add_ee_layer(dataset, vis_params, name="ESA Worldcover", opacity=0.5)
m.add_legend(builtin_legend="ESA_WorldCover", title="ESA Landcover")
m.add_layer_control()
m
m = geemap.Map(
center=[-120.4482, 38.03994], zoom=13, pitch=60, bearing=30, style="3d-terrain"
)
dataset = ee.ImageCollection("ESA/WorldCover/v200").first()
vis_params = {"bands": ["Map"]}
m.add_ee_layer(dataset, vis_params, name="ESA Worldcover", opacity=0.5)
m.add_legend(builtin_legend="ESA_WorldCover", title="ESA Landcover")
m.add_layer_control()
m
In [ ]:
Copied!
m.layer_interact()
m.layer_interact()
We can also overlay other data layers on top of Earth Engine data layers.
In [ ]:
Copied!
m = geemap.Map(
center=[-74.012998, 40.70414], zoom=15.6, pitch=60, bearing=30, style="3d-terrain"
)
dataset = ee.ImageCollection("ESA/WorldCover/v200").first()
vis_params = {"bands": ["Map"]}
m.add_ee_layer(dataset, vis_params, name="ESA Worldcover", opacity=0.5)
m.add_3d_buildings()
m.add_legend(builtin_legend="ESA_WorldCover", title="ESA Landcover")
m.add_layer_control()
m
m = geemap.Map(
center=[-74.012998, 40.70414], zoom=15.6, pitch=60, bearing=30, style="3d-terrain"
)
dataset = ee.ImageCollection("ESA/WorldCover/v200").first()
vis_params = {"bands": ["Map"]}
m.add_ee_layer(dataset, vis_params, name="ESA Worldcover", opacity=0.5)
m.add_3d_buildings()
m.add_legend(builtin_legend="ESA_WorldCover", title="ESA Landcover")
m.add_layer_control()
m