SPRouteTracker
Objective-C
@interface SPRouteTracker : NSObject
Swift
class SPRouteTracker : NSObject
Class used for tracking progress on a route. Can be used to snap a location onto a route.
-
Delegate for progress callbacks
Declaration
Objective-C
@property (nonatomic, weak) id<SPRouteTrackerDelegate> _Nullable delegate;Swift
weak var delegate: SPRouteTrackerDelegate? { get set }
-
Recommended constructor for SPRouteTracker objects.
Declaration
Objective-C
- (nonnull instancetype)initWithDelegate: (nonnull id<SPRouteTrackerDelegate>)delegate;Swift
init(delegate: SPRouteTrackerDelegate)Parameters
delegatefor 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
metersmaximum 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
metersdistance from destination
-
Stops tracking current route
Declaration
Objective-C
- (void)removeRoute;Swift
func removeRoute() -
Stops tracking any routes
Declaration
Objective-C
- (void)removeRoutes;Swift
func removeRoutes()
-
Update the current location for route tracking events
Declaration
Objective-C
- (void)updateWithLocation:(nonnull SPLocation *)location;Swift
func update(with location: SPLocation)Parameters
locationnew location to check on route
-
Checks progress on current route for a particular location.
Declaration
Objective-C
- (nonnull SPRouteTrackerProgress *)progressForLocation: (nonnull SPLocation *)location;Swift
func progress(for location: SPLocation) -> SPRouteTrackerProgressParameters
locationwhere to calculate progress
Return Value
progress on current route
SPRouteTracker Class Reference