1

I am working in Mapbox sdk, I integrated the sdk and i can show the current location and drop pin on touching the map.

But when i call for navigation route it giving me a error message "Unable to place request on backend". Any body know why it showing this message? Do i need a Paid Mapbox account?

The below code i am using.

NavigationRoute.builder(this)
    .accessToken(Mapbox.getAccessToken())
    .origin(origin)
    .destination(destination)
    .build()
    .getRoute(new Callback<DirectionsResponse>() {
        @Override
        public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {
            if (response.body()==null){
                Log.e(TAG,"No route found check accesstoker and user");
                System.out.println("msgs " +"1");
                return;
            }else if (response.body().routes().size()==0){
                Log.e(TAG,"No route found ");
                System.out.println("msgs " +"2");
                return;
            }
            DirectionsRoute currentRoute=response.body().routes().get(0);
            currentRouts=currentRoute;
            if (navigationMapRoute!=null){
                navigationMapRoute.removeRoute();

            }else{
                navigationMapRoute=new NavigationMapRoute(null,mapView,map);

            }
            navigationMapRoute.addRoute(currentRoute);
        }

        @Override
        public void onFailure(Call<DirectionsResponse> call, Throwable t) {
            System.out.println("msgs " +"23 "+t);

        }
    });
Andronicus
  • 25,419
  • 17
  • 47
  • 88
Munavvar
  • 11
  • 6

0 Answers0