# Camera


```
public class Camera implements Parcelable
```

<br />

*** ** * ** ***

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

## Summary

| ### Constants |
|---|---|
| `static final https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#DEFAULT_CAMERA()` |

| ### Public fields |
|---|---|
| `int` | `@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#altitudeMode()` |
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#center()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#heading()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#range()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#roll()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#tilt()` |

| ### Public constructors |
|---|
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#Camera(com.google.android.gms.maps3d.model.LatLngAltitude,java.lang.Double,java.lang.Double,java.lang.Double,java.lang.Double)( https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude center, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html heading, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html tilt, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html roll, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html range )` Constructor for Camera with parameters for required fields. |
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#Camera(com.google.android.gms.maps3d.model.LatLngAltitude,java.lang.Double,java.lang.Double,java.lang.Double,java.lang.Double,int)( https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude center, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html heading, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html tilt, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html roll, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html range, @https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int altitudeMode )` Constructor for Camera with parameters for all fields. |

| ### Public methods |
|---|---|
| `boolean` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Object.html o)` |
| `int` | `@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getAltitudeMode()()` Gets the altitude mode of the camera. |
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getCenter()()` Gets the point in space that the camera is observing or focused upon. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getHeading()()` Gets the heading of the camera in degrees. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getRange()()` Gets the range of the camera in meters. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getRoll()()` Gets the roll of the camera in degrees. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getTilt()()` Gets the tilt of the camera in degrees. |
| `int` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#hashCode()()` |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#setAltitudeMode(int)(@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int altitudeMode)` Sets the altitude mode of the camera. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#setCenter(com.google.android.gms.maps3d.model.LatLngAltitude)(https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude center)` Sets the center of the camera. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#setHeading(java.lang.Double)(@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html heading)` Sets the heading of the camera. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#setRange(java.lang.Double)(@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html range)` Sets the range of the camera. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#setRoll(java.lang.Double)(@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html roll)` Sets the roll of the camera. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#setTilt(java.lang.Double)(@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html tilt)` Sets the tilt of the camera. |
| `void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#writeToParcel(android.os.Parcel,int)(https://developer.android.com/reference/android/os/Parcel.html dest, int flags)` |

| ### Extension functions |
|---|---|
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/ValidatorsKt.https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#(com.google.android.gms.maps3d.model.Camera).validate()(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera receiver)` Validates a specified `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera` object. |

### Inherited Constants

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `static final int` `https://developer.android.com/reference/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR = 1` `static final int` `https://developer.android.com/reference/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE = 1`

### Inherited methods

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `abstract int` `https://developer.android.com/reference/android/os/Parcelable.html#describeContents()()`

## Constants

### DEFAULT_CAMERA

```
public static final Camera DEFAULT_CAMERA
```

## Public fields

### altitudeMode

```
@AltitudeMode
public int altitudeMode
```

### 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. The altitude mode is set to ABSOLUTE by default.

| Parameters |
|---|---|
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude center` | The center of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html heading` | The heading of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html tilt` | The tilt of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html roll` | The roll of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html range` | The range of the camera. |

### Camera

```
public Camera(
    LatLngAltitude center,
    @Nullable Double heading,
    @Nullable Double tilt,
    @Nullable Double roll,
    @Nullable Double range,
    @AltitudeMode int altitudeMode
)
```

Constructor for Camera with parameters for all fields.

| Parameters |
|---|---|
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude center` | The center of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html heading` | The heading of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html tilt` | The tilt of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html roll` | The roll of the camera. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html range` | The range of the camera. |
| `@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int altitudeMode` | The altitude mode of the camera. This parameter is optional and if not provided, the default value is `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode#ABSOLUTE()`. See `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode` for possible values. |

## Public methods

### equals

```
public boolean equals(@Nullable Object o)
```

### getAltitudeMode

```
@AltitudeMode
public int getAltitudeMode()
```

Gets the altitude mode of the camera. The altitude mode determines how the altitude of the camera is interpreted. It can be either one of the values in `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode` enum:

- `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode#ABSOLUTE()`
- `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode#RELATIVE_TO_GROUND()`
- `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode#RELATIVE_TO_MESH()`

If the altitude mode is not set, the default value is `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode#ABSOLUTE()`.

| Returns |
|---|---|
| `int` | The altitude mode of the camera. |

### 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 `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getCenter()` point. A heading of 0 degrees is North, and 90 degrees is East.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | 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 `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#getCenter()` point. This parameter controls how far the camera is positioned from the point it is observing.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | 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 `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | 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 `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera#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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html` | The tilt of the camera, in degrees, or `null` if not set. |

### hashCode

```
public int hashCode()
```

### setAltitudeMode

```
public void setAltitudeMode(@AltitudeMode int altitudeMode)
```

Sets the altitude mode of the camera.

| Parameters |
|---|---|
| `@https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode int altitudeMode` | The altitude mode of the camera. |

### setCenter

```
public void setCenter(LatLngAltitude center)
```

Sets the center of the camera.

| Parameters |
|---|---|
| `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude center` | The center of the camera. |

### setHeading

```
public void setHeading(@Nullable Double heading)
```

Sets the heading of the camera.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html heading` | The heading of the camera. |

### setRange

```
public void setRange(@Nullable Double range)
```

Sets the range of the camera.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html range` | The range of the camera. |

### setRoll

```
public void setRoll(@Nullable Double roll)
```

Sets the roll of the camera.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html roll` | The roll of the camera. |

### setTilt

```
public void setTilt(@Nullable Double tilt)
```

Sets the tilt of the camera.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/Double.html 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 `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera` object.

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera` is not valid. |