MMKNavigationLayer

Warning

This feature is available in the NaviKit SDK version.

@interface MMKNavigationLayer : NSObject

Summary

Instance methods

- (nullable MMKRouteView *)getViewWithRoute:(nonnull MMKDrivingRoute *)route;
Find appearance of route

- (void)selectRouteWithRoute:(nullable MMKRouteView *)route;
NavigationLayer will try to show as much info as possible about selected route

- (nullable MMKRouteView *)selectedRoute;

- (void)addRouteViewListenerWithRouteViewListener:
    (nonnull id<MMKRouteViewListener>)routeViewListener;

Add this listener if you wish to handle taps on routes

- (void)removeRouteViewListenerWithRouteViewListener:
    (nonnull id<MMKRouteViewListener>)routeViewListener;

- (void)selectRoadEventWithEventId:(nonnull NSString *)eventId;

- (void)deselectRoadEvent;

- (void)selectRequestPointWithRequestPointIndex:(NSUInteger)requestPointIndex;
Selects a request point with specified index

- (void)deselectRequestPoint;
Deselects selected request point if any

- (void)addRequestPointListenerWithRequestPointListener:
    (nonnull id<MMKRequestPointListener>)requestPointListener;

Add this listener if you wish to handle taps on request points

- (void)removeRequestPointListenerWithRequestPointListener:
    (nonnull id<MMKRequestPointListener>)requestPointListener;

- (void)addBalloonViewListenerWithBalloonListener:
    (nonnull id<MMKBalloonViewListener>)balloonListener;

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

- (void)removeBalloonViewListenerWithBalloonListener:
    (nonnull id<MMKBalloonViewListener>)balloonListener;

- (void)addListenerWithNavigationLayerListener:
    (nonnull id<MMKNavigationLayerListener>)navigationLayerListener;

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

- (void)removeListenerWithNavigationLayerListener:
    (nonnull id<MMKNavigationLayerListener>)navigationLayerListener;

- (void)addPlacemarkTapListenerWithRoadEventsListener:
    (nonnull id<MMKNavigationLayerPlacemarkTapListener>)roadEventsListener;

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

- (void)removePlacemarkTapListenerWithRoaadEventsListener:
    (nonnull id<MMKNavigationLayerPlacemarkTapListener>)roaadEventsListener;

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

- (void)setRoadEventVisibleOnRouteWithTag:(MMKRoadEventsEventTag)tag
                                       on:(BOOL)on;

Sets road events on route tag visibility

- (void)removeFromMap;
Removes layer from map

- (void)setShowBalloonsGeometryWithEnabled:(BOOL)enabled;
for debug usage only

- (void)refreshStyle;
Force refresh style for all navigation layer objects

- (BOOL)is2DMode;
When in 2D mode: - map is switched to 2D mode - 'Free' and 'Following' camera modes have zero tilt - tilt changing gestures are disabled

Disabled by default

- (void)set2DModeWithEnabled:(BOOL)enabled;

Properties

@property (nonatomic, readonly, nonnull) MMKNavigation *navigation;

@property (nonatomic, readonly, nonnull) MMKCamera *camera;

@property (nonatomic, readonly) MMKNavigationLayerMode mode;
Current view mode

@property (nonatomic, readonly, nonnull) NSArray<MMKRouteView *> *routes;
Routes representation on the map

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isShowRequestPoints) BOOL showRequestPoints;

Enabled by default

@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isIsVisible)
    BOOL isVisible;

@property (nonatomic, readonly, getter=isValid) BOOL valid;
Tells if this object is valid or no

Instance methods

getViewWithRoute:

- (nullable MMKRouteView *)getViewWithRoute:(nonnull MMKDrivingRoute *)route;

Find appearance of route.


selectRouteWithRoute:

- (void)selectRouteWithRoute:(nullable MMKRouteView *)route;

NavigationLayer will try to show as much info as possible about selected route. For example if road event placemarks from different routes overlap, road event from selected route will be displayed, conflict will be hidden. None or one route can be selected at the same time. Pass nil/null to unselect route. Can be used only if mode() == NavigationLayerMode.RouteSelection


selectedRoute

