how to remove a customDataSource? for example i have two dataSources, like this below.
var dataSource1 = new Cesium.CustomDataSource('myData1');
var dataSource2 = new Cesium.CustomDataSource('myData2');
var entity1 = dataSource1.entities.add({
position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
billboard : {
image : 'image1.png'
}
});
var entity2 = dataSource2.entities.add({
position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
billboard : {
image : 'image2.png'
}
});
viewer.dataSources.add(dataSource1);
viewer.dataSources.add(dataSource2);
Thank you for the thoughtful question! I recommend using the remove method of DataSourceCollection to remove dataSource2. Here is the documentation for remove:
Thank you for sharing this with me. It would be helpful if you could provide a more complete code example. For instance, a sandcastle demo that showcases the error would be very helpful. I suspect that this issue stems from the variable dataTitik.