-1

Mapbox provides good Navigation SDK for Android, and what I have been trying to do is pass custom lat and lng's to mapbox navigation launcher. But its taking current user location and i would like to pass the custom coordinates . Is that possible?

Surya Teja
  • 1,388
  • 3
  • 16
  • 32

1 Answers1

1

You need to build a DirectionsRoute and then eventually give it to the NavigationLauncherOptions.Builder.

You can build a route with a custom origin instead of the device location.

Also, you can add custom waypoints.

Create a waypoint via the Point class. Point wayPoint = Point.fromLngLat(longCoordinate, latCoordinate);

Once you get the route from the response, you can eventually give it to the options builder before starting the NavigationLauncher.

langsmith
  • 2,529
  • 1
  • 11
  • 13