A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/maps/documentation/routes_preferred/custom_routes below:

Plan a Route | Google Maps Platform Routes Preferred API

Skip to main content Plan a Route

Stay organized with collections Save and categorize content based on your preferences.

This product or feature is in Preview (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the Google Maps Platform Service Specific Terms. For more information, see the launch stage descriptions.

When you are determining the best route for a ridesharing trip, the fastest route may not always be the best option. You may want to plan your route.

The Routes Preferred API lets you plan a route by specifying a route objective using the ComputeCustomRoutes method.

The ComputeCustomRoutes method can also help with route compliance by letting you minimize the difference between the route selected by the operator and the route driven.

Use both the Routes Preferred API and the Navigation SDK to realize the full benefit of route planning.

Note: You do not have to use the same cloud project for the Routes Preferred API and the Navigation SDK. Note: Unlike ComputeRoutes API, ComputeCustomRoutes only supports two travel modes, DRIVE (or the equivalent TRAVEL_MODE_UNSPECIFIED) and TWO_WHEELER. This method also does not support via intermediate waypoints. If you try to use other travel modes or via waypoints, the request fails. For more information about via waypoints, see Routes Preferred API waypoints. Enable the ComputeCustomRoutes method

Before you can use the ComputeCustomRoutes method in your code, you must enable it. For more information on enabling Routes Preferred API methods, see Getting Started.

Important: Check your quota limits for Routes Preferred API methods. If you need to increase your quota limits, contact support by filing a case on the Google Maps Platform support page in the Google Cloud Console, or by calling the Google Cloud Support Hotline. Use the ComputeCustomRoutes method

The ComputeCustomRoutes method requires that you specify a response field mask in the input. You can provide the response field mask by using the URL parameter $fields or fields, or by using the HTTP/gRPC header X-Goog-FieldMask. For more information, see System Parameters.

The field mask value is a comma-separated list of field paths. Each field path is a dot-separated list of field names that represent the message hierarchy. A field name is either the JSON object key, or the protobuf field tag name. The field path starts from the top level response message type, and is optionally followed by one or more dots, and then the next level of field name. In general, field paths are constructed in the following way:

topLevelField[.secondLevelField][.thirdLevelField][...]

A special case field mask is a wildcard “*”, which selects all root-level fields.

For more information, see:

For examples of using the ComputeCustomRoutes method, see Computing a Custom Route (Beta) Examples.

Calculating toll fees

For information on calculating toll fees, see Calculate toll fees.

For examples of calculating toll fees, see Computing a Custom Route Examples.

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-14 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-08-14 UTC."],[[["The Routes Preferred API's `ComputeCustomRoutes` method enables planning routes based on objectives beyond the fastest route, such as compliance or driver preferences."],["`ComputeCustomRoutes` supports optimizing routes for `DRIVE` and `TWO_WHEELER` travel modes, but excludes intermediate waypoints and other travel modes."],["Using the Routes Preferred API with the Navigation SDK provides the best route planning outcomes, though they can utilize separate cloud projects."],["Before using the `ComputeCustomRoutes` method, enable it and verify your quota limits, requesting increases if necessary through Google Cloud Support."],["To specify desired data in the response, use field masks with the `ComputeCustomRoutes` method, selecting fields using dot-separated paths from the top-level response."]]],["The Routes Preferred API's `ComputeCustomRoutes` method allows route planning by specifying a route objective and minimizing deviations from the operator's selected route. This method supports `DRIVE` and `TWO_WHEELER` travel modes, excluding `via` waypoints. To use it, enable the method and specify a response field mask via `$fields`, `fields`, or `X-Goog-FieldMask`. Quota limits should be monitored. Use alongside the Navigation SDK to maximize route planning benefits. Additionally, toll fees can be calculated using this API.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4