AutomotiveCameraBehavior
public class AutomotiveCameraBehavior : CameraBehavior, CameraHdTransition
extension AutomotiveCameraBehavior: NativeBase
extension AutomotiveCameraBehavior: Hashable
High-level camera controller for automotive navigation that delegates to either a
TrackingCameraBehavior for following the vehicle or an AreaCameraBehavior for showing
geographic regions. Can also be deactivated via AutomotiveCameraBehavior.activeCameraType to release control to
external code.
Configuration including animation durations, zoom policies, maneuver rules, and per-mode
tilt/bearing/principal-point profiles is provided via a JSON string and validated at
construction. The AreaCameraBehavior anchor is taken from the
AutomotiveCameraBehavior.OrientationMode.modeNorthUp principal point in the configuration.
Note: This is a beta release of this feature and may contain bugs or exhibit unexpected behaviour. Related APIs are subject to change without a deprecation process.
-
Creates a new instance with default configuration.
Declaration
Swift
public init() -
Creates a new instance configured from a JSON string.
Declaration
Swift
public init(configJson: String) throwsParameters
configJsonJSON string containing the automotive camera configuration.
-
The normalized principal point. Normalized principal point to be used during navigation. Defaults to (0.5, 0.775), which means the camera will use the position slightly at the bottom of the mapview.
Declaration
Swift
public var normalizedPrincipalPoint: Anchor2D { get set } -
The view rectangle for camera updates. Defines a sub-space of the screen that the behavior should consider for camera updates. Using a view rectangle keeps the camera positioning consistent across different screen types and orientations without per-screen principal point adjustments. Defaults to
nil. If not set, it uses the viewport bounds of the underlying map view.Declaration
Swift
public var viewRectangle: Rectangle2D? { get set } -
Defines how the camera starts following the current position when this camera behavior becomes active. Use
CameraTransitionMode.instantto skip the camera animation, for example when returning from a route overview to guidance. The default value isCameraTransitionMode.animated.Declaration
Swift
public var cameraTransitionMode: CameraTransitionMode { get set } -
Minimum HD lane data length threshold in meters. The camera transitions from HD to SD mode when HD lane data availability falls below this distance ahead, or transitions to HD mode when sufficient HD data is detected.
Declaration
Swift
public var minimumHdLengthInMeters: Int32 { get set } -
If enabled, the
TrackingCameraBehaviorreacts to upcoming maneuvers. Reactions follow the rules defined in the JSON configuration. The initial value is taken from configuration. Changes apply immediately whenAutomotiveCameraBehavior.ActiveCameraType.tracking, otherwise the next time tracking is activated. Defaults tofalse, unless configured in JSON configuration.Declaration
Swift
public var isManeuverDetectionEnabled: Bool { get set } -
The active camera type. Selects which child camera handles updates. Set to
AutomotiveCameraBehavior.ActiveCameraType.noneto release control to external code,AutomotiveCameraBehavior.ActiveCameraType.trackingfor theTrackingCameraBehavior, orAutomotiveCameraBehavior.ActiveCameraType.areato use the most recent framing configured viaAutomotiveCameraBehavior.setAreaCameraBehaviorVisiblePoints(...)orAutomotiveCameraBehavior.setAreaCameraBehaviorGeobox(...). Defaults toAutomotiveCameraBehavior.ActiveCameraType.none.Declaration
Swift
public var activeCameraType: AutomotiveCameraBehavior.ActiveCameraType { get set } -
The current orientation mode of the
TrackingCameraBehavior. Selects the tilt, bearing, and principal point profile applied to theTrackingCameraBehavior. Profile values are taken from the JSON configuration. TheAreaCameraBehavioralways renders inAutomotiveCameraBehavior.OrientationMode.modeNorthUpregardless of this property. Defaults toAutomotiveCameraBehavior.OrientationMode.mode3d.Declaration
Swift
public var orientationMode: AutomotiveCameraBehavior.OrientationMode { get set } -
If enabled, the
TrackingCameraBehaviorwill use look-ahead mode. Whentrueand guidance is active, the camera targets a point ahead on the route. Behavior is defined in the JSON configuration. Defaults tofalse.Declaration
Swift
public var isLookAheadEnabled: Bool { get set } -
Minimal allowed zoom level for the
AreaCameraBehavior. Forwarded to the internalAreaCameraBehavior. Defaults tonil.Declaration
Swift
public var areaMinZoom: Double? { get set } -
Maximal allowed zoom level for the
AreaCameraBehavior. Forwarded to the internalAreaCameraBehavior. Defaults tonil.Declaration
Swift
public var areaMaxZoom: Double? { get set } -
Visual presentation mode applied to the
See moreTrackingCameraBehavior.Declaration
Swift
public enum OrientationMode : UInt32, CaseIterable, Codable -
Identifies which child camera is currently active.
See moreDeclaration
Swift
public enum ActiveCameraType : UInt32, CaseIterable, Codable -
Configures the
AreaCameraBehaviorto show the given points in its camera view. Applied the next timeAutomotiveCameraBehavior.activeCameraTypeis set toAutomotiveCameraBehavior.ActiveCameraType.areaand overrides any previous configuration set viaAutomotiveCameraBehavior.setAreaCameraBehaviorGeobox(...).Declaration
Swift
public func setAreaCameraBehaviorVisiblePoints(points: [GeoCoordinates], includeCurrentPosition: Bool)Parameters
pointsGeographic coordinates to show in the camera view.
includeCurrentPositionWhen true, the current vehicle position is also included in the camera view.
-
Configures the
AreaCameraBehaviorto enclose the given geographic bounding box in its camera view. Applied the next timeAutomotiveCameraBehavior.activeCameraTypeis set toAutomotiveCameraBehavior.ActiveCameraType.areaand overrides any previous configuration set viaAutomotiveCameraBehavior.setAreaCameraBehaviorVisiblePoints(...).Declaration
Swift
public func setAreaCameraBehaviorGeobox(geobox: GeoBox)Parameters
geoboxThe geographic bounding box to enclose.
-
Sets the principal point for a specific
AutomotiveCameraBehavior.OrientationMode. Does not require that mode to be currently active. WhenmodematchesAutomotiveCameraBehavior.orientationMode, theTrackingCameraBehavioris updated immediately.Declaration
Swift
public func setPrincipalPointForOrientation(mode: AutomotiveCameraBehavior.OrientationMode, value: Anchor2D)Parameters
modeThe
AutomotiveCameraBehavior.OrientationModewhose principal point is updated.valueNormalized principal point value for the given
AutomotiveCameraBehavior.OrientationMode.