MMKNavigation

@interface MMKNavigation : NSObject

Undocumented

Summary

Instance methods

- (void)requestRoutesWithPoints:(nonnull NSArray<MMKRequestPoint *> *)points
                 initialAzimuth:(nullable NSNumber *)initialAzimuth
                    routesCount:(nullable NSNumber *)routesCount;

Request routes for further guidance

- (void)requestAlternatives;
Request global alternatives for the current route

- (void)resolveUriWithUri:(nonnull NSString *)uri;
Resolve saved driving route URI for further guidance

- (void)cancelRequest;
Cancel active routing request

- (void)resetRoutes;
Cancel active routing request and clear routes vector

- (void)addListenerWithNavigationListener:
    (nonnull id<MMKNavigationListener>)navigationListener;

The class does not retain the object in the 'navigationListener' parameter

- (void)removeListenerWithNavigationListener:
    (nonnull id<MMKNavigationListener>)navigationListener;

Undocumented

- (void)startGuidanceWithRoute:(nullable MMKDrivingRoute *)route;
Start guidance with given route

- (void)stopGuidance;
Stops current guidance session

- (void)suspend;
Stop tracking user position, later it could be resumed without losing current route

- (void)resume;
Resumes suspended guidance

Properties

@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull)
    MMKDrivingVehicleOptions *vehicleOptions;

Changing this option may trigger reroute

@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isAvoidTolls)
    BOOL avoidTolls;

The 'avoidTolls/avoidUnpaved/avoidPoorConditions' option instructs the router to return routes that avoid tolls/unpaved/roads in poor condition when possible

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isAvoidUnpaved) BOOL avoidUnpaved;

Undocumented

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isAvoidPoorConditions) BOOL avoidPoorConditions;

Undocumented

@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull)
    NSArray<MMKLinearRing *> *avoidedZones;

avoidedZones instructs the router to return routes that avoid provided polygons

@property (nonatomic, assign, unsafe_unretained, readwrite)
    MMKAnnotationLanguage annotationLanguage;

Set the annotation language

@property (nonatomic, readonly, nonnull) NSArray<MMKDrivingRoute *> *routes;
Resulting routes for the previous request

@property (nonatomic, readonly, nonnull) MMKGuidance *guidance;
Undocumented

Instance methods

requestRoutesWithPoints:initialAzimuth:routesCount:

- (void)requestRoutesWithPoints:(nonnull NSArray<MMKRequestPoint *> *)points
                 initialAzimuth:(nullable NSNumber *)initialAzimuth
                    routesCount:(nullable NSNumber *)routesCount;

Request routes for further guidance. If there was a pending routing request, it will be canceled.


requestAlternatives

- (void)requestAlternatives;

Request global alternatives for the current route. If there was a pending routing request, it will be canceled.


resolveUriWithUri:

- (void)resolveUriWithUri:(nonnull NSString *)uri;

Resolve saved driving route URI for further guidance. If there was a pending routing request, it will be canceled.


cancelRequest

- (void)cancelRequest;

Cancel active routing request.


resetRoutes

- (void)resetRoutes;

Cancel active routing request and clear routes vector.


addListenerWithNavigationListener:

- (void)addListenerWithNavigationListener:
    (nonnull id<MMKNavigationListener>)navigationListener;

The class does not retain the object in the 'navigationListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.


removeListenerWithNavigationListener:

- (void)removeListenerWithNavigationListener:
    (nonnull id<MMKNavigationListener>)navigationListener;

Undocumented


startGuidanceWithRoute:

- (void)startGuidanceWithRoute:(nullable MMKDrivingRoute *)route;

Start guidance with given route. This method will reset active current route if any. It only accepts either routes obtained from this routes field or null, which means freedrive session started.


stopGuidance

- (void)stopGuidance;

Stops current guidance session. Call this method only if guidance has completely ended. For example, if you need to start another type of guidance (pedestrian for example) stop this first and than start another one. In case of route finished but you still on the road you must use startGuidance(null) instead.


suspend

- (void)suspend;

Stop tracking user position, later it could be resumed without losing current route. Useful when user don't want guidance in background.


resume

- (void)resume;

Resumes suspended guidance. Guide will continue to guide the previous route or rebuild it. Useful when user don't want guidance in background.


Properties

vehicleOptions

@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull)
    MMKDrivingVehicleOptions *vehicleOptions;

Changing this option may trigger reroute.


avoidTolls

@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isAvoidTolls)
    BOOL avoidTolls;

The 'avoidTolls/avoidUnpaved/avoidPoorConditions' option instructs the router to return routes that avoid tolls/unpaved/roads in poor condition when possible. Changing these options may trigger reroute. All disabled by default.


avoidUnpaved

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isAvoidUnpaved) BOOL avoidUnpaved;

Undocumented


avoidPoorConditions

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isAvoidPoorConditions) BOOL avoidPoorConditions;

Undocumented


avoidedZones

@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull)
    NSArray<MMKLinearRing *> *avoidedZones;

avoidedZones instructs the router to return routes that avoid provided polygons. If there are too many polygons or too complex polygon geometry, routes building may become impossible. In this case the error MMKDrivingTooComplexAvoidedZonesError will be returned. Changing this option may trigger reroute.


annotationLanguage

@property (nonatomic, assign, unsafe_unretained, readwrite)
    MMKAnnotationLanguage annotationLanguage;

Set the annotation language. Changing this option may trigger reroute.


routes

@property (nonatomic, readonly, nonnull) NSArray<MMKDrivingRoute *> *routes;

Resulting routes for the previous request. For requestAlternatives() it will contain the current route and fastest alternative route (if available) along with the received alternatives. Current route always will be the first one and fastest alternative will be the second.


guidance

@property (nonatomic, readonly, nonnull) MMKGuidance *guidance;

Undocumented