1. A concise explanation of the problem you’re experiencing.
I’m trying to animate a model from one point to another using SamplePositionProperty. When the point moves to sampled point, the model disappears. What am I doing wrong?
private start = Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16));
private stop = Cesium.JulianDate.addSeconds(this.start, 360, new Cesium.JulianDate());
private time = Cesium.JulianDate.addSeconds(this.start, 2, new Cesium.JulianDate());
const secondsCounter = interval(6000);
secondsCounter.subscribe(n => {
const property = new Cesium.SampledPositionProperty();
property.forwardExtrapolationType = Cesium.ExtrapolationType.EXTRAPOLATE;
if (n % 3 === 0) {
property.addSample(this.time, Cesium.Cartesian3.fromDegrees(-105.145490, 38.728686));
this.entity.position = property;
} else {
this.entity.position = Cesium.Cartesian3.fromDegrees(-105.145852, 38.728107);
}
});
this.entity = cesiumViewer.entities.add({
name : url,
position : positionCartesian,
model : {
uri : url,
minimumPixelSize : 128,
maximumScale : 7,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
}
});
viewer setup:
const viewer = new Cesium.Viewer(this.el.nativeElement, {
animation: false,
fullscreenButton: false,
timeline: false,
geocoder: false,
homeButton: false,
sceneModePicker: false,
baseLayerPicker: true,
navigationHelpButton: false,
selectionIndicator: false,
infoBox: false,
terrainProvider : Cesium.createWorldTerrain(),
shouldAnimate: true
});