Places UI Kit: A ready-to-use library that provides room for customization and low-code development. Try it out, and share yourinput on your UI Kit experience.
Route Matrix options Stay organized with collections Save and categorize content based on your preferences.
Overview
Along with specifying the origin and destination, you can also use many of the options available for routes to customize a route matrix. The following table lists the options available for route matrix requests, and calls out any differences between the single-route and matrix methods.
| Option | Description |
|---|---|
| Travel mode | The mode of travel, such as drive, transit, walk, bicycling, or two-wheeled vehicle. Note: Walking, bicycling, and two-wheeled vehicle routes are in beta and might sometimes be missing clear sidewalks, pedestrian paths, or bicycling paths. You must display this warning to the user for all walking, bicycling, and two-wheel routes that you display in your app. |
| Specify how and if to include traffic data | Include traffic data for more accurate results, or exclude it for a faster response. Because thecomputeRouteMatrix processes many routes simultaneously, using the highest quality setting,TRAFFIC_AWARE_OPTIMAL, imposes a strict request limit on the total number of elements (origins × destinations) you can calculate in a single call. This limitation exists to prevent excessive latency. |
| Calculate toll fees for a route matrix | When working with tolls in theRouteMatrix, the process is fundamentally the same as calculating tolls for a single route, but with one key difference in scope: thecomputeRouteMatrix method provides only the aggregated toll information for each complete Origin-Destination pair. Unlike the singlecomputeRoutes method, which can return detailed toll information broken down by individual route legs (segments between waypoints), the route matrix response summarizes the total estimated toll cost for the entire trip between the origin and destination. You still enable toll calculation by settingextraComputations toTOLLS and defining vehicle and toll pass information by setting the origin'srouteModifiers, but the resultingtravelAdvisory.tollInfo applies to the full route, not its individual components. |
| Request localized values | You request localized text for your route matrix response in the same way as for a route, using a field mask. When requesting localized text for duration and distance, both the single-route and matrix methods support explicitly setting thelanguageCode and units (for example,METRIC orIMPERIAL). However, if these parameters are not set, thecomputeRoutes method attempts to infer the language and distance units directly from the origin waypoint's geographic location, whereas thecomputeRouteMatrix method defaults to English (en-US) for language and Metric (METRIC) for units, regardless of the origin's location. Therefore you must explicitly set the localization parameters when usingRouteMatrix to override its default behavior. |
| Available route matrix vehicle types | Additional options for selecting the type of vehicle for the route matrix. |
| Additional options | To specify additional options, such as the departure time, see ComputeRouteMatrixRequest. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-31 UTC.