How to combine two customdatasources?

I have two customDataSources, each has an entities collection of billboards. I want to combine these two customDataSources, i.e. combine their entities collections.

Anyone knows how to do that? Thanks!

var dataSource1 = new Cesium.CustomDataSource(‘data1’);
var dataSource2 = new Cesium.CustomDataSource(‘data2’);
// combine dataSource1 and dataSource2 = totalData
this._map.dataSources.add(totalData);

``

Hi there,

You can iterate through the EntityCollection attached to one of the DataSources like this: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=GeoJSON%20and%20TopoJSON.html&label=Showcases

For each entity in that group, then call entityCollection.add() to add it to the second group: http://cesiumjs.org/Cesium/Build/Documentation/EntityCollection.html?classFilter=entity#add

Hope that helps,

  • Rachel