GoogleMaps3D Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Camera
struct Camera
extension Camera : AdditiveArithmetic, Animatable, Copyable, Equatable, Escapable, VectorArithmetic
The map camera position and orientation.
-
Declaration
Swift
static func * (lhs: Camera, rhs: Double) -> Camera
-
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
-
Adds two values and stores the result in the left-hand-side variable.
Declaration
Swift
static func += (lhs: inout Camera, rhs: Camera)
-
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
|
|
rhs
|
The value to subtract from lhs .
|
-
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
|
|
rhs
|
The value to subtract from lhs .
|
-
Declaration
Swift
static func / (lhs: Camera, rhs: Double) -> Camera
-
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
-
The type defining the data to animate.
Declaration
Swift
@available(watchOS, introduced: 6.0)
@available(macOS, introduced: 10.15)
@available(iOS, introduced: 13.0)
@available(tvOS, introduced: 13.0)
typealias AnimatableData = Camera
-
Declaration
Swift
var altitude: Double
-
Declaration
Swift
var animatableData: Camera { get set }
-
Declaration
Swift
var heading: Double
-
Declaration
Swift
init(latitude: Double, longitude: Double, altitude: Double = 0.0, heading: Double = 0.0, tilt: Double = 0.0, roll: Double = 0.0, range: Double = 1e5)
-
Declaration
Swift
var latitude: Double
-
Declaration
Swift
var longitude: Double
-
Returns the dot-product of this vector arithmetic instance with itself.
Declaration
Swift
var magnitudeSquared: Double { get }
-
-
-
Multiplies each component of this value by the given value.
Declaration
Swift
mutating func scale(by rhs: Double)
-
-
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 }
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[],[],null,["# GoogleMaps3D Framework Reference\n\nCamera\n======\n\n struct Camera\n\n extension Camera : AdditiveArithmetic, Animatable, Copyable, Equatable, Escapable, VectorArithmetic\n\nThe map camera position and orientation.\n- `\n ``\n ``\n `\n\n ### [*(_:_:)](#/s:12GoogleMaps3D6CameraV1moiyA2C_SdtFZ)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n static func * (lhs: Camera, rhs: Double) -\u003e Camera\n\n- `\n ``\n ``\n `\n\n ### [+(_:_:)](#/s:12GoogleMaps3D6CameraV1poiyA2C_ACtFZ)\n\n `\n ` \n Adds two values and produces their sum.\n\n The addition operator (`+`) calculates the sum of its two arguments. For\n example: \n\n 1 + 2 // 3\n -10 + 15 // 5\n -15 + -5 // -20\n 21.5 + 3.25 // 24.75\n\n You cannot use `+` with arguments of different types. To add values of\n different types, convert one of the values to the other value's type. \n\n let x: Int8 = 21\n let y: Int = 1000000\n Int(x) + y // 1000021\n\n #### Declaration\n\n Swift \n\n static func + (lhs: Camera, rhs: Camera) -\u003e Camera\n\n #### Parameters\n\n |-------------|--------------------------|\n | ` `*lhs*` ` | The first value to add. |\n | ` `*rhs*` ` | The second value to add. |\n\n- `\n ``\n ``\n `\n\n ### [+=(_:_:)](#/s:12GoogleMaps3D6CameraV2peoiyyACz_ACtFZ)\n\n `\n ` \n Adds two values and stores the result in the left-hand-side variable. \n\n #### Declaration\n\n Swift \n\n static func += (lhs: inout Camera, rhs: Camera)\n\n #### Parameters\n\n |-------------|--------------------------|\n | ` `*lhs*` ` | The first value to add. |\n | ` `*rhs*` ` | The second value to add. |\n\n- `\n ``\n ``\n `\n\n ### [-(_:_:)](#/s:12GoogleMaps3D6CameraV1soiyA2C_ACtFZ)\n\n `\n ` \n Subtracts one value from another and produces their difference.\n\n The subtraction operator (`-`) calculates the difference of its two\n arguments. For example: \n\n 8 - 3 // 5\n -10 - 5 // -15\n 100 - -5 // 105\n 10.5 - 100.0 // -89.5\n\n You cannot use `-` with arguments of different types. To subtract values\n of different types, convert one of the values to the other value's type. \n\n let x: UInt8 = 21\n let y: UInt = 1000000\n y - UInt(x) // 999979\n\n #### Declaration\n\n Swift \n\n static func - (lhs: Camera, rhs: Camera) -\u003e Camera\n\n #### Parameters\n\n |-------------|-----------------------------------|\n | ` `*lhs*` ` | A numeric value. |\n | ` `*rhs*` ` | The value to subtract from `lhs`. |\n\n- `\n ``\n ``\n `\n\n ### [-=(_:_:)](#/s:12GoogleMaps3D6CameraV2seoiyyACz_ACtFZ)\n\n `\n ` \n Subtracts the second value from the first and stores the difference in the\n left-hand-side variable. \n\n #### Declaration\n\n Swift \n\n static func -= (lhs: inout Camera, rhs: Camera)\n\n #### Parameters\n\n |-------------|-----------------------------------|\n | ` `*lhs*` ` | A numeric value. |\n | ` `*rhs*` ` | The value to subtract from `lhs`. |\n\n- `\n ``\n ``\n `\n\n ### [/(_:_:)](#/s:12GoogleMaps3D6CameraV1doiyA2C_SdtFZ)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n static func / (lhs: Camera, rhs: Double) -\u003e Camera\n\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:12GoogleMaps3D6CameraV2eeoiySbAC_ACtFZ)\n\n `\n ` \n Returns a Boolean value indicating whether two values are equal.\n\n Equality is the inverse of inequality. For any values `a` and `b`,\n `a == b` implies that `a != b` is `false`. \n\n #### Declaration\n\n Swift \n\n static func == (a: Camera, b: Camera) -\u003e Bool\n\n- `\n ``\n ``\n `\n\n ### [AnimatableData](#/s:12GoogleMaps3D6CameraV14AnimatableDataa)\n\n `\n ` \n The type defining the data to animate. \n\n #### Declaration\n\n Swift \n\n @available(watchOS, introduced: 6.0)\n @available(macOS, introduced: 10.15)\n @available(iOS, introduced: 13.0)\n @available(tvOS, introduced: 13.0)\n typealias AnimatableData = Camera\n\n- `\n ``\n ``\n `\n\n ### [altitude](#/s:12GoogleMaps3D6CameraV8altitudeSdvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var altitude: Double\n\n- `\n ``\n ``\n `\n\n ### [animatableData](#/s:12GoogleMaps3D6CameraV14animatableDataACvp)\n\n `\n ` \n The data to animate. \n\n #### Declaration\n\n Swift \n\n var animatableData: Camera { get set }\n\n- `\n ``\n ``\n `\n\n ### [heading](#/s:12GoogleMaps3D6CameraV7headingSdvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var heading: Double\n\n- `\n ``\n ``\n `\n\n ### [init(latitude:longitude:altitude:heading:tilt:roll:range:)](#/s:12GoogleMaps3D6CameraV8latitude9longitude8altitude7heading4tilt4roll5rangeACSd_S6dtcfc)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n init(latitude: Double, longitude: Double, altitude: Double = 0.0, heading: Double = 0.0, tilt: Double = 0.0, roll: Double = 0.0, range: Double = 1e5)\n\n- `\n ``\n ``\n `\n\n ### [latitude](#/s:12GoogleMaps3D6CameraV8latitudeSdvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var latitude: Double\n\n- `\n ``\n ``\n `\n\n ### [longitude](#/s:12GoogleMaps3D6CameraV9longitudeSdvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var longitude: Double\n\n- `\n ``\n ``\n `\n\n ### [magnitudeSquared](#/s:12GoogleMaps3D6CameraV16magnitudeSquaredSdvp)\n\n `\n ` \n Returns the dot-product of this vector arithmetic instance with itself. \n\n #### Declaration\n\n Swift \n\n var magnitudeSquared: Double { get }\n\n- `\n ``\n ``\n `\n\n ### [range](#/s:12GoogleMaps3D6CameraV5rangeSdvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var range: Double\n\n- `\n ``\n ``\n `\n\n ### [roll](#/s:12GoogleMaps3D6CameraV4rollSdvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var roll: Double\n\n- `\n ``\n ``\n `\n\n ### [scale(by:)](#/s:12GoogleMaps3D6CameraV5scale2byySd_tF)\n\n `\n ` \n Multiplies each component of this value by the given value. \n\n #### Declaration\n\n Swift \n\n mutating func scale(by rhs: Double)\n\n- `\n ``\n ``\n `\n\n ### [tilt](#/s:12GoogleMaps3D6CameraV4tiltSdvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n var tilt: Double\n\n- `\n ``\n ``\n `\n\n ### [zero](#/s:12GoogleMaps3D6CameraV4zeroACvpZ)\n\n `\n ` \n The zero value.\n\n Zero is the identity element for addition. For any value,\n `x + .zero == x` and `.zero + x == x`. \n\n #### Declaration\n\n Swift \n\n static var zero: Camera { get }"]]