设置沿途停留点
如需沿路线设置经停点(例如上车点或下车点),您可以将某个航点指定为经停点航点。为此,请使用航点的 vehicleStopover
属性,即 Waypoint (REST) 或 Waypoint (gRPC)。此设置可确保计算出的路线不会从不适合上车点和下车点的道路(例如高速公路或隧道)开始或结束。
假设地面道路与隧道内的道路相交。如果您指定位于这两条道路相交处的航点(如地图上所示),则生成的路线将从地面道路或隧道开始或结束。这会导致问题,因为您无法在隧道中停车上下客。
如果您想将路点用于上车点或下车点,请将 vehicleStopover
字段设置为 true
,以确保生成的路线始于或终于允许上车点或下车点的道路。
以下示例演示了如何设置 vehicleStopover
属性:
{
"origin":{
"location":{
"latLng":{
"latitude": 37.419734,
"longitude": -122.0827784
}
},
"vehicleStopover": true
},
...
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-06。
[null,null,["最后更新时间 (UTC):2025-02-06。"],[[["Use the `vehicleStopover` property to designate a waypoint as a stopover for pickups or drop-offs, ensuring the route avoids unsuitable roads like highways or tunnels."],["Requests utilizing the `vehicleStopover` property incur higher billing rates compared to standard route requests."],["Setting `vehicleStopover` to `true` guarantees the route starts or ends on a road suitable for pickups and drop-offs, avoiding issues with waypoints located near tunnels or highways."],["The `vehicleStopover` property is crucial for optimizing routes for vehicles that require specific pickup and drop-off locations."]]],[]]