Like given example, we created a kml file with gx:Track , then use following codes:
viewer.dataSources.add(Cesium.KmlDataSource.load(‘kml file’, options)).then(function(dataSource)
{
kmldh=dataSource;
viewer.clock.shouldAnimate = false;
var rider = dataSource.entities.getById(‘tour’);
viewer.zoomTo(rider).then(function(){
//viewer.trackedEntity = rider;
//viewer.selectedEntity = rider;
viewer.clock.multiplier = 0.3;
viewer.clock.shouldAnimate = true;
viewer.clock.clockRange=Cesium.ClockRange.LOOP_STOP;
});
});
kmldh is a function for a button.
We hit the button, track is on, but the camera is fixed on a default angle, so we remove viewer.trackedEntity and viewer.selectedEntity to move camera freely, still not convenient.
How to change this default camera angle?
Could it be something like viewer.camera.flyTo that we could set our own orientation for a better view?
Further more, when and only when the track is on, it became extremely lag, only 4 fps. and it’s impossible to move camera where you like.
After we have another button to remove this dataSource, it’ll go back to 60 fps.
Any ideas?
Thank you.