- (nullable MMKRouteView *)selectedRoute;


addRouteViewListenerWithRouteViewListener:

- (void)addRouteViewListenerWithRouteViewListener:
    (nonnull id<MMKRouteViewListener>)routeViewListener;

Add this listener if you wish to handle taps on routes.

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


removeRouteViewListenerWithRouteViewListener:

- (void)removeRouteViewListenerWithRouteViewListener:
    (nonnull id<MMKRouteViewListener>)routeViewListener;


selectRoadEventWithEventId:

- (void)selectRoadEventWithEventId:(nonnull NSString *)eventId;


deselectRoadEvent

- (void)deselectRoadEvent;


selectRequestPointWithRequestPointIndex:

- (void)selectRequestPointWithRequestPointIndex:(NSUInteger)requestPointIndex;

Selects a request point with specified index. Only one point can be selected at a time. If some other point is selected already, it will be deselected.


deselectRequestPoint

- (void)deselectRequestPoint;

Deselects selected request point if any.


addRequestPointListenerWithRequestPointListener:

- (void)addRequestPointListenerWithRequestPointListener:
    (nonnull id<MMKRequestPointListener>)requestPointListener;

Add this listener if you wish to handle taps on request points.

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


removeRequestPointListenerWithRequestPointListener:

- (void)removeRequestPointListenerWithRequestPointListener:
    (nonnull id<MMKRequestPointListener>)requestPointListener;


addBalloonViewListenerWithBalloonListener:

- (void)addBalloonViewListenerWithBalloonListener:
    (nonnull id<MMKBalloonViewListener>)balloonListener;

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


removeBalloonViewListenerWithBalloonListener:

- (void)removeBalloonViewListenerWithBalloonListener:
    (nonnull id<MMKBalloonViewListener>)balloonListener;


addListenerWithNavigationLayerListener:

- (void)addListenerWithNavigationLayerListener:
    (nonnull id<MMKNavigationLayerListener>)navigationLayerListener;

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


removeListenerWithNavigationLayerListener:

- (void)removeListenerWithNavigationLayerListener:
    (nonnull id<MMKNavigationLayerListener>)navigationLayerListener;


addPlacemarkTapListenerWithRoadEventsListener:

- (void)addPlacemarkTapListenerWithRoadEventsListener:
    (nonnull id<MMKNavigationLayerPlacemarkTapListener>)roadEventsListener;

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


removePlacemarkTapListenerWithRoaadEventsListener:

- (void)removePlacemarkTapListenerWithRoaadEventsListener:
    (nonnull id<MMKNavigationLayerPlacemarkTapListener>)roaadEventsListener;

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


setRoadEventVisibleOnRouteWithTag:on:

- (void)setRoadEventVisibleOnRouteWithTag:(MMKRoadEventsEventTag)tag
                                       on:(BOOL)on;

Sets road events on route tag visibility. Setting local chats visibility will also set visibility for ordinary chats and vice versa. None are visible by default.


removeFromMap

- (void)removeFromMap;

Removes layer from map. No further operations with layer should be performed.


setShowBalloonsGeometryWithEnabled:

- (void)setShowBalloonsGeometryWithEnabled:(BOOL)enabled;

for debug usage only


refreshStyle

- (void)refreshStyle;

Force refresh style for all navigation layer objects.


is2DMode

- (BOOL)is2DMode;

When in 2D mode: - map is switched to 2D mode - 'Free' and 'Following' camera modes have zero tilt - tilt changing gestures are disabled

Disabled by default


set2DModeWithEnabled:

- (void)set2DModeWithEnabled:(BOOL)enabled;


Properties

@property (nonatomic, readonly, nonnull) MMKNavigation *navigation;


camera

@property (nonatomic, readonly, nonnull) MMKCamera *camera;


mode

@property (nonatomic, readonly) MMKNavigationLayerMode mode;

Current view mode


routes

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

Routes representation on the map.


showRequestPoints

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isShowRequestPoints) BOOL showRequestPoints;

Enabled by default.


isVisible

@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isIsVisible)
    BOOL isVisible;


valid

@property (nonatomic, readonly, getter=isValid) BOOL valid;

Tells if this object is valid or no. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.