Hi,
I encountered a performance issue when updating the colors of the polyline entities periodically. It basically "freeze" for a few seconds during the updates. Below is my sample app (Sandcastle, version 1.54), and how can it be improve further?
var viewer = new Cesium.Viewer('cesiumContainer');
var lon;
var lat;
var count = 4000;
for (var i = 0 ; i < count; ++i) {
lon = Cesium.Math.randomBetween(103,104);
lat = Cesium.Math.randomBetween(1,2);
viewer.entities.add({
polyline : {
positions: Cesium.Cartesian3.fromDegreesArray([lon, lat, lon+0.05, lat+0.05]),
width : 5,
material : Cesium.Color.fromRandom(),
clampToGround : true
}
});
}
viewer.zoomTo(viewer.entities);
multiStep();
function multiStep() {
var i;
var newtime = 10000;
viewer.entities.suspendEvents();
for (i=0; i<viewer.entities.values.length;i++) {
viewer.entities.values[i].polyline.material.color.setValue(Cesium.Color.fromRandom());
}
viewer.entities.resumeEvents();
if (true) {
setTimeout(multiStep, newtime);
}
}