FollowCameraOperatorConfig
public struct FollowCameraOperatorConfig : Equatable
The configuration for follow camera operators.
-
init(controlPointsMap:
minZoom: maxZoom: defaultZoom: defaultTilt: defaultFieldOfView: combinedInstructionMaxZoom: combinedInstructionMaxZoomChange: ) Creates a new
FollowCameraOperatorConfig
instance.Declaration
Swift
public init( controlPointsMap: FollowCameraOperatorConfig.ControlPointsMap, minZoom: Double? = nil, maxZoom: Double? = nil, defaultZoom: Double? = nil, defaultTilt: Double? = nil, defaultFieldOfView: Double? = nil, combinedInstructionMaxZoom: Double? = nil, combinedInstructionMaxZoomChange: Double? = nil )
Parameters
controlPointsMap
Dictionary of control points named after the corresponding road classes.
minZoom
Optional minimum zoom allowed for this camera operator. Should be less than
maxZoom
.maxZoom
Optional maximum zoom allowed for this camera operator. Should be greater than
minZoom
.defaultZoom
Optional default zoom allowed for this camera operator. Should be greater than min-zoom if min-zoom is defined; smaller than max-zoom if max-zoom is defined.
defaultTilt
Optional default tilt allowed for this camera operator. The camera tilt is set to the default tilt upon activation of this camera operator.
defaultFieldOfView
Optional default field of view.
combinedInstructionMaxZoom
Determines the maximum zoom that can be applied to keep a combined next instruction in the safe area. The value must be a floating-point value greater than or equal to 0.0.
combinedInstructionMaxZoomChange
Determines the maximum amount that the zoom can change per meter. The value must be a floating-point value greater than or equal to 1.0.
-
RoadClass is used alongside
See moreControlPoint
, and influences the follow route camera operator behavior. RoadClass categorizes roads by speed limit, and it controls controls the operator’s interaction with mapping and navigation processes.Declaration
Swift
public enum RoadClass
-
Array of control points, each of which contains the camera configuration for a given distance to the next instruction on the route. The array must have at least one element and must be sorted in order of decreasing distance.
Declaration
Swift
public typealias ControlPoints = [ControlPoint]
-
Dictionary of control points named after the corresponding road classes. This part of the configuration is only valid for the follow route camera operator for followable routes. To make a route followable, use:
isFollowable
orfollow()
. The follow route camera operator interpolates the tilt and scale according to the current camera position in relation to the next instruction, using the control points. Different control points can be defined for different road classes. The “default” road class is reserved for cases when there is no entry for a specific road class, or if the road class information is not available. If the entry for the “default” road class is missing, default internal values will be used in such cases. An example of a default internal value is a 0 tilt for both north-up follow camera operators.Declaration
Swift
public typealias ControlPointsMap = [RoadClass : ControlPoints]
-
Default
FollowCameraOperatorConfig
forCameraTrackingMode.followDirection
tracking mode.Default values are:
- controlPointsMap: [:]
- minZoom: 11.7
- maxZoom: 18.3
Declaration
Swift
public static var DEFAULT_FOLLOW_DIRECTION_CAMERA_OPERATOR_CONFIG: FollowCameraOperatorConfig
-
Default
FollowCameraOperatorConfig
forCameraTrackingMode.followNorthUp
tracking mode.Default values are:
- controlPointsMap: [:]
- minZoom: 0.0
- maxZoom: 18.3
Declaration
Swift
public static var DEFAULT_FOLLOW_CAMERA_OPERATOR_CONFIG: FollowCameraOperatorConfig
-
Default
FollowCameraOperatorConfig
for follow route tracking modes.Default values are:
- controlPointsMap: [:]
- minZoom: 13.8
- maxZoom: 18.3
- defaultTilt: 66.0
- defaultFieldOfView: 45.0
Declaration
Swift
public static var DEFAULT_FOLLOW_ROUTE_CAMERA_OPERATOR_CONFIG: FollowCameraOperatorConfig
-
Dictionary of control points named after the corresponding road classes.
Declaration
Swift
public let controlPointsMap: ControlPointsMap
-
Optional minimum zoom allowed for this camera operator. The camera zoom is clamped according to the min zoom value upon activation of this camera operator. When defined, should be less than max-zoom.
Declaration
Swift
public let minZoom: Double?
-
Optional maximum zoom allowed for this camera operator. The camera zoom is clamped according to the max zoom value upon activation of this camera operator. When defined, should be greater than min-zoom.
Declaration
Swift
public let maxZoom: Double?
-
Optional default zoom allowed for this camera operator. The camera zoom is set to the default zoom upon activation of this camera operator. When defined, should be greater than min-zoom if min-zoom is defined; smaller than max-zoom if max-zoom is defined.
Declaration
Swift
public let defaultZoom: Double?
-
Optional default tilt allowed for this camera operator. The camera tilt is set to the default tilt upon activation of this camera operator.
Declaration
Swift
public let defaultTilt: Double?
-
Optional default field of view (FOV) for camera operator. The camera’s FOV is set to the default value upon activation of this operator. This must be a floating-point value in the range from 1.0 to 150.0 (inclusive).
Declaration
Swift
public let defaultFieldOfView: Double?
-
Determines the maximum zoom that can be applied to keep a combined next instruction in the safe area. This only applies in cases where the next instruction is combined with the one after it. If the zoom needed to keep the combined next instruction inside the safe area is greater than this value, the camera operator skips the current scale change. Future zoom changes are not affected.
The value must be a floating-point value greater than or equal to 0.0.
Optional. Defaults to 0.0 (which disables the feature completely).
Declaration
Swift
public let combinedInstructionMaxZoom: Double?
-
Determines the maximum amount that the zoom can change per meter. This is needed because at each geometry point, the algorithm checks whether the combined instruction arrow fits within the safe area. If not, the zoom is increased. Changing the zoom too quickly is distracting. So zoom adjustments are smoothed: the zoom is gradually changed before the increased level is actually needed, then gradually changed back afterwards. Scale smoothing means that there are points when the view is more zoomed out than the combined instruction arrow needs. If too much smoothing is used, the zoom may not have time to return to its optimal level between adjustments.
The value must be a floating-point value greater than or equal to 1.0.
Choosing a good value for this parameter usually requires some experimenting. It depends on the other camera operator parameters. For example, a good starting point for an experiment using a typical follow route camera operator in 3D mode would be a value of 5.
Optional. If omitted, the smoothing of the scale changes will be turned off.
Declaration
Swift
public let combinedInstructionMaxZoomChange: Double?