NavigationRouteRemoveObserver

public protocol NavigationRouteRemoveObserver : Observer

Declares an observer that can receive the active or proposed route has been removed from the navigation session.

The active route is removed from the session when:

The proposed route is removed from the session when:

To receive notifications of a route being removed from the session, first implement an observer object that conforms to NavigationRouteRemoveObserver, for example:

class CustomRouteObserver: NavigationRouteRemoveObserver { ... }

/// In order to complete conformance, the observer object must implement the following callback:

func didRemoveRoute(route: reason:) {
    // add code here that handles the route being removed from the session
}

This callback function could remove a rendered route from the map, for example.

Next, add this observer with navigation using addRouteRemoveObserver(_:). To stop notifications of a route being removed from the session, remove the observer using removeRouteRemoveObserver(_:).

The complementary observer that provides updates on the addition of routes to the session is NavigationRouteAddObserver. Note, during navigation in turn by turn mode there will always be one active route. Therefore, any removal of the current active route will always be preceded by an NavigationActiveRouteChangeObserver call, with details of the new active route.