Allow your users to send multiple synchronous routing requests with Batch Routing components. You
can mix different types of routing requests to compare them in an easy way.
Batch Routing components described use
the Online Batch Routing API
, so you can find all details about it in the service documentation.
Sample use case: You are preparing for a trip and you would like to choose the most optimal
route for your travel. You would like to compare the ETA and distances for routes depending on
travel modes, route types, or avoids.
Also, you can adjust the Batch Request with other parameters described in
the Online Batch Routing API
or JavaDocs of this SDK under the Api reference section.
The example below shows multiple routes requested in the batch. Each example sends three requests in
one batch. All examples allow a user to compare routes visually on the map, their ETAs, and
distances by clicking a chosen route.
The Travel mode example shows three routes: The route by car, the route by truck, and the route as
a pedestrian.
The Route type example shows three routes: The fastest route, the shortest route, and the most eco
route.
The Avoids example shows three routes: the avoid-motorways route, the avoid-ferries route, and the
avoid-toll roads.
Use the following code sample to implement a similar use case.
To request a batch query create a TTBatchRouteQuery: