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, }, })
原文:https://www.cnblogs.com/yhllx999/p/15352793.html