跳到主要内容

flywave-mapview.mapviewutils.setrotation

Home > @flywave/flywave-mapview > MapViewUtils > setRotation

MapViewUtils.setRotation() function

Sets the rotation of the camera according to yaw and pitch in degrees. The computations hinge on the current projection and geoCenter, because yaw and pitch are defined in tangent space. In particular, MapView#geoCenter needs to be set before calling setRotation.

**Note:** yaw == 0 && pitch == 0 will north up the map and you will look downwards onto the map.

Signature:

function setRotation(mapView: MapView, yawDeg: number, pitchDeg: number): void;

Parameters

Parameter

Type

Description

mapView

MapView

Instance of MapView.

yawDeg

number

Yaw in degrees, counter-clockwise (as opposed to azimuth), starting north.

pitchDeg

number

Pitch in degrees.

Returns:



void