Hi
I've loaded a geojson file consisting of a polyline with roughly 1200 segments, where each segment has a few different properties, as a corridor. So far everything works as expected. However I now want to update the colors of each segment based its properties. I've come up with the following code which does what I want (ds is my geojson datasource and color_map is a function that maps a property value to a color):
let entities = ds.entities.values
for (let entity of entities) {
p = entity.properties[property].getValue()
c = color_map(p)
entity.corridor.material = new Cesium.ColorMaterialProperty(new Cesium.Color(c[0]/255,c[1]/255,c[2]/255,1))
}
However it is extremely slow. It takes 7-10 seconds (chrome on windows 7) between triggering the function and the colors being updated. Why is this code so extremely slow and is there a better way to achieve this?
Thanks
Dag