Routes Preferred API 目前仅适用于部分客户。如需了解详情,请
与销售人员联系。
ComputeRoutesResponse
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
JSON 表示法 |
{
"routes": [
{
object (Route )
}
],
"fallbackInfo": {
object (FallbackInfo )
}
} |
字段 |
routes[] |
object (Route )
包含在指定 compute_alternatives_routes 时计算出的路线的数组(最多三个),否则仅包含一条路线。如果此数组包含多个条目,则第一个条目是最推荐的路线。如果数组为空,则表示找不到路线。
|
fallbackInfo |
object (FallbackInfo )
在某些情况下,当服务器无法使用所有输入偏好设置计算出路线结果时,可能会回退到使用其他计算方法。使用回退模式时,此字段包含有关回退响应的详细信息。否则,此字段将未设置。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eComputeRoutes response provides route options and fallback information in JSON format.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eroutes\u003c/code\u003e field contains an array of computed routes, with the first one being the most recommended.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003efallbackInfo\u003c/code\u003e field provides details when the server uses a fallback computation method.\u003c/p\u003e\n"],["\u003cp\u003eIf the \u003ccode\u003eroutes\u003c/code\u003e array is empty, it signifies that no route could be found for the given request.\u003c/p\u003e\n"]]],["The `ComputeRoutes` response includes a `routes` array, which contains computed routes. The array can hold up to three alternative routes, with the first being the most recommended. If no routes are found, the array is empty. A `fallbackInfo` object is also included in certain cases when the server uses a different computation method due to the inability to compute routes with the input preferences. Otherwise the object will be unset.\n"],null,["# ComputeRoutesResponse\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\nComputeRoutes the response message.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"routes\": [ { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/Route) } ], \"fallbackInfo\": { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackInfo) } } ``` |\n\n| Fields ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `routes[]` | `object (`[Route](/maps/documentation/routes_preferred/reference/rest/Shared.Types/Route)`)` Contains an array of computed routes (up to three) when you specify `compute_alternatives_routes`, and contains just one route when you don't. When this array contains multiple entries, the first one is the most recommended route. If the array is empty, then it means no route could be found. |\n| `fallback``Info` | `object (`[FallbackInfo](/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackInfo)`)` In some cases when the server is not able to compute the route results with all of the input preferences, it may fallback to using a different way of computation. When fallback mode is used, this field contains detailed info about the fallback response. Otherwise this field is unset. |"]]