cesium 关闭和取消3D地形图。
if(that.isguide){
console.log('开启3d地形_____')
//本地的3D地形
if (window._MapConfig.terrainUrl) {
console.log("本地的3D地形!")
viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url: window._MapConfig.terrainUrl,
minimumLevel: 0,
maximumLevel: 16,
})
} else {
console.log("默认地形-cesium")
viewer.terrainProvider = Cesium.createWorldTerrain()
}
viewer.scene.globe.depthTestAgainstTerrain = true;//是否检查深度
}else {
console.log('关闭3d地形_____')
viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider({});
viewer.scene.globe.depthTestAgainstTerrain = false;//是否检查深度
}
网友评论