That all works nicely and a plane is rendered on the screen.
I'm now trying to update the plane dynamically, so I've subscribed to Server Side Events with the following code:
function startup(Cesium) {
var czmlStream = new Cesium.CzmlDataSource();
var czmlEventSource = new EventSource(‘http://localhost:11000/aircraft/?format=czml’);
czmlEventSource.addEventListener(‘czml’, function(czmlUpdate) {
try {
console.log(czmlUpdate.data);
var json = JSON.parse(czmlUpdate.data);
czmlStream.process(json);
} catch (t) {
console.error(t)
}
}, false);
var viewer = new Cesium.Viewer('cesiumContainer', {
infoBox : false,
selectionIndicator : false,
shadows : true,
automaticallyTrackDataSourceClocks : false
});
viewer.dataSources.add(czmlStream);
The data is successfully arriving from the server, as I can see it logged in the client console. This is an example of one of the received updates: https://pastebin.com/kbz2GheL
Despite all this, the plane I created using the 'load' method is not updated.
I wrote this test app with the CZML packets you provided and the plane’s position looked like it updated correctly using czmlDataSource.process. Here’s the code:
Can you see anything that varies from what you’re doing? If this doesn’t work for you, what version of Cesium are you using? And also, what is your browser and OS?
I have the same aircraft model with very similar code;
the aircraft displays, the position updates are coming, but the aircraft is not "moving".
That is in my browser, if I go to another page then comeback to cesium, the aircraft has moved, but not if I stay on the same page.
It seems the display is not being refreshed. Do I have to do something special for
the viewer/scene to be refreshed?