-1

Using the mapboxNavigation requestRoutes with the following options code. Getting a Failure callback complaining No suitable edges near location. The same points array used in Postman calling the Direction API returns successfully.

RouteOptions.Builder builder=RouteOptions.builder();
                builder
                        .accessToken(getString(R.string.mapbox_access_token))
                        .profile(RouteUrl.PROFILE_DRIVING)
                        .language("en")
                        .user("mapbox")
                        .requestUuid(""+UUID.randomUUID())
                        .alternatives(true)
                        .geometries("geojson")
                        .steps(true)
                        .baseUrl("https://api.mapbox.com/directions/v5/mapbox/")
                        .coordinates(ptsList);
kchoi
  • 109
  • 1
  • 4

1 Answers1

0

The problem is fixed after couple changes ...

  1. The baseUrl for RouteOptions request is https://api.mapbox.com/
  2. Commented out the call of geometries(). The following code successful the call of route request...
RouteOptions.Builder builder = RouteOptions.builder();
builder
.accessToken(getString(R.string.mapbox_access_token))
.profile(DirectionsCriteria.PROFILE_DRIVING)
.language("en")
.user("mapbox")
.requestUuid(""+ UUID.randomUUID())
.alternatives(true)
// .geometries(DirectionsCriteria.GEOMETRY_POLYLINE)
.steps(true)
.baseUrl("https://api.mapbox.com/")
.coordinates(ptsList);
kchoi
  • 109
  • 1
  • 4