SPRouteTrackerDelegate

@protocol SPRouteTrackerDelegate <NSObject>

Delegate for SPRouteTracker. Use this to listen for route progression related callbacks.

  • Called when location on route is changed.

    Declaration

    Objective-C

    - (void)routeTracker:(nonnull SPRouteTracker *)tracker
        didUpdateLocation:(nonnull SPLocation *)location;

    Swift

    optional func routeTracker(_ tracker: SPRouteTracker, didUpdate location: SPLocation)

    Parameters

    tracker

    object that called this method

    location

    coordinate snapped to route

  • Called when location enters a new step on a route.

    Declaration

    Objective-C

    - (void)routeTracker:(nonnull SPRouteTracker *)tracker
        didEnterRouteStep:(int)stepIndex;

    Swift

    optional func routeTracker(_ tracker: SPRouteTracker, didEnterRouteStep stepIndex: Int32)

    Parameters

    tracker

    object that called this method

    stepIndex

    index of step on route

  • Called when location progresses on a route.

    Declaration

    Objective-C

    - (void)routeTracker:(nonnull SPRouteTracker *)tracker
             didProgress:(nonnull SPRouteTrackerProgress *)progress;

    Swift

    optional func routeTracker(_ tracker: SPRouteTracker, didProgress progress: SPRouteTrackerProgress)

    Parameters

    tracker

    object that called this method

    progress

    object containing information about current progress on route

  • Called when location has deviated from route enough to warrant a re-routing.

    Declaration

    Objective-C

    - (void)routeTracker:(nonnull SPRouteTracker *)tracker
        reRouteRecommended:(BOOL)recommended;

    Swift

    optional func routeTracker(_ tracker: SPRouteTracker, reRouteRecommended recommended: Bool)

    Parameters

    tracker

    object that called this method

    recommended

    true if new route calculation is recommended

  • Called when location has reached the last point on a route. Define the threshold/limit with the ‘setDestinationThreshold’ method.

    Declaration

    Objective-C

    - (void)routeTracker:(nonnull SPRouteTracker *)tracker
          didFinishRoute:(nonnull SPRoute *)route;

    Swift

    optional func routeTracker(_ tracker: SPRouteTracker, didFinish route: SPRoute)

    Parameters

    tracker

    object that called this method

    route

    the route that was finished