设置沿途停留点
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需在路线中设置经停点(例如,用于上车或下车),请将某个途经点指定为经停途经点。为此,请使用航点(Waypoint [REST] 或 Waypoint [gRPC])的 vehicleStopover
属性。此设置可确保计算出的路线不会在不适合上下客的道路(例如高速公路或隧道)上开始或结束。
假设地面道路与隧道内的道路交叉。如果您指定一个位于两条道路交叉处的途经点(如地图所示),则生成的路线将从地面道路或隧道开始或结束。此结果会带来一个问题,因为您无法在隧道中停车接送乘客。
如果您想将途经点用于上车或下车,请将 vehicleStopover
字段设置为 true
,以确保生成的路线从允许上车和下车的道路开始或结束。
以下示例演示了如何设置 vehicleStopover
属性:
{
"origin":{
"location":{
"latLng":{
"latitude": 37.419734,
"longitude": -122.0827784
}
},
"vehicleStopover": true
},
...
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-13。
[null,null,["最后更新时间 (UTC):2025-09-13。"],[],["To designate a waypoint for pickup or drop-off, set the `vehicleStopover` property to `true` within the Waypoint object. This ensures the route begins or ends on a suitable road, avoiding locations like highways or tunnels. Setting `vehicleStopover` prevents routes from starting/ending on unsuitable roads. The `vehicleStopover` property is set within the Waypoint's JSON structure. Using `vehicleStopover` incurs a higher billing rate.\n"],null,[]]