原文链接及内容

实现效果如下:

示例代码如下:

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
const czml = [
{
id: "document",
name: "CZML Geometries: Polyline Volume",
version: "1.0",
},
{
id: "greenBox",
name: "Green box with beveled corners and outline",
polylineVolume: {
positions: {//路径坐标(经度,纬度,高度):3个点
cartographicDegrees: [
-90.0, 32.0, 0,
-90.0, 36.0, 100000,
-94.0, 36.0, 0,
],
},
/**
* shape属性:截面形状,采用了局部坐标系XY平面
* 坐标原点为路径上的点,
* 我们可以采用数学上的象限来定义界面的坐标。
*/
shape: {
cartesian2: [
-50000, -50000, //左下,第三象限
50000, -50000, //右下,第四象限
50000, 50000, //右上,第一象限
-50000, 50000 //左上,第二象限
],
},
cornerType: "BEVELED",
material: {
solidColor: {
color: {
rgba: [0, 255, 0, 128],
},
},
},
outline: true,
outlineColor: {
rgba: [255, 255, 255, 255],
},
},
},
{
id: "blueStar",
name: "Blue star with mitered corners and outline",
polylineVolume: {
positions: {
cartographicDegrees: [
-95.0, 32.0, 0,
-95.0, 36.0, 100000,
-99.0, 36.0, 200000,
],
},
shape: {
cartesian2: [
70000, 0,
45048.44339512096, 21694.186955877907,
43644.28613011135, 54728.203772762085,
11126.046697815722, 48746.39560909118,
-15576.465376942004, 68244.95385272766,
-31174.490092936674, 39091.57412340149,
-63067.82075316933, 30371.861738229076,
-50000,6.123233995736766e-12,
-63067.82075316934, -30371.86173822906,
-31174.490092936685, -39091.574123401486,
-15576.465376942022, -68244.95385272766,
11126.046697815711, -48746.39560909118,
43644.28613011134, -54728.20377276209,
45048.44339512095, -21694.186955877918,
],
},
cornerType: "MITERED",
material: {
solidColor: {
color: {
rgba: [0, 0, 255, 255],
},
},
},
outline: true,
outlineColor: {
rgba: [255, 255, 255, 255],
},
},
},
];

const viewer = new Cesium.Viewer("cesiumContainer");
const dataSourcePromise = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSourcePromise);
viewer.zoomTo(dataSourcePromise);

关于CornerType属性如下图所示: