Bootstrap

解决Cesium绘制几何图形被高程遮挡问题

图一

viewer.scene.globe.depthTestAgainstTerrain = true;

图二

viewer.scene.globe.depthTestAgainstTerrain = false;

depthTestAgainstTerrain
设置该属性为true之后,标绘将位于地形的顶部;
如果设为false(默认值),那么标绘将位于平面上。所以被高程地形遮挡。
缺陷:开启该属性有可能在切换图层时会引发标绘消失的bug。
在这里插入图片描述
在这里插入图片描述

;