How to use the @here/harp-geoutils.MathUtils.radToDeg function in @here/harp-geoutils

To help you get started, we’ve selected a few @here/harp-geoutils 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 / getting-started_free-camera.ts View on Github external
const applyTransformControls = () => {
                // Apply helper camera offset to main (map view) camera.
                this.mapView.camera.position.add(cameraRelativeToEye.position);
                // Make sure that pitch limit contraint is preserved
                const ypr = MapViewUtils.extractYawPitchRoll(cameraRelativeToEye.quaternion);
                ypr.pitch = Math.max(
                    Math.min(ypr.pitch, MathUtils.degToRad(this.mapControls.maxPitchAngle)),
                    0
                );
                // Finally apply rotation from transformation gizmo.
                this.mapControls.setRotation(
                    MathUtils.radToDeg(ypr.yaw),
                    MathUtils.radToDeg(ypr.pitch)
                );
                // Reset RTE camera orientation according to constraints applied.
                cameraRelativeToEye.copy(this.mapView.camera);
                // Reset RTE camera position to origin.
                cameraRelativeToEye.position.setScalar(0);
                transformControls.update();
            };
            applyTransformControls();
github heremaps / harp.gl / @here / harp-examples / src / getting-started_free-camera.ts View on Github external
const applyTransformControls = () => {
                // Apply helper camera offset to main (map view) camera.
                this.mapView.camera.position.add(cameraRelativeToEye.position);
                // Make sure that pitch limit contraint is preserved
                const ypr = MapViewUtils.extractYawPitchRoll(cameraRelativeToEye.quaternion);
                ypr.pitch = Math.max(
                    Math.min(ypr.pitch, MathUtils.degToRad(this.mapControls.maxPitchAngle)),
                    0
                );
                // Finally apply rotation from transformation gizmo.
                this.mapControls.setRotation(
                    MathUtils.radToDeg(ypr.yaw),
                    MathUtils.radToDeg(ypr.pitch)
                );
                // Reset RTE camera orientation according to constraints applied.
                cameraRelativeToEye.copy(this.mapView.camera);
                // Reset RTE camera position to origin.
                cameraRelativeToEye.position.setScalar(0);
                transformControls.update();
            };
            applyTransformControls();
github heremaps / harp.gl / @here / harp-mapview / lib / PolarTileDataSource.ts View on Github external
*/
    geometryLevelOffset?: number;

    /**
     * Enable debug display for generated tiles.
     * Default is false.
     */
    debugTiles?: boolean;
}

/**
 * [[DataSource]] providing geometry for poles
 */
export class PolarTileDataSource extends DataSource {
    private m_tilingScheme: TilingScheme = polarTilingScheme;
    private m_maxLatitude = MathUtils.radToDeg(MercatorConstants.MAXIMUM_LATITUDE);
    private m_geometryLevelOffset: number;
    private m_debugTiles: boolean;

    private m_styleSetEvaluator?: StyleSetEvaluator;
    private m_northPoleMaterial?: THREE.Material;
    private m_southPoleMaterial?: THREE.Material;

    constructor({
        name = "polar",
        styleSetName,
        minZoomLevel,
        maxZoomLevel,
        storageLevelOffset = -2,
        geometryLevelOffset = -1,
        debugTiles = false
    }: PolarTileDataSourceOptions) {