# Camera

    struct Camera

    extension Camera : AdditiveArithmetic, Animatable, Copyable, Equatable, Escapable, VectorArithmetic

The map camera position and orientation.

**Usage with the map:**

    // Usage with an initial camera configuration
    Map(
      initialCamera: Camera(center: LatLngAltitude(latitude: 37.7749, longitude: -122.4194, altitude: 0)),
      mode: .hybrid
    )

    // Usage with a camera binding
    @State private var camera = Camera(center: LatLngAltitude(latitude: 37.7749, longitude: -122.4194, altitude: 0))
    Map(camera: $camera, mode: .hybrid)

**Usage with fly animations:**

    struct FlyAnimationExample: View {
      @State private var animationTrigger = 0
      let targetCamera = Camera(center: LatLngAltitude(latitude: 37.7749, longitude: -122.4194, altitude: 0))

      var body: some View {
        Map(mode: .hybrid)
          .flyCameraTo(targetCamera, trigger: animationTrigger)
          .flyCameraAround(targetCamera, trigger: animationTrigger)
      }
    }

- `


  ### [\*(_:_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV1moiyA2C_SdtFZ)


  `

  #### Declaration

  Swift

      static func * (lhs: Camera, rhs: Double) -> Camera

- `


  ### [+(_:_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV1poiyA2C_ACtFZ)


  ` Adds two values and produces their sum.

  The addition operator (`+`) calculates the sum of its two arguments. For
  example:

      1 + 2                   // 3
      -10 + 15                // 5
      -15 + -5                // -20
      21.5 + 3.25             // 24.75

  You cannot use `+` with arguments of different types. To add values of
  different types, convert one of the values to the other value's type.

      let x: Int8 = 21
      let y: Int = 1000000
      Int(x) + y              // 1000021

  #### Declaration

  Swift

      static func + (lhs: Camera, rhs: Camera) -> Camera

  #### Parameters

  |---|---|
  | ` lhs ` | The first value to add. |
  | ` rhs ` | The second value to add. |

- `


  ### [+=(_:_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV2peoiyyACz_ACtFZ)


  ` Adds two values and stores the result in the left-hand-side variable.

  #### Declaration

  Swift

      static func += (lhs: inout Camera, rhs: Camera)

  #### Parameters

  |---|---|
  | ` lhs ` | The first value to add. |
  | ` rhs ` | The second value to add. |

- `


  ### [-(_:_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV1soiyA2C_ACtFZ)


  ` Subtracts one value from another and produces their difference.

  The subtraction operator (`-`) calculates the difference of its two
  arguments. For example:

      8 - 3                   // 5
      -10 - 5                 // -15
      100 - -5                // 105
      10.5 - 100.0            // -89.5

  You cannot use `-` with arguments of different types. To subtract values
  of different types, convert one of the values to the other value's type.

      let x: UInt8 = 21
      let y: UInt = 1000000
      y - UInt(x)             // 999979

  #### Declaration

  Swift

      static func - (lhs: Camera, rhs: Camera) -> Camera

  #### Parameters

  |---|---|
  | ` lhs ` | A numeric value. |
  | ` rhs ` | The value to subtract from `lhs`. |

- `


  ### [-=(_:_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV2seoiyyACz_ACtFZ)


  ` Subtracts the second value from the first and stores the difference in the
  left-hand-side variable.

  #### Declaration

  Swift

      static func -= (lhs: inout Camera, rhs: Camera)

  #### Parameters

  |---|---|
  | ` lhs ` | A numeric value. |
  | ` rhs ` | The value to subtract from `lhs`. |

- `


  ### [/(_:_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV1doiyA2C_SdtFZ)


  `

  #### Declaration

  Swift

      static func / (lhs: Camera, rhs: Double) -> Camera

- `


  ### [==(_:_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV2eeoiySbAC_ACtFZ)


  ` Returns a Boolean value indicating whether two values are equal.

  Equality is the inverse of inequality. For any values `a` and `b`,
  `a == b` implies that `a != b` is `false`.

  #### Declaration

  Swift

      static func == (a: Camera, b: Camera) -> Bool

- `


  ### [AnimatableData](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV14AnimatableDataa)


  ` The type defining the data to animate.

  #### Declaration

  Swift

      typealias AnimatableData = Camera

- `


  ### [altitudeMode](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV12altitudeModeAA08AltitudeE0Ovp)


  `

  #### Declaration

  Swift

      var altitudeMode: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Enums/AltitudeMode.html

- `


  ### [animatableData](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV14animatableDataACvp)


  ` The data to animate.

  #### Declaration

  Swift

      var animatableData: Camera { get set }

- `


  ### [center](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV6centerAA14LatLngAltitudeVvp)


  `

  #### Declaration

  Swift

      var center: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/LatLngAltitude.html

- `


  ### [fieldOfView](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV11fieldOfView7SwiftUI5AngleVvp)


  `

  #### Declaration

  Swift

      var fieldOfView: Angle { get set }

- `


  ### [heading](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV7headingSdvp)


  `

  #### Declaration

  Swift

      var heading: Double

- `


  ### [init(center:heading:tilt:roll:range:fieldOfView:altitudeMode:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV6center7heading4tilt4roll5range11fieldOfView12altitudeModeAcA14LatLngAltitudeV_S4d7SwiftUI5AngleVAA0pM0Otcfc)


  ` Creates a camera with the specified position and orientation.

  #### Declaration

  Swift

      init(center: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/LatLngAltitude.html, heading: Double = 0.0, tilt: Double = 0.0, roll: Double = 0.0, range: Double = 1e5, fieldOfView: Angle = .degrees(35.0), altitudeMode: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Enums/AltitudeMode.html = .absolute)

  #### Parameters

  |---|---|
  | ` center ` | The center coordinate of the camera. |
  | ` heading ` | The heading of the camera in degrees. |
  | ` tilt ` | The tilt of the camera in degrees. |
  | ` roll ` | The roll of the camera in degrees. |
  | ` range ` | The distance from the camera to the center coordinate in meters. |
  | ` fieldOfView ` | The field of view of the camera. |
  | ` altitudeMode ` | The altitude mode of the camera. Note that `https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera.html#/s:12GoogleMaps3D6CameraV12altitudeModeAA08AltitudeE0Ovp` is only relevant for `flyCameraTo` and `flyCameraAround` animations. |

- `


  ### [magnitudeSquared](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV16magnitudeSquaredSdvp)


  ` Returns the dot-product of this vector arithmetic instance with itself.

  #### Declaration

  Swift

      var magnitudeSquared: Double { get }

- `


  ### [range](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV5rangeSdvp)


  `

  #### Declaration

  Swift

      var range: Double

- `


  ### [roll](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV4rollSdvp)


  `

  #### Declaration

  Swift

      var roll: Double

- `


  ### [scale(by:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV5scale2byySd_tF)


  ` Multiplies each component of this value by the given value.

  #### Declaration

  Swift

      mutating func scale(by rhs: Double)

- `


  ### [tilt](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV4tiltSdvp)


  `

  #### Declaration

  Swift

      var tilt: Double

- `


  ### [zero](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Camera#/s:12GoogleMaps3D6CameraV4zeroACvpZ)


  ` The zero value.

  Zero is the identity element for addition. For any value,
  `x + .zero == x` and `.zero + x == x`.

  #### Declaration

  Swift

      static var zero: Camera { get }