原文链接及内容

效果如下图:分别以经纬度、笛卡尔坐标以及弧度三种坐标形式表示的点。

示例代码如下:

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
const czml = [
{
id: "document",
name: "CZML Position Definitions",
version: "1.0",
},
{
id: "点1",
name: "经纬度表示的点",
position: {
cartographicDegrees: [-111.0, 40.0, 150000.0],
},
point: {
color: {
rgba: [100, 0, 200, 255],
},
outlineColor: {
rgba: [200, 0, 200, 255],
},
pixelSize: {
number: 10,
},
},
},
{
id: "点2",
name: "笛卡尔坐标表示的点",
position: {
cartesian: [1216469.9357990976, -4736121.71856379, 4081386.8856866374],
},
point: {
color: {
rgba: [0, 100, 200, 255],
},
outlineColor: {
rgba: [200, 0, 200, 255],
},
pixelSize: {
number: 10,
},
},
},
{
id: "点3",
name: "以弧度表示的点",
position: {
cartographicRadians: [Math.PI, (3 * Math.PI) / 4, 150000],
},
point: {
color: {
rgba: [10, 200, 10, 255],
},
outlineColor: {
rgba: [200, 0, 200, 255],
},
pixelSize: {
number: 10,
},
},
},
];

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