Combine routing summaries with search along route
You can combine routing summary calculations with search along a route. In this case, Text Search (New) returns the travel duration and distance to each place in the response, and then from each place to the final destination of the route.
To use Text Search (New) to calculate the routing summary along with search along a route:
By default, Text Search (New) performs the search along the entire route:
Specify the routing origin, travel mode, and route modifiers
You can modify the search and routing summary calculation by specifying the routing origin, travel mode, route modifiers, and routing preferences. The travel mode and route modifiers work the same as for calculating routing summaries without specifying a route as shown in the Specify travel options topic.
By default, the first leg of each result contains the distance from the origin defined by the polyline to each place. However, you can override that default by explicitly specifying a routing origin in the request. If specified, the first leg of all responses specifies the distances and duration from the specified routing origin, overriding the origin from the polyline.