How to use the @here/harp-map-controls.CameraRotationAnimation function in @here/harp-map-controls

To help you get started, we’ve selected a few @here/harp-map-controls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / @here / harp-examples / src / performance_animation.ts View on Github external
// 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:

@here/harp-map-controls

Camera controller which implements a common default set of camera functionality in a map context.

Apache-2.0
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages