var viewer = new Cesium.Viewer('cesiumContainer');
var czml = [{
"id": "document",
"name": "polygon",
"version": "1.0"
}, {
"id": "shape2",
"name": "Red box with black outline",
"availability": "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"box": {
"dimensions": {
"cartesian": [30.0, 30.0]
},
"material": {
"stripe": {
"orientation": "VERTICAL",
"evenColor": {
"rgba": [10, 211, 250, 0]
},
"oddColor": {
"rgba": [10, 211, 250, 255]
},
"offset": {
"number": 1
},
"repeat": 0.5
}
},
},
"path": {
"material": {
"solidColor": {
"color": {
"interval": "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"rgba": [255, 255, 255, 128]
}
}
},
"width": [{
"interval": "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"number": 3.0
}],
"show": [{
"interval": "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"boolean": true
}]
},
"position": {
"interpolationAlgorithm": "LAGRANGE",
"interpolationDegree": 1,
"epoch": "2012-08-04T16:00:00Z",
"cartographicDegrees": [
0.0, 118.87841653400005, 30.95679870500004, 0.0,
10.0, 118.87826541800007, 30.95680770900003, 0.0,
20.0, 118.8774481050001, 30.956860625000047, 0.0,
30.0, 118.87660414600009, 30.956910105000077, 0.0,
...省略
]
}
}];
var dataSourcePromise;
var i = 30;
var a = 410;
setInterval(function() {
i += 0.001;
a += 10;
czml[1].position.cartographicDegrees.push(a, 118.813667, i, 0);
}, 10000);
dataSourcePromise = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSourcePromise);
viewer.zoomTo(dataSourcePromise);