Adding CZML to a CzmlDataSource while maintaining playback

  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();
  function onOpen(evt){

    // 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(;


Yeah, this is a problem with the current code. Basically, every time you add new data, it triggers a notification that the clock has changed.

Try passing { automaticallyTrackDataSourceClocks : false } into the Viewer constructor. This will disable the automatic clock updating, so you’ll have to configure the clock yourself by changing values on viewer.clock.

In the long run, we need the clock notifications to be more granular, so that adding new data points can cause the stopTime to change, without affecting currentTime or other settings.

That works great. Problem solved. Thanks!