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-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eRoutes Preferred APIs support four travel modes: drive, walk, bicycle, and two-wheeler (motorcycles).\u003c/p\u003e\n"],["\u003cp\u003eTwo-wheeler travel mode is distinct from bicycle travel mode, catering to motorized two-wheeled vehicles instead of human-powered ones.\u003c/p\u003e\n"],["\u003cp\u003eWhen using Routes Preferred APIs, specify the desired travel mode using the \u003ccode\u003eRouteTravelMode\u003c/code\u003e enumeration value within the request.\u003c/p\u003e\n"],["\u003cp\u003eAn example demonstrates how to set the \u003ccode\u003etravelMode\u003c/code\u003e to "TWO_WHEELER" within the \u003ccode\u003eComputeRoutes()\u003c/code\u003e method request body, illustrating its practical application.\u003c/p\u003e\n"]]],["The Routes Preferred APIs support four travel modes: Drive, Walk, Bicycle, and Two-wheeler, where Two-wheeler refers to motorized two-wheeled vehicles. To use a specific mode, utilize the `RouteTravelMode` enumeration in the API call. For example, to specify the two-wheeler mode in the `ComputeRoutes()` method request body, set the `\"travelMode\"` parameter to `\"TWO_WHEELER\"`. The two-wheeler mode is distinct from the bicycle mode, which is human-powered.\n"],null,["# Route Two-wheeled Vehicles\n\nRoutes Preferred APIs support four travel modes:\n\n- Drive\n- Walk\n- Bicycle\n- Two-wheeler\n\nTwo-wheeler refers to two-wheeled motorized vehicles (for example, motorcycles).\nThe two-wheeler travel mode differs from the bicycle travel mode, which is a\nhuman-powered travel mode.\n\nSpecifying the two-wheeler travel mode\n--------------------------------------\n\nWhen you call the Routes Preferred APIs, you use a\n[`RouteTravelMode`](https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode)\nenumeration value to specify the travel mode.\n\n### Example\n\nThe following example demonstrates how to set the travel mode in the `ComputeRoutes()` method request\nbody. \n\n```cplint\n{\n \"origin\":{\n \"location\":{\n \"latLng\":{\n \"latitude\":37.419734,\n \"longitude\":-122.0827784\n }\n }\n },\n \"destination\":{\n \"location\":{\n \"latLng\":{\n \"latitude\":37.417670,\n \"longitude\":-122.079595\n }\n }\n },\n \"travelMode\":\"TWO_WHEELER\"\n}\n```"]]