前言:在使用arcgis js api 3.x的时候,有切片地图服务和动态地图服务,从3.x到4.x版本过渡的时候,希望能够找到和3.x对应的类,在上篇博客中,我们找到了和ArcGISTiledMapServiceLayer(3.x)对应的类TileLayer(4.x),这篇文章 找到了和ArcGISDynamicMapServiceLayer(3.x)对应的类MapImageLayer(4.x)。
1、获取动态地图服务的地址url。
http://localhost:6080/arcgis/rest/services//China_WGS84/MapServer (博主本机server上发布的一个地图服务)
2、往SceneView上面叠加。
var layer = new MapImageLayer({ url: "http://localhost:6080/arcgis/rest/services//China_WGS84/MapServer", id: "initlayer", }); var map = new Map({ basemap: 'streets', ground: "world-elevation", layers: [layer] }); var view = new SceneView({ container: "viewDiv", map: map });
3、叠加效果图