mapbox-navigation-ios
mapbox-navigation-ios copied to clipboard
Automatic switching to Online Route
Description
Introduces the feature when we are driving the onboard
build route and the same online
version becomes available to automatically switch to it in order to receive live updates and refreshing.
Implementation
In order to correctly detect source of the original route, we have to allow configuring all related entities (NavigationViewController, NavigationService and Router) with an IndexedRouteResponse
since it contains such information. Thus we also need to update API to request routes to return the correct type as well as deprecating other init methods.
Online coincide route is detected through alternatives mechanism by checking if it completely follows the main route (in this case the deviation intersection is the last intersection on the route).
User is able to disable the behavior via flag control.