[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Navigation SDK for Android now uses \u003ccode\u003eWaypoint.Builder\u003c/code\u003e to create waypoints with options for side-of-road routing and stopover preferences.\u003c/p\u003e\n"],["\u003cp\u003eYou can ensure arrival on the desired side of the road by setting \u003ccode\u003esetPreferSameSideOfRoad\u003c/code\u003e or providing an arrival heading using \u003ccode\u003esetPreferredHeading\u003c/code\u003e when building a waypoint.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esetVehicleStopover\u003c/code\u003e preference within \u003ccode\u003eWaypoint.Builder\u003c/code\u003e relocates waypoints to safer nearby locations if the initial location isn't suitable for stopping.\u003c/p\u003e\n"]]],[],null,["# Manage waypoints\n\n| **Notice:** `fromLatLng()` and `fromPlaceId()`\n| are deprecated, but will remain available with no further updates. We\n| recommend migrating to the new [`Waypoint.Builder`](/maps/documentation/navigation/android-sdk/reference/com/google/android/libraries/navigation/Waypoint.Builder).\n\nBy default, the Navigation SDK for Android finds the quickest route to a\nwaypoint, however this doesn't guarantee that the vehicle will arrive on the\nside of the road that the consumer is waiting on or that the arrival place is\nsafe for the driver to stop at. This guide describes two feature you can use for\nthese situations:\n\n- **Side of the road routing preference**\n- **Stopover feature**\n\nSide of the route routing preference\n------------------------------------\n\nYou can set a preference for arriving on a particular side of the\nroad when you create a waypoint for a stop. You can specify the preference\nin one of two ways: prefer the same side of the road, or provide an arrival\nheading.\n\n### Prefer the same side of the road\n\nYou provide the geographic coordinates of the waypoint, and then set a flag\n(`setPreferSameSideOfRoad`) that indicates that you prefer to arrive on the same\nside of the road as the waypoint---snapped to the nearest sidewalk. \n\n Waypoint waypoint =\n Waypoint.builder()\n .setLatLng(latitude, longitude)\n .setTitle(\"Somewhere in Sydney\")\n .setPreferSameSideOfRoad(true)\n .build()\n\n| **Key Point:** In some situations, when the waypoint is snapped to the side of the nearest road, the nearest road might not be the right one. For example, it might be a road around the corner from the waiting consumer. You can prevent this from occurring by using `setPreferredHeading` instead of `setPreferSameSideOfRoad` (see the next section for details).\n\n### Set an arrival heading\n\nYou provide the geographic coordinates of the waypoint, and then provide an\narrival heading (`setPreferredHeading`) that matches the direction of\ntraffic flow on the same side of the road as the waiting consumer. \n\n Waypoint waypoint =\n Waypoint.builder()\n .setLatLng(latitude, longitude)\n .setTitle(\"Somewhere in Sydney\")\n .setPreferredHeading(preferredHeading)\n .build()\n\nThe Navigation SDK chooses the road segment closest to the\nwaypoint---that has a lane direction that aligns (within +/- 55 degrees) with the\nside of the road that the waypoint is on.\n\nSet stopover preference\n-----------------------\n\nIn certain places, it's not possible for drivers to stop safely (for example,\nelevated areas, ferries, underground locations, and other areas of limited\naccess). The **Stopover** feature relocates the waypoint to a nearby place if\nits location is not suitable for a vehicle to make a stop. When you set\n`setVehicleStopover` to `true`, the waypoint is automatically relocated when\nthe route is calculated, if an alternate location is available.\n\n### How it works\n\nYou set the preference for a stopover when creating the waypoint for that stop.\nTo do this, specify the `setVehicleStopover` preference as shown in the\nfollowing example: \n\n Waypoint waypoint =\n Waypoint.builder()\n .setLatLng(latitude, longitude)\n .setTitle(\"Somewhere in Sydney\")\n .setVehicleStopover(true)\n .build()"]]