The application is using Cesium v1.19 and I have a question about Scene.preRender and Scene.postRender usages. All data is streamed via CZML and we have a multiple CzmlDataSource instances in the Viewer. CZML packets are streamed every second, with each update containing multiple CZML packets.
This is our scenario... When the browser receives a CZML update, we would like to apply a routine that traverses the CZML and apply some client-side business logic. For example -- Lookup all point entities and adjust their respective label position to a different location than what was sent by the service. Essentially, my goal is to adjust data coming from the service and prior to render, then display them on a per-client/browser basis.
Lets assume the code below.
var viewer = new Cesium.Viewer('cesiumContainer');
// process initial czml packet with 100 different points around the global
viewer.scene.preRender.addEventListener(function(s,t) {
console.log('PreRender: ' + t
+ ', ground: ' + s.groundPrimitives.length
+ ', primitives: ' + s.primitives .length);
});
My questions are:
1. When the event is raised from the code above, does the passed-in Scene object contains entities prior to the incoming CZML update? Or, does it contain all entities from the update (but not rendered)?
2. If the same routine is hooked up to Scene.postRender and I traverse the entities and change its color (for example), would that color change be immediately applied, or in the next render cycle?
3. Are there any performance gotchas that I need to consider when changing incoming CZML packets prior to rendering them?
Thank you.