Routes Preferred API is currently available only to select customers.
Contact sales to learn more.
Route Two-wheeled Vehicles
Stay organized with collections
Save and categorize content based on your preferences.
Routes Preferred APIs support four travel modes:
- Drive
- Walk
- Bicycle
- Two-wheeler
Two-wheeler refers to two-wheeled motorized vehicles (for example, motorcycles).
The two-wheeler travel mode differs from the bicycle travel mode, which is a
human-powered travel mode.
Specifying the two-wheeler travel mode
When you call the Routes Preferred APIs, you use a
RouteTravelMode
enumeration value to specify the travel mode.
Example
The following example demonstrates how to set the travel mode in the ComputeRoutes()
method request
body.
{
"origin":{
"location":{
"latLng":{
"latitude":37.419734,
"longitude":-122.0827784
}
}
},
"destination":{
"location":{
"latLng":{
"latitude":37.417670,
"longitude":-122.079595
}
}
},
"travelMode":"TWO_WHEELER"
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-29 UTC.
[[["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 2025-01-29 UTC."],[[["Routes Preferred APIs support four travel modes: drive, walk, bicycle, and two-wheeler (motorcycles)."],["Two-wheeler travel mode is distinct from bicycle travel mode, catering to motorized two-wheeled vehicles instead of human-powered ones."],["When using Routes Preferred APIs, specify the desired travel mode using the `RouteTravelMode` enumeration value within the request."],["An example demonstrates how to set the `travelMode` to \"TWO_WHEELER\" within the `ComputeRoutes()` method request body, illustrating its practical application."]]],[]]