**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt).

By default, intermediate waypoints are used for stopping for pickups and
dropoffs, but you can also specify that an intermediate waypoint is meant just
to pass through.

A route that contains an origin waypoint, a pass-through intermediate
waypoint, and a destination waypoint contains just one route leg that
connects the origin and the destination, while passing through the intermediate
(called a `via`) waypoint.

Configure an intermediate waypoint to be a pass-through waypoint by
setting the `via` property of the waypoint to `true` using the
[Waypoint](https://developers.google.com/maps/documentation/javascript/reference/route.md.txt#Waypoint) interface.

The `via` property is most effective when creating routes in response to
the user dragging the waypoints on the map. Doing so allows the user to see how
the final route may look in real-time and helps ensure that waypoints are placed
in locations that are accessible to the Routes library.

> [!CAUTION]
> **Caution:** Using the `via` field to avoid stopovers results in routes that are strict in their interpretation of the waypoint. This interpretation may result in severe detours on the route or `ZERO_RESULTS` in the response status code if the Maps JavaScript API is unable to create a route through that point.

## Example request

The following example request demonstrates how to mark an intermediate waypoint as a
pass-through waypoint.

```javascript
const routeRequestWithVia = {
  origin: '100 Moffett Blvd, Mountain View, CA 94043',
  destination: '1199 9th Ave, San Francisco, CA 94122',
  travelMode: 'DRIVING',
  intermediates: [
    {location: 'Half Moon Bay, CA', via: true} // Set the via property to true
  ],
  fields: ['path', 'legs'],
};

// Make the request.
const {routes, fallbackInfo, geocodingResults} = await Route.computeRoutes(routeRequestWithIntermediates);
  
```

## Access place IDs for intermediate waypoints

If you specify the location of an origin, destination, or intermediate waypoint as an
**address string** or as a **Plus code** , the Routes library
attempts to find the most relevant location which has a corresponding place ID. The `geocodingResults.intermediates`
array in the results contains the place ID corresponding to the location of the waypoints, along
with additional data about the location.

> [!NOTE]
> **Note:** If a waypoint is specified as a place ID or as latitude/longitude coordinates, it is omitted from the place ID lookup results.

### Example geocoding results response

```javascript
{
  "origin": {
    "geocoderStatus": "OK",
    "types": [
      "premise",
      "street_address"
    ],
    "partialMatch": false,
    "placeId": "ChIJb5NgcTa3j4ARrfF4Oc_f6q8",
    "intermediateWaypointRequestIndex": null
  },
  "destination": {
    "geocoderStatus": "OK",
    "types": [
      "premise",
      "street_address"
    ],
    "partialMatch": false,
    "placeId": "ChIJAbIPLl2HhYARQ0SSdDFxU-s",
    "intermediateWaypointRequestIndex": null
  },
  "intermediates": [
    {
      "geocoderStatus": "OK",
      "types": [
        "locality",
        "political"
      ],
      "partialMatch": false,
      "placeId": "ChIJC8sZCqULj4ARVJvnNcic_V4",
      "intermediateWaypointRequestIndex": 0
    }
  ]
}
  
```