LocationManager
public final class LocationManager
An object responsible for managing user location Puck.
-
A stream of location change events that drive the puck.
Declaration
Swift
public var onLocationChange: Signal<[Location]> { get }
-
A stream of puck render events.
A subscriber will get the accurate (interpolated) data used to render puck, as opposed to the
onLocationChange
andonHeadingChange
that emit non-interpolated source data.Observe this stream to adjust any elements that connected the actual puck position, such as route line, annotations, camera position, or you can render a custom puck.
Declaration
Swift
public let onPuckRender: Signal<PuckRenderingData>
-
Configuration options for the location manager.
Declaration
Swift
public var options: LocationOptions { get set }
-
Sets the custom providers that supply puck with the location data.
Declaration
Parameters
locationProvider
Signal that drives puck location.
headingProvider
Signal that drives the puck’s bearing when it’s configured as
heading
. -
Sets the custom providers that supply puck with the location data.
Declaration
Swift
public func override( locationProvider: LocationProvider, headingProvider: HeadingProvider? = nil )
Parameters
locationProvider
Provider that drives puck location.
headingProvider
Provider that drives the puck’s bearing when it’s configured as
heading
. -
Sets the custom provider that supply puck with the location and heading data.
Declaration
Swift
public func override(provider: LocationProvider & HeadingProvider)
-
Represents the latest location received from the location provider.
Note
The value is lazy and gets updated only when there is at least one consumer of location data, such as visible location puck oronLocationChange
observer.In general, if you need to know the user location it’s recommended to observe the
onLocationChange
instead.Declaration
Swift
public var latestLocation: Location? { get }