In this example, you calculate the travel duration and distance to each place in
the Nearby Search response. This example searches for restaurants in Sydney,
Australia and sets the location restriction and the routing origin to the same
latitude and longitude coordinate:
Specify travel options
By default, the duration and distance calculations are for a car. However, you
can control the vehicle type, as well as other options, in the search.
In the next example, you specify the travel mode as DRIVE and to avoid
highways:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-02 UTC."],[],[]]