Routes Preferred API 目前仅适用于部分客户。如需了解详情,请
与销售人员联系。
RouteModifiers
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
JSON 表示法 |
{
"avoidTolls": boolean,
"avoidHighways": boolean,
"avoidFerries": boolean,
"avoidIndoor": boolean,
"vehicleInfo": {
object (VehicleInfo )
},
"tollPasses": [
enum (TollPass )
]
} |
字段 |
avoidTolls |
boolean
如果设置为 true,则会在合理的情况下避开收费道路,优先选择不含收费道路的路线。仅适用于 DRIVE 和 TWO_WHEELER 出行方式。
|
avoidHighways |
boolean
设置为 true 时,系统会在合理情况下避开高速公路,优先考虑不包含高速公路的路线。仅适用于 DRIVE 和 TWO_WHEELER 出行方式。
|
avoidFerries |
boolean
如果设置为 true,则会在合理的情况下避开轮渡,优先选择不含轮渡的路线。仅适用于 DRIVE 和 TWO_WHEELER 出行方式。
|
avoidIndoor |
boolean
设置为 true 时,在合理的范围内避免在室内导航,优先考虑不包含室内导航的路线。仅适用于WALK 出行方式。
|
vehicleInfo |
object (VehicleInfo )
指定车辆信息。
|
tollPasses[] |
enum (TollPass )
封装收费卡的相关信息。如果提供了通行卡,则 API 会尝试返回通行证价格。如果未提供通行卡,API 会将通行卡视为未知,并尝试返回现金价格。仅适用于 DRIVE 和 TWO_WHEELER 出行方式。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eRoute modifiers allow specifying optional conditions like avoiding tolls, highways, ferries, or indoor navigation.\u003c/p\u003e\n"],["\u003cp\u003eThese modifiers primarily apply to \u003ccode\u003eDRIVE\u003c/code\u003e, \u003ccode\u003eTWO_WHEELER\u003c/code\u003e, and \u003ccode\u003eWALK\u003c/code\u003e travel modes.\u003c/p\u003e\n"],["\u003cp\u003eVehicle information, including emission type, can be provided for route calculation.\u003c/p\u003e\n"],["\u003cp\u003eToll pass details can be included to receive pass-specific pricing information.\u003c/p\u003e\n"]]],["The content details optional route conditions, including avoiding tolls, highways, ferries, and indoor navigation. These avoidance options are set using boolean values. Vehicle information, such as `emissionType`, can also be specified. The user can provide information regarding toll passes. The API will try to return the pass price for routes if toll passes are provided, and cash prices if not. These options apply to different travel modes.\n"],null,["# RouteModifiers\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [VehicleInfo](#VehicleInfo)\n - [JSON representation](#VehicleInfo.SCHEMA_REPRESENTATION)\n\nEncapsulates a set of optional conditions to satisfy when calculating the routes.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"avoidTolls\": boolean, \"avoidHighways\": boolean, \"avoidFerries\": boolean, \"avoidIndoor\": boolean, \"vehicleInfo\": { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteModifiers#VehicleInfo) }, \"tollPasses\": [ enum (/maps/documentation/routes_preferred/reference/rest/Shared.Types/TollPass) ] } ``` |\n\n| Fields ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `avoid``Tolls` | `boolean` When set to true, avoids toll roads where reasonable, giving preference to routes not containing toll roads. Applies only to the `DRIVE` and `TWO_WHEELER` travel modes. |\n| `avoid``Highways` | `boolean` When set to true, avoids highways where reasonable, giving preference to routes not containing highways. Applies only to the `DRIVE` and `TWO_WHEELER` travel modes. |\n| `avoid``Ferries` | `boolean` When set to true, avoids ferries where reasonable, giving preference to routes not containing ferries. Applies only to the `DRIVE` and`TWO_WHEELER` travel modes. |\n| `avoid``Indoor` | `boolean` When set to true, avoids navigating indoors where reasonable, giving preference to routes not containing indoor navigation. Applies only to the `WALK` travel mode. |\n| `vehicle``Info` | `object (`[VehicleInfo](/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteModifiers#VehicleInfo)`)` Specifies the vehicle information. |\n| `toll``Passes[]` | `enum (`[TollPass](/maps/documentation/routes_preferred/reference/rest/Shared.Types/TollPass)`)` Encapsulates information about toll passes. If toll passes are provided, the API tries to return the pass price. If toll passes are not provided, the API treats the toll pass as unknown and tries to return the cash price. Applies only to the `DRIVE` and `TWO_WHEELER` travel modes. |\n\nVehicleInfo\n-----------\n\nEncapsulates the vehicle information, such as the vehicle emission type.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"emissionType\": enum (/maps/documentation/routes_preferred/reference/rest/Shared.Types/VehicleEmissionType) } ``` |\n\n| Fields ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `emission``Type` | `enum (`[VehicleEmissionType](/maps/documentation/routes_preferred/reference/rest/Shared.Types/VehicleEmissionType)`)` Describes the vehicle's emission type. Applies only to the `DRIVE` [`RouteTravelMode`](/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode). |"]]