Navigation View
An Android View that creates the drop-in UI.
NavigationView when started will ask for Manifest.permission.ACCESS_FINE_LOCATION and Manifest.permission.ACCESS_COARSE_LOCATION. If denied the view will point to a null island. If accepted, this view will always start in Free Drive state with the puck pointing to users current location.
The NavigationView is spread across the following states:
Free Drive: A user will be in free drive state when there is no destination or route set.
DestinationPreview: A user will be in destination preview when a destination is set.
RoutePreview: A user will be in route preview when a destination is set along with a route joining the origin/destination pair.
Active Guidance: A user will be in active guidance when a single destination or multi waypoint route is set and the user has explicitly initiated start navigation action.
Arrival: A user will be in arrival state when they are about to reach the final destination.
NavigationView by default does not uses MapboxReplayer, rather it uses the actual location engine and hooks onto the users current location derived from device GPS. However, this can be overridden and instead you can simulate active guidance by enabling isReplayEnabled
.
Note: NavigationView is Experimental
and the API(s) are subject to breaking changes.
A Mapbox access token must also be set by the developer (to initialize navigation).