Camera

public class Camera implements Parcelable


Camera class to represent the camera view in a 3D map.

Summary

Constants

static final Parcelable.Creator<Camera>
static final Camera

Public constructors

Camera(
    LatLngAltitude center,
    @Nullable Double heading,
    @Nullable Double tilt,
    @Nullable Double roll,
    @Nullable Double range
)

Constructor for Camera with parameters for required fields.

Public methods

LatLngAltitude

Gets the point in space that the camera is observing or focused upon.

@Nullable Double

Gets the heading of the camera in degrees.

@Nullable Double

Gets the range of the camera in meters.

@Nullable Double

Gets the roll of the camera in degrees.

@Nullable Double

Gets the tilt of the camera in degrees.

void

Sets the center of the camera.

void

Sets the heading of the camera.

void

Sets the range of the camera.

void

Sets the roll of the camera.

void

Sets the tilt of the camera.

void
writeToParcel(Parcel dest, int flags)

Extension functions

final void

Validates a specified Camera object.

Inherited Constants

From android.os.Parcelable
static final int
static final int

Inherited methods

From android.os.Parcelable
abstract int

Constants

CREATOR

public static final Parcelable.Creator<CameraCREATOR

DEFAULT_CAMERA

public static final Camera DEFAULT_CAMERA

Public fields

center

public LatLngAltitude center

heading

public @Nullable Double heading

range

public @Nullable Double range

roll

public @Nullable Double roll

tilt

public @Nullable Double tilt

Public constructors

Camera

public Camera(
    LatLngAltitude center,
    @Nullable Double heading,
    @Nullable Double tilt,
    @Nullable Double roll,
    @Nullable Double range
)

Constructor for Camera with parameters for required fields.

Parameters
LatLngAltitude center

The center of the camera.

@Nullable Double heading

The heading of the camera.

@Nullable Double tilt

The tilt of the camera.

@Nullable Double roll

The roll of the camera.

@Nullable Double range

The range of the camera.

Public methods

getCenter

public LatLngAltitude getCenter()

Gets the point in space that the camera is observing or focused upon. The camera's actual position is determined relative to this center point using parameters like heading, tilt, roll, and range.

getHeading

public @Nullable Double getHeading()

Gets the heading of the camera in degrees. Heading represents the bearing along which the camera will look towards the getCenter point. A heading of 0 degrees is North, and 90 degrees is East.

Returns
@Nullable Double

The heading of the camera, in degrees, or null if not set.

getRange

public @Nullable Double getRange()

Gets the range of the camera in meters. Range represents the straight-line distance in meters from the camera's position to the getCenter point. This parameter controls how far the camera is positioned from the point it is observing.

Returns
@Nullable Double

The range of the camera, in meters, or null if not set.

getRoll

public @Nullable Double getRoll()

Gets the roll of the camera in degrees. Roll represents the rotation of the camera around its own viewing axis (the line from the camera position to the getCenter point). A roll of 0 degrees means the camera is level with respect to the 'up' direction defined by the map's coordinate system at the center point.

Returns
@Nullable Double

The roll of the camera, in degrees, or null if not set.

getTilt

public @Nullable Double getTilt()

Gets the tilt of the camera in degrees. Tilt represents the angle of the camera relative to the horizontal plane at the getCenter point. A tilt of 0 degrees means the camera is looking straight down towards the center. Increasing tilt values represent looking less steeply downwards (e.g., a tilt of 90 degrees would be looking horizontally if the camera position were at the same altitude as the center).

Returns
@Nullable Double

The tilt of the camera, in degrees, or null if not set.

setCenter

public void setCenter(LatLngAltitude center)

Sets the center of the camera.

Parameters
LatLngAltitude center

The center of the camera.

setHeading

public void setHeading(@Nullable Double heading)

Sets the heading of the camera.

Parameters
@Nullable Double heading

The heading of the camera.

setRange

public void setRange(@Nullable Double range)

Sets the range of the camera.

Parameters
@Nullable Double range

The range of the camera.

setRoll

public void setRoll(@Nullable Double roll)

Sets the roll of the camera.

Parameters
@Nullable Double roll

The roll of the camera.

setTilt

public void setTilt(@Nullable Double tilt)

Sets the tilt of the camera.

Parameters
@Nullable Double tilt

The tilt of the camera.

writeToParcel

public void writeToParcel(Parcel dest, int flags)

Extension functions

ValidatorsKt.validate

public final void ValidatorsKt.validate(@NonNull Camera receiver)

Validates a specified Camera object.

Throws
java.lang.IllegalArgumentException

If the Camera is not valid.