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()
.travelMode(TravelMode.CAR)
.considerTraffic(false)
.routeType(RouteType.SHORTEST)
.build();
RouteCalculationDescriptor routeCalculationDescriptor = new RouteCalculationDescriptor.Builder()
.routeDescription(routeDescriptor)
.waypoints(waypoints)
.sectionType(SectionType.CAR_TRAIN)
.computeBestOrder(false)
.routeRepresentation(RouteRepresentation.POLYLINE)
.build();
RouteSpecification routeSpecification = new RouteSpecification.Builder(
waypoints.get(0), waypoints.get(waypoints.size() - 1))
.routeCalculationDescriptor(routeCalculationDescriptor)
.build();
routingApi.planRoute(routeSpecification,routeCallback);
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