GoogleMaps3D Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
CameraRestriction
Represents various constraints that can be applied to the camera’s position
or orientation.
Use these cases to define limits on camera properties like altitude, heading, tilt,
or geographical bounds, often used to guide user interaction or enforce
specific viewing perspectives within a map or scene view.
-
Restricts the camera’s altitude (height above ground or sea level).
Note
If you attempt to set a value less than 0.0
, it will be clamped to 0.0
.
If you attempt to set a value greater than 63170000.0
, it will be clamped to 63170000.0
.
Declaration
Swift
case altitude(any RangeExpression<Double>)
-
When set, restricts the position of the camera within the specified lat/lng bounds. Note that
objects outside the bounds are still rendered. Bounds can restrict both longitude and
latitude, or can restrict either latitude or longitude only. For latitude-only bounds use
longitude range of (-180.0)...180
. For longitude-only bounds use latitude range of
-(90)...90
`.
Declaration
Swift
case bounds(latitude: ClosedRange<Double>, longitude: ClosedRange<Double>)
-
Restricts the camera’s heading (horizontal direction or azimuth).
Note
If you attempt to set a value less than 0.0
, it will be clamped to 0.0
.
If you attempt to set a value greater than 360.0
, it will be clamped to 360.0
.
Declaration
Swift
case heading(any RangeExpression<Double>)
-
Restricts the camera’s tilt (pitch angle relative to the horizon).
A tilt of 0 typically means looking straight down, while 90 might represent
looking towards the horizon, depending on the specific camera system’s convention.
Note
If you attempt to set a value less than 0.0
, it will be clamped to 0.0
.
If you attempt to set a value greater than 90.0
, it will be clamped to 90.0
.
Declaration
Swift
case tilt(any RangeExpression<Double>)
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\nCameraRestriction\n=================\n\n enum CameraRestriction\n\nRepresents various constraints that can be applied to the camera's position\nor orientation.\n\nUse these cases to define limits on camera properties like altitude, heading, tilt,\nor geographical bounds, often used to guide user interaction or enforce\nspecific viewing perspectives within a map or scene view.\n- `\n ``\n ``\n `\n\n ### [altitude(_:)](#/s:12GoogleMaps3D17CameraRestrictionO8altitudeyACSX_pSd5BoundSXRts_XPcACmF)\n\n `\n ` \n Restricts the camera's altitude (height above ground or sea level). \n Note\n\n If you attempt to set a value less than `0.0`, it will be clamped to `0.0`.\n If you attempt to set a value greater than `63170000.0`, it will be clamped to `63170000.0`. \n\n #### Declaration\n\n Swift \n\n case altitude(any RangeExpression\u003cDouble\u003e)\n\n- `\n ``\n ``\n `\n\n ### [bounds(latitude:longitude:)](#/s:12GoogleMaps3D17CameraRestrictionO6boundsyACSNySdG_AEtcACmF)\n\n `\n ` \n When set, restricts the position of the camera within the specified lat/lng bounds. Note that\n objects outside the bounds are still rendered. Bounds can restrict both longitude and\n latitude, or can restrict either latitude or longitude only. For latitude-only bounds use\n longitude range of `(-180.0)...180`. For longitude-only bounds use latitude range of\n `-(90)...90`\\`. \n\n #### Declaration\n\n Swift \n\n case bounds(latitude: ClosedRange\u003cDouble\u003e, longitude: ClosedRange\u003cDouble\u003e)\n\n- `\n ``\n ``\n `\n\n ### [heading(_:)](#/s:12GoogleMaps3D17CameraRestrictionO7headingyACSX_pSd5BoundSXRts_XPcACmF)\n\n `\n ` \n Restricts the camera's heading (horizontal direction or azimuth). \n Note\n\n If you attempt to set a value less than `0.0`, it will be clamped to `0.0`.\n If you attempt to set a value greater than `360.0`, it will be clamped to `360.0`. \n\n #### Declaration\n\n Swift \n\n case heading(any RangeExpression\u003cDouble\u003e)\n\n- `\n ``\n ``\n `\n\n ### [tilt(_:)](#/s:12GoogleMaps3D17CameraRestrictionO4tiltyACSX_pSd5BoundSXRts_XPcACmF)\n\n `\n ` \n Restricts the camera's tilt (pitch angle relative to the horizon).\n\n A tilt of 0 typically means looking straight down, while 90 might represent\n looking towards the horizon, depending on the specific camera system's convention. \n Note\n\n If you attempt to set a value less than `0.0`, it will be clamped to `0.0`.\n If you attempt to set a value greater than `90.0`, it will be clamped to `90.0`. \n\n #### Declaration\n\n Swift \n\n case tilt(any RangeExpression\u003cDouble\u003e)"]]