SPRouteTracker

@interface SPRouteTracker : NSObject

Class used for tracking progress on a route. Can be used to snap a location onto a route.

  • Recommended constructor for SPRouteTracker objects.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDelegate:
        (nonnull id<SPRouteTrackerDelegate>)delegate;

    Swift

    init(delegate: SPRouteTrackerDelegate)

    Parameters

    delegate

    for route callbacks

    Return Value

    new instance of SPRouteTracker

  • Sets a limit a location can deviate from the route until a re-route will be recommended via delegate callback.

    Declaration

    Objective-C

    - (void)setReRouteThreshold:(CGFloat)meters;

    Swift

    func setReRouteThreshold(_ meters: CGFloat)

    Parameters

    meters

    maximum distance from route

  • Sets a limit for reaching destination. When distance from current location to the end of a route is less than the threshold, delegate will be informed that the destination has been reached.

    Declaration

    Objective-C

    - (void)setDestinationThreshold:(CGFloat)meters;

    Swift

    func setDestinationThreshold(_ meters: CGFloat)

    Parameters

    meters

    distance from destination

  • Set a route to track. Replaces previous route.

    Declaration

    Objective-C

    - (void)setRoute:(nonnull SPRoute *)route;

    Swift

    func setRoute(_ route: SPRoute)

    Parameters

    route

    object to track

  • Set routes to track. Replaces any previous routes.

    Declaration

    Objective-C

    - (void)setRoutes:(nonnull NSArray<SPRoute *> *)routes;

    Swift

    func setRoutes(_ routes: [SPRoute])

    Parameters

    routes

    objects to track

  • Stops tracking current route

    Declaration

    Objective-C

    - (void)removeRoute;

    Swift

    func removeRoute()
  • Stops tracking any routes

    Declaration

    Objective-C

    - (void)removeRoutes;

    Swift

    func removeRoutes()
  • Declaration

    Objective-C

    - (nullable SPRoute *)route;

    Swift

    func route() -> SPRoute?

    Return Value

    route current route being tracked.