arcgis js之卷帘工具

arcgis js之卷帘工具

效果图:

代码:

var swipe = new Swipe({
  view: view,
  leadingLayers: [layer1, layer2],
  trailingLayers: [layer3],
  direction: "vertical", // swipe widget will move from top to bottom of view
  position: 50 // position set to middle of the view (50%)
});
view.ui.add(swipe);

注意:

1.leadingLayers,trailingLayers中添加的图层需要提前加入地图中

2.该工具在4.11版本中还没有。4.12版本未测试,4.13版本可使用

链接:

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Swipe.html#

钻研不易,转载请注明出处。。。。。。

原文地址:https://www.cnblogs.com/s313139232/p/12066287.html