I must be missing something; would someone mind taking a look at my issue below?
I’m not using the Cesium Viewer Widget but I am attempting to load and process a CZML file on-demand.
The CZML file is loaded and my DynamicObjectCollection is processed properly. However, I cannot seem to get the CZML to be ‘loaded’ into the scene. Perhaps I am not using the Clock properly or my render/tick method is not properly taking into account the updated Clock start/stopTime? I do not receive any errors and the CZML is processed correctly. I update the clock and set the start/stop/currentTime accordingly and even request the animationControlle to play. I must be missing something. Thanks!
Initialization Snippet
var objects = new Cesium.DynamicObjectCollection();
var visualizers = Cesium.VisualizerCollection.createCzmlStandardCollection(scene, objects);
// initialize clock
var currentTime = new Cesium.JulianDate();
var clock = new Cesium.Clock({
startTime : currentTime.addDays(-0.5),
stopTime : currentTime.addDays(0.5),
currentTime : currentTime,
clockStep : Cesium.ClockStep.SYSTEM_CLOCK_DEPENDENT,
multiplier: 1
});
var animationController = new Cesium.AnimationController(clock);
CZML Processing Function
function processScenario(file) {
Cesium.loadJson(file).then(function(czml) {
Cesium.when(
Cesium.processCzml(czml, objects, file)).then(function(czml) {
// console.log(objects); GOOD!
var availability = objects.computeAvailability();
clock.startTime(availability.startTime);
clock.stopTime(availability.stopTime);
clock.clockRange = Cesium.ClockRange.LOOP;
clock.currentTime(availability.startTime);
animationController.play();
visualizers.update();
scene.render(); //
});
});
}
Tick