Cesium实景模型的隐藏与显示
1.用scene.open添加的图层,图层名称是idesktop和iserver中的图层名称
隐藏:
let bimlayer = this.viewer.scene.layers.findByIndex(0);//0:添加图层的索引,从0开始;this.viewer:实例的Cesium
bimlayer.visible = false;
显示:
let bimlayer = this.viewer.scene.layers.findByIndex(0);
bimlayer.visible = true;
2.用scene.addS3MTilesLayerByScp添加的图层
隐藏
let bimlayer =this.viewer.scene.layers.find(layerName);//layerName:图层名称
bimlayer.visible = false;
显示
let bimlayer =this.viewer.scene.layers.find(layerName);//layerName:图层名称
bimlayer.visible = true;
网友评论