Route on map only shows direct line

Hi All, not sure if I posted in the right group.

Anyway I have a set of LatLnt (say 6 locations) and want to display the route on map. Instead of showing route it only shows the direct line between points. Are there anything I missed?

Code as below:

RouteDescriptor routeDescriptor = new RouteDescriptor.Builder()

        RouteCalculationDescriptor routeCalculationDescriptor = new RouteCalculationDescriptor.Builder()

        RouteSpecification routeSpecification = new RouteSpecification.Builder(
                waypoints.get(0), waypoints.get(waypoints.size() - 1))

        RouteBuilder routeBuilder = new RouteBuilder(waypoints)
                .endIcon(Icon.Factory.fromResources(this, R.drawable.ic_map_route_start))
                .startIcon(Icon.Factory.fromResources(this, R.drawable.ic_map_route_end));

        final Route mapRoute = tomtomMap.addRoute(routeBuilder);

Edited: When I add debug message in callback, it gives me the following error messages:

E/OnlineRoutingApi: Planning route failed: Error in service response: Could not parse json. Error(offset 819200): Invalid value.

E/RouteResponseDecoder: Decode error: missing or invalid result member “sections” in “route”

E/OnlineRoutingApi: Planning route failed: Error in service response: Decode error: invalid result member “route” in “routes”.

Can someone explain more about this?
Thank you


I can’t reproduce the same error as you, but indeed something is wrong with parsing the response when you are using a CAR_TRAIN parameter. When I’m switching to FERRY, it seems to be OK.
Is it possible for you to share the SDK version which you are using?


At the end I use different code which I had other issue (in other post) which works instead of the online tutorial/document/example:

LatLng[] route = new LatLng[waypoints.size()-2]; // minus the start and end
for (int i=1;i<waypoints.size()-1;i++){

        RouteQuery routeQuery = new RouteQueryBuilder(waypoints.get(0),waypoints.get(waypoints.size()-1))

        Icon startIcon  = Icon.Factory.fromResources(this,R.drawable.ic_map_route_departure);
        Icon endIcon = Icon.Factory.fromResources(this,R.drawable.ic_map_route_destination);
                .subscribe(new DisposableSingleObserver<RouteResponse>() {
                               public void onSuccess(RouteResponse routeResponse) {

                               private void displayRoutes(List <FullRoute> routes) {
                                   for (FullRoute fullRoute : routes) {
                                       tomtomMap.addRoute(new RouteBuilder(


                               public void onError(Throwable e) {
                                   Toast.makeText(getApplicationContext(),e.getLocalizedMessage(), Toast.LENGTH_LONG).show();

Log.w(“Route error”,"Error message "+e.getLocalizedMessage());