با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
توسعه دهندگان منطقه اقتصادی اروپا (EEA).
نقاط راه ممکن است شامل تعدیلکنندههای مکان باشند تا نحوه محاسبه مسیرها را تغییر دهند، از جمله تنظیمات heading و sideOfRoad .
عنوان وسیله نقلیه را مشخص کنید
برای تعریف یک نقطه، مکان جغرافیایی (REST) یا مکان (gRPC) را به عنوان یک جفت مختصات طول و عرض جغرافیایی مشخص می کنید.
مکان همچنین به شما امکان می دهد جهتی را که می خواهید وسیله نقلیه هنگام رسیدن به هر نقطه بین راهی حرکت کند، مشخص کنید. شما می توانید از این ویژگی برای اطمینان از رسیدن خودرو به همان سمت جاده استفاده کنید که مصرف کننده منتظر تحویل گرفتن است. وقتی مسیری را مشخص نمی کنید، وسیله نقلیه می تواند در سمت اشتباه جاده برسد.
مقادیر سرفصل اعداد کاملی هستند که با جهت های قطب نما همسو می شوند و بنابراین از صفر تا 359 متغیر هستند. به عنوان مثال، مقدار 0 جهت شمال را نشان می دهد.
مثال زیر نشان می دهد که چگونه یک heading برای یک ایستگاه بین راه تعیین کنید.
شما یک مکان را با ایجاد یک شیء Waypoint (REST) یا Waypoint (gRPC) نشان می دهید. مکانی که توسط یک جفت طول و عرض جغرافیایی تعریف میشود، میتواند با یک سمت خاص جاده مطابقت داشته باشد. با این حال، برای پشتیبانی از بهینهسازی مسیر، یک مسیر همچنان میتواند توقفگاهی را در سمت مخالف جاده نسبت به مکان مشخص شده تعیین کند.
نقاط راه از ویژگی sideOfRoad پشتیبانی میکنند، که نشان میدهد مکان ایستگاه بین راهی برای توقف خودرو در همان سمت جاده که توسط مکان مشخص شده است، ترجیح دارد.
با تنظیم ویژگی Waypoint sideOfRoad روی true مشخص کنید که مسیر از سمت ترجیحی جاده استفاده کند. سپس مسیر از محل می گذرد تا وسیله نقلیه بتواند در کنار جاده ای که مکان به سمت آن سوگیری دارد متوقف شود.
مثال زیر نحوه تنظیم sideOfRoad برای یک ایستگاه بین راه را نشان می دهد.
تاریخ آخرین بهروزرسانی 2025-07-22 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-22 بهوقت ساعت هماهنگ جهانی."],[[["\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```"]]