viewer.imageryLayers.addImageryProvider(layer);
var cs=["http://localhost:3000/tileset.json","http://localhost:3000/f1/tileset.json"];
cs.map((val) => {
let tileset=this.viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url:val,
show:false,
name:val
}))
//console.log(val)
tileset.name=val
})
csprimitives=viewer.scene.primitives._primitives
csprimitives.map((val) => {
if(val.name=="http://localhost:3000/tileset.json"){
val.show=true
console.log("我是对应的图层")
}
})
console.log(csprimitives)
cesium给tileset添加名称来控制对应tileset的显示隐藏
最新推荐文章于 2026-05-18 06:06:09 发布
本文介绍如何使用Cesium JavaScript库加载并显示三维地图图层,包括使用imageryLayers添加影像图层,以及通过遍历数组加载多个三维瓦片图层,并设置其显示状态。
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印

2744

被折叠的 条评论
为什么被折叠?



