Specifica l'intestazione e il lato della strada del veicolo
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Sviluppatori dello Spazio economico europeo (SEE)
I waypoint possono includere modificatori di posizione per modificare il modo in cui vengono calcolati i percorsi,
incluse le impostazioni per heading e sideOfRoad.
Specifica la direzione del veicolo
Per definire una tappa, specifica la posizione (REST) o la posizione (gRPC) geografica come coppia di coordinate di latitudine/longitudine.
La posizione ti consente anche di specificare la direzione in cui vuoi che il veicolo si diriga quando
arriva a ogni tappa. Puoi utilizzare questa funzionalità per assicurarti che il
veicolo arrivi sullo stesso lato della strada del cliente in attesa di essere
prelevato. Se non specifichi una direzione, il veicolo può arrivare sul lato sbagliato della strada.
I valori di direzione sono numeri interi che corrispondono alle direzioni della bussola e
pertanto variano da zero a 359. Ad esempio, un valore pari a 0 indica una direzione
di rotta verso nord.
Il seguente esempio mostra come impostare un
heading per un waypoint.
Rappresenti una località creando un oggetto Waypoint
(REST) o Waypoint (gRPC). Una località definita da una coppia di latitudine e longitudine può corrispondere a un
lato specifico di una strada. Tuttavia, per supportare l'ottimizzazione del percorso, un percorso può
comunque impostare una sosta sul lato opposto della strada rispetto alla posizione
specificata.
Le tappe supportano la proprietà sideOfRoad, che
indica che la posizione della tappa ha una preferenza per la fermata del veicolo
sullo stesso lato della strada specificato dalla posizione.
Specifica che il percorso utilizza il lato preferito della strada impostando la proprietà
sideOfRoad della tappa su true. Il percorso passa quindi attraverso la
posizione in modo che il veicolo possa fermarsi sul lato della strada verso cui è
orientata la posizione.
Il seguente esempio mostra come impostare sideOfRoad per un waypoint.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-22 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```"]]