THIS SDK ISDEPRECATED.We rolled out a new and better SDK for you.
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)
6RouteCalculationDescriptor routeCalculationDescriptor = new RouteCalculationDescriptor.Builder()
7 .routeDescription(routeDescriptor)
9 .reportType(ReportType.NONE)
10 .instructionType(InstructionsType.NONE)
13RouteSpecification routeSpecification = new RouteSpecification.Builder(
14 routeConfig.getOrigin(),
15 routeConfig.getDestination()
17 .routeCalculationDescriptor(routeCalculationDescriptor)
1val routeDescriptor = RouteDescriptor.Builder()
2 .travelMode(travelMode)
3 .considerTraffic(false)
6val routeCalculationDescriptor = RouteCalculationDescriptor.Builder()
7 .routeDescription(routeDescriptor)
10return RouteSpecification.Builder(origin, destination)
11 .routeCalculationDescriptor(routeCalculationDescriptor)
Travel mode car | Travel mode pedestrian |
Travel mode truck | |