影像无限放大的三种方法

1、用WMTSLayer创建影像(需要WMTS服务和对应的.xml文件)

this.layer.tileLayer = new this.esri.TileLayer({ url })

2、利用tileLayer创建图层,把图层放到GroupLayer中,然后再加载到map上

this.layer.baseLayer = new this.esri.TileLayer({ url })
const groupLayer = new this.esri.GroupLayer({
        layers: [
          this.layer.tileLayer,
          // graphicsLayer
        ]
      }) 
this.map = new this.esri.Map({
        layers: [groupLayer]
      })  

3、利用tileInfo.create()方法实现(推荐)

// 4.19 无法设置值,默认支持24层级
const tileInfo = esri.TileInfo.create()
// 4.20 及以上的版本适用
const tileInfo = esri.TileInfo.create({
  numLODs: 26
})
this.map = new esri.Map({
  layers: [baseLayer, groupLayer],
})
this.mapView = new esri.MapView({
  container: 'webMap',
  map: this.map,
  constraints: {
    lods: tileInfo.lods,
  },
})

 

posted @ 2021-09-29 14:33  飞天小毛驴404  阅读(133)  评论(0)    收藏  举报