1. 加载库中已有图层
python
import os
os.environ['HTTP_PROXY'] = 'http://127.0.0.1:8001'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:8001'
# 设置中心位置/地图层级/图层加载高度,加载图层
import geemap
Map=geemap.Map(center=[40, 100], zoom=4, height=600)
Map
python
# 添加已经集成的底图图层
Map.add_basemap("OpenTopoMap")
2. 加载外部数据图层
python
# 通过WMS服务添加图层
Map = geemap.Map(center=[40, -100], zoom=4)
url = 'https://www.mrlc.gov/geoserver/mrlc_display/NLCD_2019_Land_Cover_L48/wms?'
Map.add_wms_layer(
url=url,
layers='NLCD_2019_Land_Cover_L48',
name='NLCD 2019',
format='image/png',
attribution='MRLC',
transparent=True,
)
Map
python
# 加载XYZ tile图层
Map = geemap.Map(center=[40, 100], zoom=4, height=600)
Map.add_tile_layer(
url="https://mt1.google.com/vt/lyrs=p&x={x}&y={y}&z={z}",
name="Google Terrain",
attribution="Google",
)
Map