**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).

Waypoints may include location modifiers to change how routes are calculated, including
settings for `heading` and `sideOfRoad`.

> [!NOTE]
> **Note:** `heading` and `sideOfRoad` are mutually exclusive properties. You cannot use them together for the same location.

> [!CAUTION]
> **Caution:** Requests using `heading` and `sideOfRoad` are billed at a higher rate. [Learn more about billing for Routes API.](https://developers.google.com/maps/documentation/javascript/usage-and-billing.md.txt)

## Specify the vehicle heading

To define a waypoint, specify the geographic location using latitude/longitude coordinates.
You can also specify the direction you want the vehicle to head when it arrives at each
waypoint. Use this feature to ensure that the vehicle arrives on the same side of the road as
the consumer waiting to be picked up. When a heading is not specified, the vehicle can arrive on
the wrong side of the road.

Heading values are numbers that align with the compass directions, and therefore range
from zero to 359. For example, a value of 0 indicates a heading direction of due North.

> [!NOTE]
> **Note:** You can set heading only when using either the `DRIVING` or `TWO_WHEELER` travel modes, AND when specifying the location by using a latitude and longitude pair.

```javascript
  // Mountain View, CA
  const originLatLng = {lat: 37.422000, lng: -122.084058};
  // San Francisco, CA
  const destinationLatLng = {lat: 37.774929, lng: -122.419415};
  // Half Moon Bay, CA
  const viaLatLng = {lat: 37.450733, lng: -122.430281, heading: 330};

  // Define a computeRoutes request.
  const requestWithLatLngs = {
    origin: originLatLng,
    destination: destinationLatLng,
    intermediates: [
      {location: viaLatLng}
    ],
    fields: ['path'],
  };
  
```

## Specify a the side of road preference

A location defined by a latitude and longitude pair can correspond to a specific side of a road.
However, to support route optimization, a route can still set a stopover to be on the opposite
side of the road from the specified location.

Waypoints support the `sideOfRoad` property, which indicates that the waypoint
location has a preference for the vehicle to stop at the same side of road as specified by the
location.

Specify that the route uses the preferred side of the road by setting the `sideOfRoad`
property to `true`. The route then passes through the location so that the vehicle
can stop at the side of road that the location is biased towards.

> [!NOTE]
> **Note:** You can set `sideOfRoad` only when using either the `DRIVING` or `TWO_WHEELER` travel modes, AND when specifying the location by using a latitude and longitude pair.

The following example shows how to set `sideOfRoad` for a waypoint:

```javascript
const sideOfRoadLatLng = {
  location: {
    lat: 37.450733,
    lng: -122.430281,
  },
  sideOfRoad: true,
};
  
```