首页 / 浏览问题 / 三维GIS / 问题详情
添加entity
43EXP 2021年08月13日
使用产品:iclient for webgl

问题详细描述:想绘制一个覆盖全球的面,通过这个添加,请问为什么报错,感觉坐标没错呢

viewer.entities.add({
  name: "polygon",
  polygon: {
    hierarchy: {
      positions: Cesium.Cartesian3.fromDegreesArray([
      -180, -85,180, -85,180, 85,-180, 85,-180, -85
      ])
    },
    material: Cesium.Color.BLUE.withAlpha(0.5),
  },
});

1个回答

您好,这样去添加:

viewer.entities.add({
    rectangle : {
        coordinates : Cesium.Rectangle.fromDegrees(-180,-90,180,90),
        material : new Cesium.StripeMaterialProperty({
            evenColor: Cesium.Color.WHITE,
            oddColor: Cesium.Color.BLUE,
            repeat: 5
        })
    }
});
康鑫
1
6,077EXP 2021年08月13日
你好,我不要rectangle ,因为我还要加导洞(holes),矩形加不了holes
那你可以尝试添加两个半圆,拼接在一起使其覆盖整个球体
...