All,
I'm trying to stream CZML to a web browser using web sockets. The data path is working just fine, but whenever I use .process(czml) to ingest the new data, the animation widget on the viewer resets back to the start of the timeline and stops animation. Is there a way to append CZML and update the start/stop times of the animation, but leave the current time and playback rate unaffected?
Here's my code as it stands, but it depends on a websocket server I can't share.
var viewer = new Cesium.Viewer('cesiumContainer');
var czmlDataStreamSource = new Cesium.CzmlDataSource();
viewer.dataSources.add(czmlDataStreamSource);
function onOpen(evt){
console.log("CONNECTED");
}
// Connect to a localhost websocket
var ws = new WebSocket('ws://localhost:9001/');
ws.onmessage = function(evt) {
// This strikes me as extremely dangerous.
var czml = eval(evt.data);
czmlDataStreamSource.process(czml);
};
Thanks,
Carl