Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The core component of Navmii SDK responsible for route navigation is NMRouteNavigator. This class provides the API to control the route navigation process, to get navigation information and guidance updates. The class is also able to handle the rerouting and the rerouting by traffic.

...

NMSdk class contains the routeNavigator property providing access to the instance of NMRouteNavigator. The route navigator instance can be accessed only after the SDK was started.

...

Route navigation starts by calling the startNavigatingTheRoute: method. The route parameter is an an instance of NMRoute class instance which represents the a route to navigate. The source of routes is Routing Service. After the route navigation was has started, the route navigator gets GPS position updates internally, updates the route navigation state and notifies if any changes occur. Those "notifications" can be gotten by conforming to NMRouteNavigationListener protocol. Notifications about Callbacks for the following events are available:

  • the 'on-route state' changes: user has got off the route or got back on the route. The SDK user may need this information to handle rerouting manually;
  • position on route (distance or time to destination) changes;
  • the next direction information or distance to it the next direction changes;
  • a waypoint has been passed or destination has been reached.

...

Route navigator also provides the route navigation guidance which whose callbacks can be gotten by conforming to NMGuidanceListener protocol.

User is able to stop the route navigation by calling the stopNavigation method.

...

As mentioned above NMRouteNavigator is able to handle rerouting automatically. The feature is enabled by default, but NMRouteNavigator class has the reroutingEnabled property which can be used to disable or enable the feature. If automatic rerouting handling is enabled, the route navigator tracks the on-route state and, once user is vehicle has got off the route being navigated, calculates a new route and applies it. User gets notifications The SDK user can get callbacks about the automatic rerouting handling process by conforming to NMReroutingListener protocol. The protocol has the onReroutingStarted method, which is called once automatic rerouting handling process starts, and the onReroutingFinished: method which is called once the process finishes. The onReroutingFinished: method has the newRoute parameter, which is the a new instance of NMRoute class instance representing new route being navigated. The newRoute can be nil if rerouting handling is no longer required (i.e. user has returned back to the previous route).

Rerouting The rerouting engine has an algorithm which attempts to use the a route similar to the one user initially started to navigate by calling the passed to the startNavigatingTheRoute: method. NMRouteNavigator has the reroutingSettingswhich property, which allows user to tune the algorithm a bit.

...