Loading multiple czml files to view

I have a process where I have a simulation that is generating CZML files in 30 minute increments. When I try to load more than one of these in my cesium viewer I can only see one of them.

The web application is a Drupal site with the cesium module. That is how I get the files selected from a form to the cesium viewer code.

Here is the code I’m using.

(function ($) {
Drupal.behaviors.cesium = {
attach: function (context, settings) {

var viewer = new Cesium.Viewer('myApp-cesium', {
    imageryProvider : new Cesium.createOpenStreetMapImageryProvider(),
    sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, //SCENE3D,
    baseLayerPicker : false,
    fullscreenButton: true,
    geocoder: false,
    fullscreenElement: 'myApp-cesium',
    timeline: true,
    animation: true,
    navigationInstructionsInitiallyVisible: false,
    homeButton: false,
    // Turn off the skybox (i.e. stars)
    skyBox : new Cesium.SkyBox({
          sources : {
            positiveX : 'skybox_px.png',
            negativeX : 'skybox_nx.png',
            positiveY : 'skybox_py.png',
            negativeY : 'skybox_ny.png',
            positiveZ : 'skybox_pz.png',
            negativeZ : 'skybox_nz.png'
          },
          show : false}),
    // Show Columbus View map with Web Mercator projection
    mapProjection : new Cesium.WebMercatorProjection()
});
//Add basic drag and drop functionality (do not overwrite existing datasources)
viewer.extend(Cesium.viewerDragDropMixin, { clearOnDrop : false });

var missions = [];
var czmlLoaded = false;

var nfiles = Drupal.settings.atlantis_mti.nfiles;
console.log('Loading ’ + nfiles + ’ files: ‘);
for (i=0; i<nfiles; i++) {
var file = Drupal.settings.atlantis_mti.czmlFiles[i];
console.log(’ ’ + file);
missions[i] = new Cesium.CzmlDataSource().load(file);
missions[i].show = true;
viewer.dataSources.add(missions[i]);
czmlLoaded = true;
}

// Zoom to the first data soure that was loaded
if (czmlLoaded) {
viewer.zoomTo(missions[0]);
}
}
};
}(jQuery));

As long as you’re using viewer.dataSources.add to add additional CZML files, it should work without clearing the previous data, like in this Sandcastle example if you click “Add Second CZML”.

In your application, is the previous data disappearing? Are you able to reproduce the issue in Sandcastle?

If the entity in second czml file has references with the entity in the first czml file, its would not appear?
how to solve it? T T