Hi,
I’m trying to create a flight animation as per the Camera tutorial, but the call Cesium.CameraFlightPath.createAnimationCartographic() causes a TypeError in CameraFlightPath.js:553.
The error occurs in the follow bit of code, `projection’ is undefined so the getEllipsoid() call fails.
var projection = frameState.scene2D.projection;
if (frameState.mode === SceneMode.SCENE3D) {
var ellipsoid = projection.getEllipsoid();
My code is as follows. I am using Cesium build from the git repository rather than the b18 build.
“use strict”;
function flyToCoords( scene, coords ) {
console.log('scene: ’ + scene);
disableInput(scene); // function same as in Camera tutorial
var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
destination : destination,
onComplete : function() {
enableInput(scene); // function same as in Camera tutorial
}
});
scene.getAnimations().add(flight);
}
// Display default Cesium globe.
var widget = new Cesium.Viewer(‘cesiumContainer’);
// Load GeoJSON file.
var url = ‘P5_part.json’;
//renderGeoJson(widget, url);
// fly to polygon from geojson
var destination = Cesium.Cartographic.fromDegrees(101.685901, 2.906312, 500.0);
flyToCoords(widget.scene, destination);
Cheers,
Brendan