Mapbox-navigation-android: How I can set navigation follow by GPS tracking.

Created on 28 Nov 2017  路  5Comments  路  Source: mapbox/mapbox-navigation-android

I have the problem. The icon inside map Navigation Mapbox autoruns, not follow my GPS. I want my phone tracking by GPS and the icon navigation follow my location.

Most helpful comment

@trinhvanminh2009 Yep thanks @Danny-James! That's your solution above ^ you just need to set that boolean to false (which is the default in the builder() as well).

All 5 comments

@trinhvanminh2009 Set shouldSimulateRoute = false, this can be done in the following way:

NavigationViewOptions.Builder optionsBuilder = NavigationViewOptions.builder() 
       .unitType(NavigationUnitType.TYPE_IMPERIAL) 
       .shouldSimulateRoute(shouldSimulateRoute); 

     if (route != null) { 
       optionsBuilder.directionsRoute(route); 
       NavigationLauncher.startNavigation(this, optionsBuilder.build()); 
     } 

Using navigation-ui:0.7.1-SNAPSHOT

@trinhvanminh2009 Yep thanks @Danny-James! That's your solution above ^ you just need to set that boolean to false (which is the default in the builder() as well).

Thank you guys so much!

@trinhvanminh2009 let me know if you still have trouble with this, thanks - closing for now

@danesfeder I have the problem when I tried it.

  1. I compiled compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.7.1-SNAPSHOT' compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.7.0'
  2. NavigationViewOptions not found.
  3. Where to put these code (Example: onRunning, onProgressChange,.. etc )
  4. I'm using navigation.startNavigation(route);. It's auto run
    Sorry I'm beginner using Mapbox
Was this page helpful?
0 / 5 - 0 ratings