Navmii SDK  2.2.0
Write yourself a navigation system in iOS
Instance Methods | Properties | List of all members
NMRouteCalculationSession Class Reference

Inherits <NSObject>.

Instance Methods

(void) - cancel
 

Properties

BOOL hasFinished
 
BOOL wasCanceled
 
BOOL hasSucceeded
 
NMRouteCalculationResultresult
 
BOOL hasFailed
 
NMRouteCalculationFailureInfofailureInfo
 
NSArray< NSNumber * > * errors
 

Detailed Description

Interface representing a route calculation session. Each route calculation session corresponds to one and only one route calculation or snapping process.

Method Documentation

◆ cancel()

- (void) cancel

Cancels the route calculation session. After the route calculation session was canceled it's considered as finished, which means both hasFinished and wasCanceled properties return 'YES', hasSucceeded and hasFailed properties return 'NO', result and failureInfo properties return 'nil'. After active route calculation session was canceled, #onCanceled listener is called.

Note
Calling the method after the session has finished has no effect.

Property Documentation

◆ errors

- (NSArray<NSNumber *>*) errors
readnonatomicstrong

Returns list of non-fatal errors occurred during route calculation process. When non-fatal error occurs, route calculation process doesn't finish (it keeps trying to calculate a route), but error code is stored withing the session.

◆ failureInfo

- (NMRouteCalculationFailureInfo*) failureInfo
readnonatomicstrong

Returns unsuccessful route calculation result if available and 'nil' otherwise. The property only returns nonnull if both hasFinished and hasFailed properties return 'YES'.

◆ hasFailed

- (BOOL) hasFailed
readnonatomicassign

Specifies whether the route calculation session has failed. The property returns 'YES' if route calculation session has finished and failed. In this case failureInfo property returns valid nonnull failure info, result property returns 'nil', hasFinished property returns 'YES', both wasCanceled and hasSucceeded properties return 'NO'.

◆ hasFinished

- (BOOL) hasFinished
readnonatomicassign

Specifies whether route calculation session is in progress. Once session has finished you can expect its state doesn't change. The hasFinished property returns 'YES' if either of the following happened: route calculation has succeeded, failed or the session was canceled by a user by calling the cancel method.

◆ hasSucceeded

- (BOOL) hasSucceeded
readnonatomicassign

Specifies whether the route calculation session has succeeded. The property returns 'YES' if route calculation session has finished and succeeded. In this case result property returns valid nonnull calculation result, failureInfo property returns 'nil', hasFinished property returns 'YES', both wasCanceled and hasFailed properties return 'NO'.

◆ result

- (NMRouteCalculationResult*) result
readnonatomicstrong

Returns successful route calculation result if available and 'nil' otherwise. The property only returns nonnull if both hasFinished and hasSucceeded properties return 'YES'.

◆ wasCanceled

- (BOOL) wasCanceled
readnonatomicassign

Specifies whether the route calculation session was canceled by a user. The only way to cancel route calculation session is to call the cancel method before the session has finished. If wasCanceled property returns 'YES', then hasFinished property returns 'YES', both hasSucceeded and hasFailed properties return 'NO', both result and failureInfo properties return 'nil'.