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


Hi there,

You can iterate through the EntityCollection attached to one of the DataSources like this:

For each entity in that group, then call entityCollection.add() to add it to the second group:

Hope that helps,

  • Rachel