SKRoutingDelegate Protocol Reference

Conforms to NSObject
Declared in SKRoutingDelegate.h

Overview

The routing delegate of the SKRoutingService must adopt the SKRoutingDelegate protocol. The SKRoutingDelegate protocol is used to receive routing related update messages.

– routingService:didFinishRouteCalculationWithInfo:

Called when a route is succesfully calculated including a requested route alternative. Note: For long routes, this callback might be called twice for the same route. The reason is that a potential turn by turn navigation can start without calculating the route completely and downloading all the required map tiles. To check if the route is completely finished you should check if routeInformation.corridorIsDownloaded is YES.

- (void)routingService:(SKRoutingService *)routingService didFinishRouteCalculationWithInfo:(SKRouteInformation *)routeInformation

Parameters

routingService

The routing service.

routeInformation

An object that contains information regarding the calculated route.

Discussion

Called when a route is succesfully calculated including a requested route alternative. Note: For long routes, this callback might be called twice for the same route. The reason is that a potential turn by turn navigation can start without calculating the route completely and downloading all the required map tiles. To check if the route is completely finished you should check if routeInformation.corridorIsDownloaded is YES.

Declared In

SKRoutingDelegate.h

– routingService:didFailWithErrorCode:

Called when the route cannot be calculated.

- (void)routingService:(SKRoutingService *)routingService didFailWithErrorCode:(SKRoutingErrorCode)errorCode

Parameters

routingService

The routing service.

errorCode

The error code of the failure.

Discussion

Called when the route cannot be calculated.

Declared In

SKRoutingDelegate.h

– routingServiceDidCalculateAllRoutes:

Called when all the routes including alternatives are calculated. Not all the times the required number of alternatives can be calculated, because the routes may be too similar. This callback is called when no more route alternatives will be provided.

- (void)routingServiceDidCalculateAllRoutes:(SKRoutingService *)routingService

Parameters

routingService

The routing service.

Discussion

Called when all the routes including alternatives are calculated. Not all the times the required number of alternatives can be calculated, because the routes may be too similar. This callback is called when no more route alternatives will be provided.

Declared In

SKRoutingDelegate.h

– routingServiceShouldRetryCalculatingRoute:withRouteHangingTime:

Called during the route calculation process. If the route cannot be calculated because of a connectivity issue, this callback can be used to control the retry mechanism. Id it’s not implemented the route calculation will be retried until successful.

- (BOOL)routingServiceShouldRetryCalculatingRoute:(SKRoutingService *)routingService withRouteHangingTime:(NSInteger)timeInterval

Parameters

routingService

The routing service.

timeInterval

The time interval since the route calculation is hanging in seconds.

Return Value

A boolean value which indicates if the route calculation should be retried.

Discussion

Called during the route calculation process. If the route cannot be calculated because of a connectivity issue, this callback can be used to control the retry mechanism. Id it’s not implemented the route calculation will be retried until successful.

Declared In

SKRoutingDelegate.h