1.MapView和SceneView

image.png

2.Map中图层的分组

2.1Ground layers地形图层

API : Map.ground

设置Map.ground

2.1.1使用默认ground实例

  1. const map = new Map({
  2. ground: 'world-elevation'
  3. })

示例:
image.png

2.1.2使用自定义Ground实例

  1. const customElevation = new ElevationLayer({
  2. url:'heep://may.server.com/arcgis/rest/service/MyElevationService/ImageServer'
  3. })
  4. const customGround = new Ground({
  5. layers: [customElevation]
  6. })
  7. const map = new Map({
  8. ground: customGround
  9. })

2.1.3设置背景色

map.ground.surfaceColor = '#004C73'
image.png
示例:
image.png

2.1.4设置透明度

map.ground.opacity = 0.3
image.png
示例:
image.png

2.1.5穿透地表

map.ground.navigationConstraint = {type:'none'}穿透地表
map.ground.navigationConstraint = {type:'stay-above'}保持在地表以上
image.png

2.2Basemap layers底图图层

Map.basemap

2.2.1使用默认Basemap实例

可供选择的basemap
image.png

  1. const map = new Map({
  2. basemap: 'topo'
  3. })

示例:
image.png

2.2.2使用自定义Basemap实例

  1. basemap: {
  2. baseLayers: [
  3. new TileLayer({url: baseUrl})
  4. ],
  5. refereneceLayers: [
  6. new TileLayer({url: refUrl})
  7. ]
  8. }

2.3Operational layers业务图层

Map.layers

  1. const f1 = new FeatureLayer({
  2. 'https://samplesever6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0'
  3. })
  4. const g1 = new GraphicsLayer()
  5. const map = new Map({
  6. layers: [f1,g1]
  7. })