Get a Maps Demo Key: Try out select Maps JavaScript API and Places UI Kit features at no cost with a Maps Demo Key—no billing information required.

Set a stop along a route

European Economic Area (EEA) developers

To set a stop along a route, for example, for a pickup or dropoff, you designate a waypoint as a stopover waypoint. To do this, use the vehicleStopover property of a waypoint. This setting ensures that the calculated route doesn't begin or end on a road that is unsuitable for pickup and drop-off, such as a highway or tunnel.

Consider the situation where a surface road crosses over a road inside a tunnel. If you were to specify a waypoint located where the two roads intersect (as seen on a map), then the resulting route would begin or end on either the surface road or the tunnel. This result presents a problem because you can't stop in tunnels to make pickups or drop-offs.

If you want to use the waypoint for a pickup or drop-off, then you can set the vehicleStopover field to true to ensure that the resulting route begins or ends on a road that allows pickups and drop-offs.

The following example request shows how to set a stopover waypoint:

constrouteRequestWithIntermediates={
origin:'Mountain View, CA',
destination:'San Francisco, CA',
travelMode:'DRIVING',
intermediates:[
{location:'San Mateo, CA'},
{location:'Half Moon Bay, CA',vehicleStopover:true}
],
fields:['path','legs'],
};

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年09月01日 UTC.