各位大佬我想问一下,我已经点击并获取到当前图元id,但是进行操作却没有任何反应,是为什么呢,真的困扰好多天了,万分感谢。
var Gridlayer = []
for (let i = 0; i < layers.length; i++) {
const element = layers[i];
if(element.name == 'daolu'){
Gridlayer = element
}
}
Gridlayer.visible = true
// Gridlayer.setOnlyObjsVisible(['67'],true)
var cancas = viewer.scene.canvas;
var handler = new Cesium.ScreenSpaceEventHandler(cancas);
handler.setInputAction(function (evt){
var pick = viewer.scene.pick(evt.position)
console.log(pick);
var aa =Gridlayer.getObjsColor(pick.id)
// Gridlayer.setOnlyObjsVisible([pick.id],false)
debugger
},Cesium.ScreenSpaceEventType.LEFT_CLICK)
})