THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Supporting points

Allow your user to reconstruct his/her route using supporting points. Supporting points can be combined with minDeviationDistance or minDeviationTime constraints. When these constraints are used, the alternative routes will follow the reference route from the origin point for the given time or distance. In other words, alternative routes just diverge from the reference route after the given constraints. When using supporting points, intermediate locations (waypoints) are not supported.

Sample use case: You have route coordinates saved on your device. You want to reconstruct the route based on the coordinates (supporting points) and calculate zero or more alternative routes to this reference route.

To request a route with supporting points support:

1RouteDescriptor routeDescriptor = new RouteDescriptor.Builder()
2 .considerTraffic(false)
3 .build()
4
5RouteCalculationDescriptor routeCalculationDescriptor = new RouteCalculationDescriptor.Builder()
6 .routeDescription(routeDescriptor)
7 .maxAlternatives(1)
8 .minDeviationTime(0)
9 .supportingPoints(SUPPORTING_POINTS)
10 .minDeviationDistance(minDeviationDistance)
11 .build();
12
13RouteSpecification routeSpecification = new RouteSpecification.Builder(EXAMPLE_ORIGIN, EXAMPLE_DESTINATION)
14 .routeCalculationDescriptor(routeCalculationDescriptor)
15 .build();
1val routeDescriptor = RouteDescriptor.Builder()
2 .considerTraffic(false)
3 .build()
4
5val routeCalculationDescriptor = RouteCalculationDescriptor.Builder()
6 .routeDescription(routeDescriptor)
7 .maxAlternatives(MAX_ALTERNATIVES)
8 .minDeviationTime(MIN_DEVIATION_TIME)
9 .supportingPoints(SUPPORTING_POINTS)
10 .minDeviationDistance(minDeviationDistance)
11 .build()
12
13val routeSpecification = RouteSpecification.Builder(origin, destination)
14 .routeCalculationDescriptor(routeCalculationDescriptor)
15 .build()

image

Min. deviation distance: 0 m

image

Min. deviation distance: 10 km