设置沿途停留点
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需沿路线设置经停点(例如上车点或下车点),您可以将某个航点指定为经停点航点。为此,请使用航点的 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-06-20。
[null,null,["最后更新时间 (UTC):2025-06-20。"],[[["\u003cp\u003eUse the \u003ccode\u003evehicleStopover\u003c/code\u003e property to designate a waypoint as a stopover for pickups or drop-offs, ensuring the route avoids unsuitable roads like highways or tunnels.\u003c/p\u003e\n"],["\u003cp\u003eRequests utilizing the \u003ccode\u003evehicleStopover\u003c/code\u003e property incur higher billing rates compared to standard route requests.\u003c/p\u003e\n"],["\u003cp\u003eSetting \u003ccode\u003evehicleStopover\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e guarantees the route starts or ends on a road suitable for pickups and drop-offs, avoiding issues with waypoints located near tunnels or highways.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003evehicleStopover\u003c/code\u003e property is crucial for optimizing routes for vehicles that require specific pickup and drop-off locations.\u003c/p\u003e\n"]]],["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,[]]