LocationManager
public class LocationManager : LocationDelegate
extension LocationManager: NativeBase
extension LocationManager: Hashable
LocationManager listens to position updates and provides the map-matched location using the LocationManagerListener.
Note: This is a beta release of this feature. There may be bugs and unexpected behaviors. Related APIs may change in future releases without a deprecation process.
-
Creates a new instance of
LocationManager.Throws
InstantiationErrorInstantiation error.Declaration
Swift
public init(sdkEngine: SDKNativeEngine) throwsParameters
sdkEngineA SDKEngine instance.
-
Called each time a new location is available. In a navigation context while using the
NavigatororVisualNavigator, it’s required to set theLocation.timeparameter for eachLocationobject so that the HERE SDK can map-match the locations properly. If theLocation.timeparameter is missing, the location will be ignored. For navigation, it is also recommended to provide thebearingandspeedparameters for eachLocationobject. Invoked on the main thread.Declaration
Swift
public func onLocationUpdated(_ location: Location)Parameters
locationCurrent location.
-
Sets the
MapMatcherfor exclusive use byLocationManager.Threading: This method is asynchronous and performs the switch in an internal thread of
LocationManager. Note: After calling this method, theMapMatcheris owned and used exclusively byLocationManagerin its internal processing thread. Do not use or access theMapMatcherelsewhere while it is set.Declaration
Swift
public func setMapMatcher(mapMatcher: MapMatcher?)Parameters
mapMatcherThe
MapMatcherinstance to be used exclusively byLocationManager. -
Retrieves and removes the
MapMatcherfromLocationManager. Note: After calling this method,LocationManagerwill no longer use theMapMatcherat all. the caller regains full ownership and responsibility for theMapMatcher.Declaration
Swift
public func takeMapMatcher() -> MapMatcher?Return Value
The
MapMatcherinstance previously set, ornilif none was set. -
Adds the
MatchedLocationListenerto the subscribtion list.Declaration
Swift
public func MatchedLocationDelegate(matchedLocationListener: MatchedLocationListener)Parameters
matchedLocationListenerListener to be added to the map matched location updates.
-
Removes the
MatchedLocationListenerfrom the subscribtion list.Declaration
Swift
public func removeMatchedLocationListener(matchedLocationListener: MatchedLocationListener)Parameters
matchedLocationListenerListener to be removed from the map matched location updates.