Here’s a Sandcastle example of my interpretation of what you might be looking for. Hope it helps.
Scott
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
terrainProvider: Cesium.createWorldTerrain()
});
function updatePoints(pointsOfInterest) {
var promise = Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, pointsOfInterest);
Cesium.when(promise, function(updatedPositions) {
// Add 600.0 meters to the height at each point
var adjustedPoints = new Array(updatedPositions.length);
for (var i = 0; i < updatedPositions.length; i++) {
adjustedPoints[i] = Cesium.Cartesian3.fromRadians(
updatedPositions[i].longitude,
updatedPositions[i].latitude,
updatedPositions[i].height + 600.0);
}
// Create SampledPositionProperty to supply entity position
var p = new Cesium.SampledPositionProperty();
for (var j = 0; j < updatedPositions.length; j++) {
p.addSample(heloTimes[j], adjustedPoints[j]);
}
var availability = Cesium.TimeIntervalCollection.fromJulianDateArray({julianDates: [
heloTimes[0],
heloTimes[heloTimes.length-1]
]});
// Create entity
var entity = viewer.entities.add({
name: heloName,
position: p,
path: {
leadTime: 86400,
trailTime: 86400,
width: 3,
material: new Cesium.PolylineOutlineMaterialProperty({
color: Cesium.Color.DODGERBLUE,
outlineColor: Cesium.Color.WHITE,
outlineWidth: 2
})
}
});
var promise = viewer.zoomTo(entity);
promise.then(function(result) {
console.log(result); // "Stuff worked!"
}, function(err) {
console.log(err); // Error: "It broke"
});
});
}
var heloName = ‘helo-1’;
var heloTimes = [
new Cesium.JulianDate.fromIso8601("2018-04-23T13:00:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:05:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:10:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:15:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:20:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:25:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:30:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:35:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:40:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:45:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:50:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T13:55:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T14:00:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T14:05:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T14:10:00Z"),
new Cesium.JulianDate.fromIso8601("2018-04-23T14:15:00Z")
];
var wayPoints = [
Cesium.Cartographic.fromDegrees(-75.595831, 40.039481),
Cesium.Cartographic.fromDegrees(-75.596690, 40.040845),
Cesium.Cartographic.fromDegrees(-75.598071, 40.040727),
Cesium.Cartographic.fromDegrees(-75.599266, 40.040929),
Cesium.Cartographic.fromDegrees(-75.605076, 40.041031),
Cesium.Cartographic.fromDegrees(-75.615736, 40.037679),
Cesium.Cartographic.fromDegrees(-75.617471, 40.038690),
Cesium.Cartographic.fromDegrees(-75.618650, 40.040087),
Cesium.Cartographic.fromDegrees(-75.624291, 40.044382),
Cesium.Cartographic.fromDegrees(-75.627222, 40.044786),
Cesium.Cartographic.fromDegrees(-75.629916, 40.047952),
Cesium.Cartographic.fromDegrees(-75.632611, 40.049922),
Cesium.Cartographic.fromDegrees(-75.633570, 40.050310),
Cesium.Cartographic.fromDegrees(-75.634581, 40.050343),
Cesium.Cartographic.fromDegrees(-75.635709, 40.049922)
];
var startTime = heloTimes[0];
var stopTime = heloTimes[heloTimes.length - 1];
stopTime = Cesium.JulianDate.addMinutes(startTime, 5.0 * wayPoints.length, stopTime);
viewer.clock.currentTime = startTime;
viewer.clock.startTime = startTime;
viewer.clock.stopTime = stopTime;
updatePoints(wayPoints);
``