Sorry, you need to enable JavaScript to visit this website.

Routing with waypoints

Routing with waypoints

Allow your users to plan a route with up to 50 waypoints. Help your users to get the best route through all their stops in the optimal order.

Sample use case: You plan a trip from the TomTom office in Amsterdam to the office in Berlin. There are a few places that you would like to visit during the drive. You would like to check if your preferred route is the best way to visit all of the places in the shortest time. To do this, input the coordinates as waypoints and call the routing module using the withComputeBestOrder parameter.

To request a route with waypoints:

_

LatLng[] wayPointsArray = wayPoints.toArray(new LatLng[wayPoints.size()]);
RouteQuery routeQuery = RouteQueryBuilder.create(routeConfig.getOrigin(), routeConfig.getDestination())
        .withWayPoints(wayPointsArray)
        .withComputeBestOrder(computeBestOrder)
        .withConsiderTraffic(false).build();
waypoints = arrayOf(WAYPOINT_HAMBURG, WAYPOINT_ZURICH, WAYPOINT_BRUSSELS)
val routeQuery = RouteQueryBuilder.create(origin, destination)
        .withWayPoints(waypoints)
        .withComputeBestOrder(computeBestOrder)
        .withConsiderTraffic(false)
        .build()

 



image

Initial_order

image

Best order

image

No waypoints

You are here