MQRouteService
@interface MQRouteService : NSObject
An object that provides routes based on a starting point and set of locations, with options
-
Method to find out if there are any requests pending
Declaration
Objective-C
- (BOOL)hasPendingRouteRequests;
Swift
func hasPendingRouteRequests() -> Bool
Return Value
YES if there are pending network requests
-
Attempts to get a route starting from first location to second location and then to third and so on
Declaration
Objective-C
- (void)requestRoutesWithStartLocation:(nonnull CLLocation *)startLocation destinationLocations: (nonnull NSArray<CLLocation *> *)destinationLocations options:(nonnull MQRouteOptions *)options completion:(nonnull MQRouteResponseCompletionBlock) completion;
Swift
func requestRoutes(withStart startLocation: CLLocation, destinationLocations: [CLLocation], options: MQRouteOptions, completion: @escaping MQRouteResponseCompletionBlock)
Parameters
startLocation
Starting location for the route
destinationLocations
List of locations for destinations
options
Route options for route
completion
Completion block to run when response is received from the API
-
Cancels any pending route requests
Declaration
Objective-C
- (void)cancelRouteRequests;
Swift
func cancelRouteRequests()
-
Cancels any pending traffic/eta requests
Declaration
Objective-C
- (void)cancelPendingTrafficRequests;
Swift
func cancelPendingTrafficRequests()