I have used SampledPositionProperty from my geojson data, to animate model with timeline/clock. Everything is working fine. Now I want to display model’s position, speed, altitude etc, and update on a UI, while model is animating with timeline/clock.
How would I get those variable from where?
computePath(geojson:any) {
let property = new Cesium.SampledPositionProperty();
for(let i = 0; i < geojson.features.length; i++) {
let feature = geojson.features[i];
let time = Cesium.JulianDate.fromDate( new Date( feature.properties.time ) );
let long = feature.geometry.coordinates[0];
let lat = feature.geometry.coordinates[1];
let altitude:number = feature.properties.Altitude;
let position = Cesium.Cartesian3.fromDegrees( long, lat, altitude );
property.addSample(time, position);
//Also create a point for each sample we generate.
let csvEntityPath = this.viewer.entities.add({
position: position,
point: {
pixelSize: 1,
color: Cesium.Color.TRANSPARENT,
outlineColor: Cesium.Color.YELLOW,
outlineWidth: 1,
},
});
this.csvEntityPath.push(csvEntityPath);
}
return property;
}
let csvEntity = this.viewer.entities.add({
//Use computed positions
position: property,
//Automatically compute orientation based on position movement.
orientation: new Cesium.VelocityOrientationProperty(property),
//Load the Cesium plane model to represent the entity
model: new Cesium.ModelGraphics(model),
});
csvEntity.position.setInterpolationOptions({
interpolationDegree: 5,
interpolationAlgorithm: Cesium.LagrangePolynomialApproximation,
});