**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt).

You can get a route matrix for different types of vehicles. To set the mode of
travel in a
[`computeRouteMatrix`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt)
HTTP `POST` request, pass the
[`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#body.request_body.FIELDS.travel_mode)
field in the JSON request body using a
[`RouteTravelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt)
enum value. If you don't specify a
[`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#body.request_body.FIELDS.travel_mode)
value, the Routes API uses the default of
[`DRIVE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.DRIVE).

You can choose driving, two-wheeled vehicles, transit, trucks, or walking.
Bicycling
([`BICYCLE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.BICYCLE))
isn't supported for route matrixes.

> [!NOTE]
> **Note:** Two-wheeled and walking routes are in beta and might sometimes be missing clear sidewalks or pedestrian paths. You must display this warning to the user for all two-wheel or walking routes that you display in your app.

| Vehicle type | [`RouteTravelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt) value | Description |
|---|---|---|
| [Drive](https://developers.google.com/maps/documentation/routes/compute_route_matrix.md.txt) | [`DRIVE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.DRIVE) | Compute a driving route matrix. [`DRIVE`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.DRIVE) is the default if you don't specify a vehicle type. |
| [Two-wheeled vehicle](https://developers.google.com/maps/documentation/routes/route_two_wheel.md.txt) | [`TWO_WHEELER`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TWO_WHEELER) | You specify a route matrix for a two-wheeled motorized vehicle the same way you specify it for a route, using the [`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#body.request_body.FIELDS.travel_mode) field. |
| [Transit](https://developers.google.com/maps/documentation/routes/transit-rm.md.txt) | [`TRANSIT`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRANSIT) | Get a transit route matrix that uses the public transportation options available in the region. Transit options can include buses, subways, and trains, among others. |
| [Truck](https://developers.google.com/maps/documentation/routes/lvr.md.txt) | [`TRUCK`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.TRUCK) | Calculate travel times and distances for a matrix of origins and destinations using large vehicle routing. Specify the physical attributes of your vehicles in [`origins[].routeModifiers.vehicleInfo`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.md.txt#FIELDS.vehicle_info) to get accurate estimates that account for weight, height, and hazardous materials restrictions. |
| Walk | [`WALK`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode.md.txt#ENUM_VALUES.WALK) | Compute a walking route matrix. |

> [!NOTE]
> **Note:** While the drive, two-wheeled vehicle, and truck (large vehicle routing) documentation is located under the [`computeRoutes`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt) documentation, the instructions for specifying vehicle attributes apply to both [`computeRoutes`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes.md.txt) and [`computeRouteMatrix`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt) requests.

## Specify the travel mode in a request

To specify a travel mode in a
[`computeRouteMatrix`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt)
request, set the
[`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#body.request_body.FIELDS.travel_mode)
field in the HTTP `POST` JSON request body and include the required
`X-Goog-FieldMask` header to select the
[`RouteMatrixElement`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#body.RouteMatrixElement.SCHEMA_REPRESENTATION)
response fields you need. If you're migrating from the legacy Distance Matrix
API, the
[`travelMode`](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRouteMatrix.md.txt#body.request_body.FIELDS.travel_mode)
field in the `POST` JSON request body replaces the legacy `mode` URL query
parameter. For more information, see
[Migrate to the Routes API](https://developers.google.com/maps/documentation/routes/migrate-routes.md.txt).

```json
curl -X POST -d '{
  "origins": [
    {
      "waypoint": {
        "location": {
          "latLng": {
            "latitude": 37.420761,
            "longitude": -122.081356
          }
        }
      }
    }
  ],
  "destinations": [
    {
      "waypoint": {
        "location": {
          "latLng": {
            "latitude": 37.420999,
            "longitude": -122.086894
          }
        }
      }
    }
  ],
  "travelMode": "WALK"
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: YOUR_API_KEY' \
-H 'X-Goog-FieldMask: originIndex,destinationIndex,duration,distanceMeters,status,condition' \
'https://routes.googleapis.com/distanceMatrix/v2:computeRouteMatrix'
```