CameraRestriction
enum 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 to0.0
. If you attempt to set a value greater than63170000.0
, it will be clamped to63170000.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 to0.0
. If you attempt to set a value greater than360.0
, it will be clamped to360.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 to0.0
. If you attempt to set a value greater than90.0
, it will be clamped to90.0
.Declaration
Swift
case tilt(any RangeExpression<Double>)