Hi!
This seems like a very easy question, but I can’t get it figured out.
I create entities from a WFS-response (GeoJson) and store them in the variable “building”. So “building” contains all my entities.
building.push(viewer.entities.add({
id : id,
name : "Building "+ id,
polygon : {
hierarchy : {
positions : Cesium.Cartesian3.fromDegreesArray(coor),
holes : holePositions
},
material : Cesium.Color.RED.withAlpha(0.5),
outline : true,
outlineColor : Cesium.Color.BLACK,
extrudedHeight : height
}
}));
Now, in my application I want the users to have the option to change the colors of the enities (by height for example).
So, I have to loop over the “building” variable, check the height of the entity and change its color according to its height.
What’s the easiest way to do update an entity? Because I cannot seem to access the properties of the entities. I tried doing it with the use of the “building” variable, but updating it, does not change the color of my entities:
building[i]._polygon._material._color._value = newColor;
Wout