首页 / 浏览问题 / 三维GIS / 问题详情
怎么删除指定div的图层
9EXP 2023年08月24日
let oldlayers = reactive({});

oldlayers = await scene.open(tempModelObject.smallSceneUrl, buildNum, {

    name: "oldlayers",

    subdomains: tempModelObject.subdomains?.split(","),

    autoSetView: true, //自动定位

  });

oldlayers.removeAll(true)

这样写会报错,没有removeAll这个方法

1个回答

您好,请问您具体用的什么呢,iclient for cesium吗?

如果是的话,我们产品中是没有div图层的,只有场景对象的影像图层和普通缓存数据图层。

影像图层在scene.imageryLayers中,普通缓存数据图层在scene.layers中,

如果要删除图层,不可以使用scene.open或者scene.add类方法回调出的,需要从scene.imageryLayers或scene.layers来进行操作。

删除影像类图层可以使用scene.imageryLayers.remove或 scene.imageryLayers.removeAll

删除通缓存数据图层可以使用scene.layers.remove或 scene.layers .removeAll

参考:

http://support.supermap.com.cn:8090/webgl/web/apis/3dwebgl.html

希望可以帮助到您。

9,653EXP 2023年08月24日
...