NavigationViewportDataSource
public class NavigationViewportDataSource : ViewportDataSource
extension NavigationViewportDataSource: LocationConsumer
Class, which conforms to ViewportDataSource
protocol and provides default implementation of it.
-
Delegate, which is used to notify
NavigationCamera
regarding upcomingCameraOptions
related changes.Declaration
Swift
public var delegate: ViewportDataSourceDelegate?
-
CameraOptions
, which are used on iOS when transitioning toNavigationCameraState.following
or for continuous updates when already inNavigationCameraState.following
state.Declaration
Swift
public var followingMobileCamera: CameraOptions
-
CameraOptions
, which are used on CarPlay when transitioning toNavigationCameraState.following
or for continuous updates when already inNavigationCameraState.following
state.Declaration
Swift
public var followingCarPlayCamera: CameraOptions
-
CameraOptions
, which are used on iOS when transitioning toNavigationCameraState.overview
or for continuous updates when already inNavigationCameraState.overview
state.Declaration
Swift
public var overviewMobileCamera: CameraOptions
-
CameraOptions
, which are used on CarPlay when transitioning toNavigationCameraState.overview
or for continuous updates when already inNavigationCameraState.overview
state.Declaration
Swift
public var overviewCarPlayCamera: CameraOptions
-
Value of maximum pitch, which will be taken into account when preparing
CameraOptions
during active guidance navigation.Defaults to
45.0
degrees.Declaration
Swift
public var maximumPitch: Double
-
Altitude that the
NavigationCamera
initally defaults to when navigation starts.Defaults to
1000.0
meters.Declaration
Swift
public var defaultAltitude: CLLocationDistance
-
Controls the distance on route after the current maneuver to include in the frame.
Defaults to
100.0
meters.Declaration
Swift
public var distanceToFrameAfterManeuver: CLLocationDistance
-
Controls how much the bearing can deviate from the location’s bearing, in degrees.
In case if set, the
bearing
property ofCameraOptions
during active guidance navigation won’t exactly reflect the bearing returned by the location, but will also be affected by the direction to the upcoming framed geometry, to maximize the viewable area.Defaults to
20.0
degrees.Declaration
Swift
public var maximumBearingSmoothingAngle: CLLocationDirection?
-
Initializer of
NavigationViewportDataSource
object.Declaration
Swift
public required init(_ mapView: MapView, viewportDataSourceType: ViewportDataSourceType = .passive)
Parameters
mapView
Instance of
MapView
, which is going to be used for several operations, which includes (but not limited to) subscription to raw location updates viaLocationConsumer
(in case ifviewportDataSourceType
was set to.raw
).MapView
will be weakly stored byNavigationViewportDataSource
.viewportDataSourceType
Type of locations, which will be used to prepare
CameraOptions
.
-
Declaration
Swift
public func locationUpdate(newLocation: Location)