Home > @magiclane/maps-sdk > MapCamera > setCameraTargetCentered

MapCamera.setCameraTargetCentered() method

Sets the camera to look toward a target position, all in the coordinate system of the focused sphere.

Target coordinates are longitude, latitude position in degrees, with respect to the focused sphere surface, altitude in meters above the sphere (sea level).

The camera is centered on the target, at the specified distance in meters from the target, heading (0=N, 90=E, 180=S, 270=W) with respect to the focused sphere, and pitch (0=looking toward the target center from above the target, 90=looking at the target center from the horizontal plane/equator of the target, which is the plane containing the target forward and right vectors). The roll is always 0, so the horizon is level.

Signature:

setCameraTargetCentered(coords: Coordinates, pos: Point3d): void;

Parameters

Parameter

Type

Description

coords

Coordinates

Coordinates representing the desired latitude, longitude and altitude.

pos

Point3d

Point3d representing the desired heading, pitch and distance.

Returns:

void

Exceptions

An exception if it fails.