LocationProvider

public protocol LocationProvider : AnyObject

LocationProvider protocol used for providing a CLLocation for TomTomMap.

For MapView, TomTom provides an implementation based on CLLocationManager. The default implementation can be replaced using:

 mapView.map.locationProvider = engine

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Enable location engine. Might be called from private queue.

    Declaration

    Swift

    func enable()
  • Disable location engine. Might be called from private queue.

    Declaration

    Swift

    func disable()
  • The last location received. Will be nil until a location has been received.

    Declaration

    Swift

    var lastKnownLocation: GeoLocation? { get }
  • Add observer to the location engine.

    Declaration

    Swift

    func addObserver(_ observer: LocationUpdateObserver)

    Parameters

    observer

    The observer to add.

  • Remove observer from the location engine.

    Declaration

    Swift

    func removeObserver(_ observer: LocationUpdateObserver)

    Parameters

    observer

    The observer to remove.