Select platform: [Android](https://developers.google.com/maps/documentation/maps-3d/android-sdk/configure-camera-controls.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/configure-camera-controls.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/3d/map-controls.md.txt "View this page for the JavaScript platform docs.")

<br />

Users can control the zoom, tilt, position, and rotation of the camera using
gestures on the map. You can also configure the camera programmatically.

![Diagram illustrating the 3D camera model](https://developers.google.com/static/maps/documentation/maps-3d/images/maps-3d-sdk-camera-diagram.png)

## The Camera Position

The map view is modeled as a camera looking at a specific point in space. The
position and orientation of the camera are defined by
latitude/longitude/altitude coordinates (defined
as the "center", where the camera is pointing), heading, tilt, range,
and roll.

### Center (latitude, longitude, altitude)

The **center** defines the specific point in 3D space that the camera is
observing. This is specified using the
[`LatLngAltitude`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/LatLngAltitude.md.txt)
class, which combines values for latitude, longitude, and altitude. This lets
you position the camera's focal point in three dimensions.

The latitude can be between -90 and 90 degrees, inclusive. Longitude
ranges between -180 and 180 degrees, inclusive. Altitude is specified in meters,
and how the altitude is interpreted is determined by the camera's
[`altitudeMode`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera.md.txt#altitudeMode())
([`AltitudeMode.ABSOLUTE`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode.md.txt#ABSOLUTE())
by default,
[`AltitudeMode.RELATIVE_TO_GROUND`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode.md.txt#RELATIVE_TO_GROUND()),
or
[`AltitudeMode.RELATIVE_TO_MESH`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/AltitudeMode.md.txt#RELATIVE_TO_MESH())).

### Heading

The **heading** specifies the compass direction of the map, measured in degrees
clockwise from true North. North corresponds to 0 degrees, East to 90 degrees,
South to 180 degrees, and West to 270 degrees.

### Tilt

The **tilt** specifies the angle of the camera with respect to the vertical
axis, measured in degrees. A tilt of 0 degrees means the camera is pointing
straight down towards the Earth (
[nadir](https://en.wikipedia.org/wiki/Nadir)). A tilt of 90 degrees
means the camera is pointed horizontally in the direction specified by the
[heading](https://developers.google.com/maps/documentation/maps-3d/android-sdk/configure-camera-controls.md.txt#heading_orientation).

### Range

The **range** defines the distance in meters between the camera's own position
and the center of the map. The range can vary from zero meters (very close up)
up to sixty-three million meters, allowing for views from very close up all the
way to a truly global perspective. This effectively controls how "zoomed in" or
"zoomed out" the map appears.

### Roll

The **roll** sets the angle of the camera with respect to the horizon, measured
in degrees. This parameter can be used to create effects like banking during
flight simulations or even a full barrel roll, rotating the camera around its
viewing axis.

## Controlling the camera

The following code sample demonstrates how to control the [`Camera`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/model/Camera.md.txt) programmatically by calling the [`setCamera`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/GoogleMap3D.md.txt#setCamera(com.google.android.gms.maps3d.model.Camera)) method on [`GoogleMap3D`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/GoogleMap3D.md.txt). To use this code sample, follow the instructions in [Setup](https://developers.google.com/maps/documentation/maps-3d/android-sdk/setup.md.txt) and [Add a 3D map to your
app](https://developers.google.com/maps/documentation/maps-3d/android-sdk/add-a-3d-map) to set up your Android Studio project with a basic 3D map. Then, add the following code to the **`MainActivity.kt`** file:

<br />

> [!NOTE]
> **Note:** `AltitudeMode` can only be used by `flyTo` and `flyAround`. Setting `AltitudeMode` in the `camera` will have no effect on how altitude is interpreted. `setCamera` always interprets `altitudeMode` as `ABSOLUTE`.

```kotlin

// Add imports
import com.google.android.gms.maps3d.model.Map3DMode
import com.google.android.gms.maps3d.model.camera
import com.google.android.gms.maps3d.model.latLngAltitude

// Add to the onMap3DViewReady method, after the googleMap3D object has been initialized
googleMap3D.setMapMode(Map3DMode.HYBRID)
googleMap3D.setCamera(
    camera {
        center = latLngAltitude {
            latitude = 38.743502
            longitude = -109.499374
            altitude = 1467.0
        }
        heading = 350.0
        tilt = 58.1
        range = 138.2
        roll = 0.0
    }
)

```

## UI controls

In addition to standard gestures, the Maps 3D SDK for Android also provides UI controls
for manipulating the position of the camera.

- The **Zoom control** displays "+" and "-" buttons for changing the zoom level of the map.
- The **Move control** displays "←", "→", "↑", and "↓" buttons for changing the center of the map.
- The **Rotate controls** displays "↺" and "↻" to change the camera's heading.
- The **Tilt control** displays "\^" and "⌄" to change the camera's tilt.
- The **Compass control** indicates the direction of compass north, and allows for resetting the camera to a northerly heading.

The following code sample shows how to change the visibility of the UI controls:

### Kotlin

```kotlin

// Add imports
import com.google.android.gms.maps3d.UiControlSettings
import com.google.android.gms.maps3d.model.CompassControl
import com.google.android.gms.maps3d.model.TiltControl
import com.google.android.gms.maps3d.model.ZoomControl

...

val uiControlSettings = googleMap3D.getUiControlSettings()

// Show UI controls on the trailing edge of the map
uiControlSettings?.setUiControlsPlacement(
    listOf(CompassControl(), ZoomControl(), TiltControl()),
    UiControlSettings.ControlPlacement.TRAILING
)

// Hide UI controls on the trailing edge of the map
uiControlSettings?.setUiControlsPlacement(
    emptyList(),
    UiControlSettings.ControlPlacement.TRAILING
)

```