**Hi guys, **
I am trying to change the entity.polygon.outline of a custom datasource onclick. Everything works fine except for the first change done to the entity.polygon.outline after datasource show property is changed. Cesium version : 1.32
Sample to show the problem:
var dataSource = new Cesium.CustomDataSource();
var entities = dataSource._entityCollection.values;
dataSource._entityCollection.add(new Cesium.Entity({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -115.0, 32.0,
-107.0, 33.0, -102.0, 31.0, -102.0, 35.0]),
material : Cesium.Color.RED.withAlpha(0.35),
outline: true,
height: 1
}
}));
setTimeout(function(){
entities[0].polygon.outlineColor = new Cesium.ConstantProperty(Cesium.Color.RED); // Works
}, 5000);
**setTimeout(function(){ **
dataSource.show = false;dataSource.show = true;console.log(‘Datasource : show’);
}, 10000);
setTimeout(function(){
entities[0].polygon.outlineColor = new Cesium.ConstantProperty(Cesium.Color.BLACK); // Doesnot work
}, 15000);
setTimeout(function(){
entities[0].polygon.outlineColor = new Cesium.ConstantProperty(Cesium.Color.BLACK); // Works
}, 20000);
//Create a Viewer instances and add the DataSource.
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
animation : false,
timeline : false
});
viewer.clock.shouldAnimate = false;
viewer.dataSources.add(dataSource);
Could someone help me with this?
Thanks in advance,
Monisha