var gallery = '../../SampleData/';
var viewer = new Cesium.Viewer('cesiumContainer');
var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.loadUrl(gallery + 'simple.czml');
viewer.dataSources.add(czmlDataSource);
Sandcastle.addToolbarButton('Change colors', function() {
var entities = czmlDataSource.entities.entities;
for(var i = 0, len = entities.length; i < len; i++) {
var entity = entities[i];
if(entity.path) {
entity.path.material = Cesium.ColorMaterialProperty.fromColor(Cesium.Color.fromRandom({ alpha: 1.0 }));
}
}
});