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 on 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 paramater.
In the example below the route is from Amsterdam to Berlin using withComputeBestOrder parameters.
_
let query = TTRouteQueryBuilder.create(withDest: TTCoordinate.BERLIN(), andOrig: TTCoordinate.AMSTERDAM())
.withWayPoints(&waypoints, count: UInt(waypoints.count))
.build()
routePlanner.plan(with: query)
TTRouteQuery *query = [[[TTRouteQueryBuilder createWithDest:[TTCoordinate BERLIN] andOrig:[TTCoordinate AMSTERDAM]] withWayPoints:self.waypoints count:3] build];
[self.routePlanner planRouteWithQuery:query];
![]() Initial order. |
![]() Best order. |