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.
  • Start location engine. Might be called from private queue.

    Declaration

    Swift

    func start()
  • Stop location engine. Might be called from private queue.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    func addObserver(_ observer: LocationProviderObservable)

    Parameters

    observer

    The observer to add.

  • Remove observer from the location engine.

    Declaration

    Swift

    func removeObserver(_ observer: LocationProviderObservable)

    Parameters

    observer

    The observer to remove.