clock vs. clockViewModel

I’m having trouble with this change.

My current code:

viewer = new Cesium.Viewer(‘cesiumContainer’, {

animation : false,

baseLayerPicker : false,

fullscreenButton : true,

geocoder : false,

homeButton : false,

infoBox : false,

sceneModePicker : false,

selectionIndicator : true,

clock : new Cesium.Clock({

startTime : new Cesium.JulianDate(jDay, jSec),

currentTime : new Cesium.JulianDate(jDay, jSec),

stopTime : new Cesium.JulianDate(jDay, jSecStop),

clockRange : loopVal

}),

timeline : !Boolean(liveUrl),

navigationHelpButton : false,

navigationInstructionsInitiallyVisible : false,

scene3DOnly : true,

imageryProvider : bingImagery,

//imageryProvider : esriImagery,

mapStyle : Cesium.BingMapsStyle.AERIAL,

terrainProvider : agiTerrain,

// orderIndependentTranslucency : false, // hack to prevent Safari/Chrome crash

shadows : true,

useDefaultRenderLoop : false

});

Simply changing

“clock: new CesiumClock({…” to

“clockViewModel: new CesiumClock({…”

doesn’t work.

I’ve read through issue #5289 but don’t get it. Sorry.

Thanks, M.

Hi Matt,

You want to create a new clockViewModel, passing in a Cesium Clock, like this “clockViewModel : new Cesium.ClockViewModel(clock)”.

Check out this file for an example: https://github.com/AnalyticalGraphicsInc/cesium/pull/5457/commits/6292d0b71b0745cdcee692a5650a4809583ed745

Hope that helps,

  • Rachel

That worked. Thanks. - M