Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// snippet:vislib_hello_animation_example_2.ts
// let the camera float over the map, looking straight down
sampleMapView.camera.position.set(0, 0, 1000);
// center the camera somewhere around Berlin geo locations
sampleMapView.geoCenter = new GeoCoordinates(52.518611, 13.376111, 0);
// Let the camera look down at 45 degrees:
sampleMapView.camera.rotateX(MathUtils.degToRad(45));
// Instantiate the default map controls, allowing the user to pan around freely, even while
// the animation is running.
const controls = new MapControls(sampleMapView);
// Create a simple rotation to animate the scene:
const rotationAnimation = new CameraRotationAnimation(
sampleMapView,
controls,
{
repeat: Infinity,
duration: 30000
},
"rotationAnimation"
);
const updateHandler = () => {
if (rotationAnimation.isRunning) {
rotationAnimation.update();
}
};
// Do not start the animation before everything is loaded: