ArcGIS JS API 4.x(二) 加载 3.x所说的动态地图服务图层

        前言:在使用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、叠加效果图

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值