THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Travel modes

Allow your users to plan a route for different travel modes.

Sample use case: You want to check what travel mode (car or truck) gives you the best ETA for a trip from Amsterdam to Rotterdam.

Available travel modes:

1travelMode = TravelMode.CAR
2travelMode = TravelMode.TRUCK
3travelMode = TravelMode.TAXI
4travelMode = TravelMode.BUS
5travelMode = TravelMode.VAN
6travelMode = TravelMode.MOTORCYCLE
7travelMode = TravelMode.BICYCLE
8travelMode = TravelMode.PEDESTRIAN
9travelMode = TravelMode.OTHER

To request a specified travel mode:

1RouteDescriptor routeDescriptor = new RouteDescriptor.Builder()
2 .travelMode(travelMode)
3 .considerTraffic(false)
4 .build()
5
6RouteCalculationDescriptor routeCalculationDescriptor = new RouteCalculationDescriptor.Builder()
7 .routeDescription(routeDescriptor)
8 .maxAlternatives(0)
9 .reportType(ReportType.NONE)
10 .instructionType(InstructionsType.NONE)
11 .build();
12
13RouteSpecification routeSpecification = new RouteSpecification.Builder(
14 routeConfig.getOrigin(),
15 routeConfig.getDestination()
16)
17 .routeCalculationDescriptor(routeCalculationDescriptor)
18 .build();
1val routeDescriptor = RouteDescriptor.Builder()
2 .travelMode(travelMode)
3 .considerTraffic(false)
4 .build()
5
6val routeCalculationDescriptor = RouteCalculationDescriptor.Builder()
7 .routeDescription(routeDescriptor)
8 .build()
9
10return RouteSpecification.Builder(origin, destination)
11 .routeCalculationDescriptor(routeCalculationDescriptor)
12 .build()

image

Travel mode car

image

Travel mode pedestrian

image

Travel mode truck