THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Routing with waypoints

Allow your users to plan a route with up to 50 waypoints.

Sample use case: You plan a trip from the TomTom office in Amsterdam to their office in Berlin. There are a few places that you would like to visit during the drive. You would like to use your app to plan your route so it includes the places you would like to visit on the way, and check the total distance and ETA as well as see the entire route on the map.

To request a route with waypoints:

1RouteDescriptor routeDescriptor = new RouteDescriptor.Builder()
2 .considerTraffic(false)
3 .build()
4
5RouteCalculationDescriptor routeCalculationDescriptor = new RouteCalculationDescriptor.Builder()
6 .routeDescription(routeDescriptor)
7 .waypoints(wayPoints)
8 .build();
9
10RouteSpecification routeSpecification = new RouteSpecification.Builder(routeConfig.getOrigin(), routeConfig.getDestination())
11 .routeCalculationDescriptor(routeCalculationDescriptor)
12 .build();
1waypoints = listOf(WAYPOINT_HAMBURG, WAYPOINT_ZURICH, WAYPOINT_BRUSSELS)
2val routeDescriptor = RouteDescriptor.Builder()
3 .considerTraffic(false)
4 .build()
5
6val routeCalculationDescriptor = RouteCalculationDescriptor.Builder()
7 .routeDescription(routeDescriptor)
8 .waypoints(waypoints)
9 .build()
10
11val routeSpecification = RouteSpecification.Builder(origin, destination)
12 .routeCalculationDescriptor(routeCalculationDescriptor)
13 .build()

image

Initial_order

image

No waypoints