var czml = [{
"clock": {
"currentTime": "2016-01-01T00:00:00Z",
"interval": "2016-01-01T00:00:00Z/2024-12-31T23:59:58Z",
"range": "LOOP_STOP",
"step": "SYSTEM_CLOCK_MULTIPLIER",
"multiplier": 20000000
},
"name": "test",
"version": "1.0",
"id": "document",
"properties": null
}, {
"polygon": {
"material": {
"solidColor": {
"color": {
"rgba": [0, 255, 0, 179]
}
}
},
"positions": {
"cartographicDegrees": [144.991, -37.914, 0.0,
144.991, -37.720, 0.0,
145.284, -37.720, 0.0,
145.284, -37.914, 0.0]
},
"outlineColor": {
"rgba": [50, 50, 50, 255]
},
"outline": true
},
"name": "Something",
"description": "foo"
}];
var viewer = new Cesium.Viewer('cesiumContainer');
var dataSource = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);
var options = [{
text : 'Static Green',
onselect : function() {
viewer.dataSources.get(0).entities.values[0].polygon.material = Cesium.Color.fromCssColorString('#00FF00');
}
}, {
text : 'Static Red',
onselect : function() {
viewer.dataSources.get(0).entities.values[0].polygon.material = Cesium.Color.fromCssColorString('#FF0000');
}
}, {
text : 'Time dynamic blue',
onselect : function() {
var tic = new Cesium.TimeIntervalCollectionProperty();
tic.intervals.addInterval(new Cesium.TimeInterval({
start: Cesium.JulianDate.fromIso8601('2015-01-01'),
stop: Cesium.JulianDate.fromIso8601('2025-01-01'),
data: Cesium.Color.fromCssColorString('#0000FF')
}));
viewer.dataSources.get(0).entities.values[0].polygon.material = new Cesium.ColorMaterialProperty(tic);
}
}];
Sandcastle.addToolbarMenu(options);