1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| const viewer = new Cesium.Viewer("cesiumContainer");
const greenCylinder = viewer.entities.add({ name: "带有黑色轮廓的绿色圆柱体(cylinder)", position: Cesium.Cartesian3.fromDegrees(-100.0, 40.0, 200000.0), cylinder: { length: 400000.0, topRadius: 200000.0, bottomRadius: 200000.0, material: Cesium.Color.GREEN.withAlpha(0.5), outline: true, outlineColor: Cesium.Color.BLACK, }, });
const redCone = viewer.entities.add({ name: "红色圆锥(cone)", position: Cesium.Cartesian3.fromDegrees(-105.0, 40.0, 200000.0), cylinder: { length: 400000.0, topRadius: 0.0, bottomRadius: 200000.0, material: Cesium.Color.RED, }, });
viewer.zoomTo(viewer.entities);
|