callbackproperty.js var viewer = new Cesium.Viewer('cesiumContainer');function callback(time, result) { var txf = Math.floor(time.secondsOfDay); if (txf %2 === 1) { result = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -115.0, 32.0, -1
var viewer = new Cesium.Viewer('cesiumContainer'); function callback(time, result) { var txf = Math.floor(time.secondsOfDay); if (txf %2 === 1) { result = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -115.0, 32.0, -107.0, 33.0, -102.0, 31.0, -102.0, 35.0]); } else { result = Cesium.Cartesian3.fromDegreesArray([-116, 37.0, -115.0, 32.0, -107.0, 33.0, -102.0, 31.0, -102.0, 35.0]); } return result; } var hp = new Cesium.CallbackProperty(callback, false); var redPolygon = viewer.entities.add({ name : 'Red polygon on surface', polygon : { hierarchy : hp, material : Cesium.Color.RED } }); viewer.zoomTo(viewer.entities);