Routes Preferred API 目前仅适用于部分客户。如需了解详情,请
与销售人员联系。
ComputeCustomRoutesRequest
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ComputeCustomRoutes 请求消息。
JSON 表示法 |
{
"origin": {
object (Waypoint )
},
"destination": {
object (Waypoint )
},
"intermediates": [
{
object (Waypoint )
}
],
"travelMode": enum (RouteTravelMode ),
"routingPreference": enum (RoutingPreference ),
"polylineQuality": enum (PolylineQuality ),
"polylineEncoding": enum (PolylineEncoding ),
"departureTime": string,
"routeModifiers": {
object (RouteModifiers )
},
"routeObjective": {
object (RouteObjective )
},
"languageCode": string,
"units": enum (Units )
} |
字段 |
origin |
object (Waypoint )
必需。起点航点。
|
destination |
object (Waypoint )
必需。目的地航点。
|
intermediates[] |
object (Waypoint )
可选。路线上(不包括终点)的一组航点,用于停靠或经过。最多支持 25 个中间航点。
|
travelMode |
enum (RouteTravelMode )
可选。指定交通方式。仅支持 DRIVE 和“TWO_WHEELER”。
|
routingPreference |
enum (RoutingPreference )
可选。指定如何计算路线。服务器会尝试使用所选的路由偏好设置来计算路由。如果路由偏好设置导致错误或延迟时间过长,则会返回错误。只有当 travelMode 为 DRIVE 或 TWO_WHEELER 时,您才能指定此选项,否则请求会失败。
|
polylineQuality |
enum (PolylineQuality )
可选。指定多段线的质量偏好设置。
|
polylineEncoding |
enum (PolylineEncoding )
可选。指定多段线的首选编码。
|
departureTime |
string (Timestamp format)
可选。出发时间。如果未设置此值,则此值默认为您发出请求的时间。如果将此值设置为已经发生的时间,则请求将失败。 时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
routeModifiers |
object (RouteModifiers )
可选。一组要满足的条件,这些条件会影响路线的计算方式。
|
routeObjective |
object (RouteObjective )
必需。要优化的路线目标。
|
languageCode |
string
可选。BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 Unicode 语言区域标识符。如需查看支持的语言列表,请参阅语言支持。如果您未提供此值,系统会根据路线请求的位置推断出显示语言。
|
units |
enum (Units )
可选。指定显示字段的测量单位。这包括 NavigationInstruction 中的 instruction 字段。路线、路段、步数距离和时长所用的衡量单位不受此值的影响。如果您未提供此值,系统会根据请求的位置推断出显示单位。
|
RouteObjective
封装要按 ComputeCustomRoutes
进行优化的目标。
JSON 表示法 |
{
// Union field objective can be only one of the following:
"rateCard": {
object (RateCard )
}
// End of list of possible types for union field objective .
} |
字段 |
联合字段 objective 。路线目标。objective 只能是下列其中一项: |
rateCard |
object (RateCard )
费率卡目标。
|
RateCard
JSON 表示法 |
{
"costPerMinute": {
object (MonetaryCost )
},
"costPerKm": {
object (MonetaryCost )
},
"includeTolls": boolean
} |
字段 |
costPerMinute |
object (MonetaryCost )
可选。每分钟费用。
|
costPerKm |
object (MonetaryCost )
可选。每公里费用。
|
includeTolls |
boolean
可选。是否在总费用中包含通行费。
|
MonetaryCost
JSON 表示法 |
{
"value": number
} |
字段 |
value |
number
必需。从请求推断出的费用值(本地货币)。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-11。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-11-11。"],[[["The `ComputeCustomRoutes` request message allows you to define routes based on various criteria, including origin, destination, waypoints, travel mode and routing preferences."],["You can optimize routes for specific objectives, such as using a `RateCard` to minimize cost based on time and distance."],["`RateCard` allows you to specify costs per minute and kilometer, and whether to include tolls in the calculation."],["The `MonetaryCost` object represents the cost value in local currency for use within the `RateCard`."]]],["The core content outlines the `ComputeCustomRoutes` request, detailing how to define a route and its optimization parameters. Key actions include specifying the `origin`, `destination`, and optional `intermediates` via waypoints. Users can select `travelMode`, `routingPreference`, `polylineQuality`, and `polylineEncoding`. `departureTime` can be set. The `routeObjective`, which can use a `RateCard`, including `costPerMinute`, `costPerKm`, and if to include tolls, defines optimization goals. `MonetaryCost` is used to define cost for rate cards. `languageCode` and `units` are also supported.\n"]]