cmzl文件,内容参见官方文档,这里是简单的。要满足Json格式,
[
{
"id": "document",
"version": "1.0",
"clock": {
"interval": "2020-07-19T15:18:00Z/2020-07-19T15:18:22Z",
"currentTime": "2020-07-19T15:18:00Z",
"multiplier": 5,
"range": "LOOP_STOP",
"step": "SYSTEM_CLOCK_MULTIPLIER"
}
},
{
"id": "CesiumMilkTruck",
"model": {
"gltf": "CesiumMilkTruck.glb"
},
"position": {
"interpolationAlgorithm": "LINEAR",
"forwardExtrapolationType": "HOLD",
"cartesian": [
"2020-07-19T15:18:00Z",
3827292.206058296,
-255149.36433649782,
5078326.847041333,
"2020-07-19T15:18:02Z",
3827303.4123459086,
-255175.6293283247,
5078317.401908316,
"2020-07-19T15:18:04Z",
3827309.295141046,
-255192.28289668506,
5078312.155658656,
"2020-07-19T15:18:06Z",
3827281.296653248, -255198.18742640334,5078332.828258813,
"2020-07-19T15:18:08Z",
3827269.0040293424, -255195.8126329426,5078342.154910536,
"2020-07-19T15:18:10Z",
3827248.8268890968, -255197.47945836367,5078357.1830042405,
"2020-07-19T15:18:12Z",
3827238.8767832965, -255200.55471232135,5078364.479827078,
"2020-07-19T15:18:14Z",
3827227.2976101553, -255203.15619209793,5078373.021305417,
"2020-07-19T15:18:16Z",
3827217.299357651, -255214.15138457165,5078379.95543854,
"2020-07-19T15:18:18Z",
3827204.105547348, -255214.48816548448,5078389.819846677,
"2020-07-19T15:18:20Z",
3827189.088842923, -255209.3799630672,5078401.248324358,
"2020-07-19T15:18:22Z",
3827173.684167592, -255215.11988032763,5078412.573222442
]
},
"orientation": {
"unitQuaternion": [
-0.0084011337938999,
0.3210181022701266,
-0.35850421987074924,
0.7686388857813198
]
}
}
]
html中加载czml文件
dataSource = new Cesium.CzmlDataSource();
dataSource.load("route copy.czml");
viewer.dataSources.add(dataSource);
具体参考部门内部Git