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

<br />

You may want to create latitude and longitude boundaries that restrict a user's
movement in a 3D map, or to limit the camera's altitude, heading, or tilt. You
can do this by configuring map and camera restrictions.

![A map view showing camera controls restrictions](https://developers.google.com/static/maps/documentation/maps-3d/ios-sdk/images/camera-restrictions.png)

The following code sample demonstrates how to use the
[`Map.cameraRestrictions`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Extensions/View.md.txt#camerarestrictions_:)
method to restrict both the geographical boundaries of the camera and the
values of the camera's altitude, heading, and tilt.

```swift
struct CameraRestrictionDemo: View {
  var body: some View {
    Map(
      initialCamera: .init(center: .init(latitude: 37.7749, longitude: -122.4194)),
      mode: .hybrid
    )
    .cameraRestrictions([
      .bounds(.init(latitude: 37.70...37.83, longitude: (-122.52)...(-122.35))),
      .altitude(500...10000),
      .heading(0...180),
      .tilt(0...60)
    ])
  }
}
```