Stay organized with collections
Save and categorize content based on your preferences.
European Economic Area (EEA) developers
Waypoints may include location modifiers to change how routes are calculated,
including settings for heading and sideOfRoad.
Specify the vehicle heading
To define a waypoint, you specify the geographic
Location (REST) or
Location (gRPC)
as a pair of latitude/longitude coordinates.
Location also lets you specify the direction you want the vehicle to head when
it arrives at each waypoint. You can use this feature to ensures that the
vehicle arrives on the same side of the road as the consumer waiting to be
picked up. When you don't specify a heading, the vehicle can arrive on the
wrong side of the road.
Heading values are whole 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.
The following example demonstrates how to set a
heading for a waypoint.
You represent a location by creating a Waypoint
(REST) or Waypoint (gRPC)
object. 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
Waypoint 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.
The following example shows how to set sideOfRoad for a waypoint.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eWaypoints can include \u003ccode\u003eheading\u003c/code\u003e and \u003ccode\u003esideOfRoad\u003c/code\u003e modifiers to influence route calculation, but these options cannot be used together for the same location and incur higher billing rates.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eheading\u003c/code\u003e specifies the vehicle's direction (0-359 degrees) upon arrival at a waypoint, ensuring it approaches from the desired side of the road, and is applicable to \u003ccode\u003eDrive\u003c/code\u003e or \u003ccode\u003eTwo-wheeler\u003c/code\u003e travel modes using latitude/longitude coordinates.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esideOfRoad\u003c/code\u003e, when set to \u003ccode\u003etrue\u003c/code\u003e, indicates a preference for the vehicle to stop on the same side of the road as the specified location, also applicable to \u003ccode\u003eDrive\u003c/code\u003e or \u003ccode\u003eTwo-wheeler\u003c/code\u003e travel modes.\u003c/p\u003e\n"]]],["Waypoints can include location modifiers like `heading` and `sideOfRoad` to influence route calculations. `Heading`, a 0-359 compass direction value, specifies the vehicle's arrival direction. `sideOfRoad` indicates a preference for the vehicle to stop on the same side of the road as the specified location. Both modifiers are only available for `Drive` or `Two-wheeler` modes and when using latitude/longitude pairs. `Heading` and `sideOfRoad` are incompatible. Using these modifiers will result in a higher billing rate.\n"],null,["# Specify vehicle heading and side of road\n\n**European Economic Area (EEA) developers** 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](/maps/comms/eea/faq).\n\nWaypoints may include location modifiers to change how routes are calculated,\nincluding settings for `heading` and `sideOfRoad`.\n| **Note:** `heading` and `sideOfRoad` are incompatible. You may not use them for the same location.\n| **Caution:** Requests using `heading` and `sideOfRoad` are billed at a higher rate. [Learn more about billing](/maps/documentation/routes/usage-and-billing) for Routes API.\n\nSpecify the vehicle heading\n---------------------------\n\nTo define a waypoint, you specify the geographic\n[Location](/maps/documentation/routes/reference/rest/v2/Location) (REST) or\n[Location](/maps/documentation/routes/reference/rpc/google.maps.routing.v2#location) (gRPC)\nas a pair of latitude/longitude coordinates.\n\nLocation also lets you specify the direction you want the vehicle to head when\nit arrives at each waypoint. You can use this feature to ensures that the\nvehicle arrives on the same side of the road as the consumer waiting to be\npicked up. When you don't specify a heading, the vehicle can arrive on the\nwrong side of the road.\n| **Note:** You can set `heading` only when using either the `Drive` or `Two-wheeler` travel modes, and when specifying the location by using a latitude and longitude pair.\n\nHeading values are whole numbers that align with the compass directions, and\ntherefore range from zero to 359. For example, a value of 0 indicates a heading\ndirection of due North.\n\nThe following example demonstrates how to set a\n[`heading`](/maps/documentation/routes/reference/rest/v2/Location) for a waypoint. \n\n```text\n{\n \"origin\":{\n \"location\":{\n \"latLng\":{\n \"latitude\": 37.419734,\n \"longitude\": -122.0827784\n },\n \"heading\": 127\n }\n },\n ...\n```\n\nSpecify a side of the road preference\n-------------------------------------\n\nYou represent a location by creating a [Waypoint](/maps/documentation/routes/reference/rest/v2/Waypoint)\n(REST) or [Waypoint](/maps/documentation/routes/reference/rpc/google.maps.routing.v2#waypoint) (gRPC)\nobject. A location defined by a latitude and longitude pair can correspond to a\nspecific side of a road. However, to support route optimization, a route can\nstill set a stopover to be on the opposite side of the road from the specified\nlocation.\n\nWaypoints support the [`sideOfRoad`](/maps/documentation/routes/reference/rest/v2/Waypoint) property, which\nindicates that the waypoint location has a preference for the vehicle to stop at\nthe same side of road as specified by the location.\n\nSpecify that the route uses the preferred side of the road by setting the\nWaypoint `sideOfRoad` property to `true`. The route then passes through the\nlocation so that the vehicle can stop at the side of road that the location is\nbiased towards.\n| **Note:** You can set the `sideOfRoad` only when using either the `Drive` or `Two-wheeler` travel modes.\n\nThe following example shows how to set `sideOfRoad` for a waypoint. \n\n```text\n{\n \"origin\":{\n \"location\":{\n \"latLng\":{\n \"latitude\": 37.419734,\n \"longitude\": -122.0827784\n }\n },\n \"sideOfRoad\": true\n },\n ...\n```"]]