How to use the @here/harp-mapview.MapViewUtils.getCameraPositionFromTargetCoordinates function in @here/harp-mapview

To help you get started, we’ve selected a few @here/harp-mapview 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 / threejs_camera-animation.ts View on Github external
function startTransition(mapView: MapView, location: Location) {
        const startPosition = mapView.camera.position.clone();
        const startQuaternion = mapView.camera.quaternion.clone();
        const targetPosition = MapViewUtils.getCameraPositionFromTargetCoordinates(
            location.target,
            location.distance,
            location.heading,
            location.tilt,
            mapView.projection
        );

        const targetQuaternion = MapViewUtils.getCameraRotationAtTarget(
            mapView.projection,
            location.target,
            location.heading,
            location.tilt
        );

        const startTime = Date.now();
        const curve = new THREE.CatmullRomCurve3([startPosition, targetPosition]);
github heremaps / harp.gl / @here / harp-examples / src / threejs_add-text.ts View on Github external
function startTransition(
        mapView: MapView,
        target: GeoCoordinates,
        tilt: number,
        azimuth: number,
        distance: number
    ) {
        const startPosition = mapView.camera.position.clone();
        const startQuaternion = mapView.camera.quaternion.clone();
        const targetPosition = MapViewUtils.getCameraPositionFromTargetCoordinates(
            target,
            distance,
            azimuth,
            tilt,
            mapView.projection
        );

        const targetQuaternion = MapViewUtils.getCameraRotation(
            mapView.projection,
            target,
            azimuth,
            tilt
        );

        const startTime = Date.now();
github heremaps / harp.gl / @here / harp-examples / src / threejs_add-text.ts View on Github external
function setLocation(
        mapView: MapView,
        target: GeoCoordinates,
        tilt: number,
        azimuth: number,
        distance: number
    ) {
        MapViewUtils.getCameraPositionFromTargetCoordinates(
            target,
            distance,
            0,
            0,
            mapView.projection,
            mapView.camera.position
        );

        MapViewUtils.getCameraRotation(
            mapView.projection,
            target,
            azimuth,
            tilt,
            mapView.camera.quaternion
        );
    }