1. A concise explanation of the problem you’re experiencing.
I am working on a cesium project and the goal is to display the vehicles driving according to their gpx tracks data on maps. As I met the orientation problem before(the orientation changed to the default value when the vehicle stops), now I make the orientation as a compositeProperty and modify the CZML position into different intervals(moving or stopping), but during different time intervals the vehicle seems suddenly disappears and then flashes back. The scene is like this: A single car drives from 00:00:00 to 00:00:39, then stops until 00:01:25, and then drives to 00:01:40. Is there anything wrong in my code? Can someone help me to get through this? Thanks in advance!
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
(1)code in App.js:
var vehicleroute = Cesium.CzmlDataSource.load(’./Source/SampleData/CZMLfromSUMO_singleVeh.czml’);
var vehicle;
var compositeOri = new Cesium.CompositeProperty();
vehicleroute.then(function (dataSource) {
viewer.dataSources.add(dataSource);
vehicle = dataSource.entities.getById(‘Point’);
vehicle.model = {
uri: ‘./Source/SampleData/Models/CesiumMilkTruck.gltf’,
minimumPixelSize: 12,
maximumScale: 1000,
silhouetteColor: Cesium.Color.WHITE,
};
var movingOri = new Cesium.VelocityOrientationProperty(vehicle.position);
var stopOri = new Cesium.ConstantProperty(movingOri.getValue(Cesium.JulianDate.fromIso8601(‘2019-05-08T00:00:39Z’)));
compositeOri.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
iso8601 : ‘2019-05-08T00:00:00Z/2019-05-08T00:00:39Z’,
data : movingOri
}));
compositeOri.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
iso8601 : ‘2019-05-08T00:00:40Z/2019-05-08T00:01:25Z’,
data : stopOri
}));
compositeOri.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
iso8601 : ‘2019-05-08T00:01:26Z/2019-05-08T00:01:40Z’,
data : movingOri
}));
vehicle.orientation = compositeOri;
vehicle.position.setInterpolationOptions({
interpolationDegree : 3,
interpolationAlgorithm : Cesium.HermitePolynomialApproximation
});
});
(2)position in CZML:
"position":[
{
"interval":"2019-05-08T00:00:00Z/2019-05-08T00:00:39Z",
"epoch":"2019-05-08T00:00:00Z",
"cartographicDegrees":[
0,
11.433648,
48.764329,
10,
1.0,
11.433471,
48.764285,
10,
......
39.0,
11.429106,
48.762382,
10
]
},
{
"interval":"2019-05-08T00:00:40Z/2019-05-08T00:01:25Z",
"epoch":"2019-05-08T00:00:00Z",
"cartographicDegrees":[
11.429103,
48.762381,
10
]
},
{
"interval":"2019-05-08T00:01:26Z/2019-05-08T00:01:40Z",
"epoch":"2019-05-08T00:00:00Z",
"cartographicDegrees":[
86.0,
11.429095,
48.762376,
10,
...
100.0,
11.429375,
48.7625,
10
]
}
],
``
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
As in 1.
4. The Cesium version you’re using, your operating system and browser.
Version: 1.57, Windows, Firefox.
CZMLfromSUMO_singleVeh.czml (6.34 KB)