首页 / 浏览问题 / 三维 / 问题详情
webgl地球隐藏绘制的贴地entity也不显示
lilisi  (18分)  才疏学浅
10月11日, 2021
三维场景背景和球体隐藏透明。

绘制的贴地entity也不显示,是和原生的不一样么

1个回答

你好,我试了一下,原生Cesium也是这样,entity设置贴地,只要球体隐藏了实体就会消失。这是正常现象,球体不见了实体也就失去了依附的对象,所有也会跟着消失
卷饼先生  (6,042分)  登峰造极
10月11日, 2021
viewer.imageryLayers.get(0).show = false;

        viewer.scene.skyBox.show = false;
        viewer.scene.backgroundColor = Cesium.Color.TRANSPARENT;
        viewer.scene.sun.show = false;
        viewer.scene.moon.show = false;
        viewer.scene.globe.baseColor = Cesium.Color.TRANSPARENT;
        viewer.scene.globe.showGroundAtmosphere = false;
        viewer.scene.globe.enableLighting = false;
        viewer.scene.globe.fillHighlightColor = Cesium.Color.TRANSPARENT;
        viewer.scene.skyAtmosphere.show = false;
        viewer.scene.fog.enabled = false;

        viewer.entities.add({
            position:Cesium.Cartesian3.fromDegrees(89.912109375,44.02442151965934),
            polyline: {
                positions: parent.Cesium.Cartesian3.fromDegreesArray([  89.912109375,
                    44.02442151965934,90.439453125,
                    22.917922936146045,114.345703125,
                    25.48295117535531,112.67578124999999,
                    44.653024159812,112.1484375,
                    46.37725420510028]),
                width: 10,
                material: Cesium.Color.fromAlpha(Cesium.Color.CYAN,1),
                clampToGround: true
            },
              label: {
                text: "12312312312321321321321",
                fillColor: Cesium.Color.WHITE,
                font: "small-caps bold 18px/1 sans-serif",
                backgroundColor: Cesium.Color.fromCssColorString("#1c97f5"),
                showBackground: true,
                style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                backgroundPadding: new Cesium.Cartesian2(7, 5),
                pixelOffset: new Cesium.Cartesian2(0, -40),
                heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
              },
             polygon: {
                 hierarchy: Cesium.Cartesian3.fromDegreesArray([  89.912109375,
                    44.02442151965934,90.439453125,
                    22.917922936146045,114.345703125,
                    25.48295117535531,112.67578124999999,
                    44.653024159812,112.1484375,
                    46.37725420510028]),
                 material: Cesium.Color.fromAlpha(Cesium.Color.RED,0.1),
             }
        })

你试一下,一个原生一个超图webgl包,贴地线超图的没有,原生的有
你好,我这边重现问题了,我们这边先找下原因,尽快解决这个问题,您这边先私信发我一下您的邮箱地址,待问题解决好之后我这边再发个新包给你
1027168891@qq.com
...