SpeedBasedCameraBehavior
public class SpeedBasedCameraBehavior : CameraBehavior
extension SpeedBasedCameraBehavior: NativeBase
extension SpeedBasedCameraBehavior: Hashable
Use this class to follow the current location of the user, zooming in and out and changing camera tilt according to the current speed.
-
Creates a new instance of this class.
Declaration
Swift
public init() -
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 } -
A single profile value which indicates the speed range in which it applies to its zoom and tilt configuration.
See moreDeclaration
Swift
public struct ProfileValue -
Sets the profile. The speed ranges within the profile can overlap in order to prevent oscillations between adjacent levels. Provided profile must satisfy following conditions:
- profile must not be empty
- each speed range must be valid (fromMetersPerSecond must be less then toMetersPerSecond)
- ranges must be sorted by fromMetersPerSecond and toMetersPerSecond
- gaps between ranges are not allowed Invalid profile will be rejected and error message logged with explanation of violated restriction.
Declaration
Swift
public func setProfile(_ profile: [SpeedBasedCameraBehavior.ProfileValue])Parameters
profileThe new profile value.
-
Gets the profile. The speed ranges within the profile can overlap in order to prevent oscillations between adjacent levels.
Declaration
Swift
public func getProfile() -> [SpeedBasedCameraBehavior.ProfileValue]Return Value
The profile.
-
Declaration
Swift
public static func default3DProfile() -> [SpeedBasedCameraBehavior.ProfileValue]Return Value
the default 3D profile.
-
Declaration
Swift
public static func default2DProfile() -> [SpeedBasedCameraBehavior.ProfileValue]Return Value
the default 2D profile.