How to use the @here/harp-mapview.MapViewUtils.panCameraAroundGlobe 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-map-controls / lib / MapControls.ts View on Github external
(this.m_currentPanDistanceOrAngleIndex + 1) % USER_INPUTS_TO_CONSIDER;
            this.m_recentPanDistancesOrAngles[
                this.m_currentPanDistanceOrAngleIndex
            ] = panDistanceOrAngle;
            this.m_lastAveragedPanDistanceOrAngle =
                this.m_recentPanDistancesOrAngles.reduce((a, b) => a + b) / USER_INPUTS_TO_CONSIDER;
        }

        if (this.mapView.projection.type === geoUtils.ProjectionType.Planar) {
            MapViewUtils.panCameraAboveFlatMap(
                this.mapView,
                this.m_panDistanceFrameDelta.x,
                this.m_panDistanceFrameDelta.y
            );
        } else if (this.mapView.projection.type === geoUtils.ProjectionType.Spherical) {
            MapViewUtils.panCameraAroundGlobe(
                this.mapView,
                this.m_lastRotateGlobeFromVector,
                this.m_tmpVector3
                    .copy(this.m_lastRotateGlobeFromVector)
                    .applyQuaternion(this.m_rotateGlobeQuaternion)
            );
        }
        if (!applyInertia) {
            this.m_panDistanceFrameDelta.set(0, 0, 0);
            this.m_lastRotateGlobeAngle = 0;
        }

        this.updateMapView();
    }