تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
المطوّرون في المنطقة الاقتصادية الأوروبية
يتم استخدام نقاط التوقف المؤقتة تلقائيًا للتوقف من أجل نقل الركّاب،
ولكن يمكنك أيضًا تحديد أنّ نقطة التوقف المؤقتة مخصّصة فقط
للمرور من خلالها.
إنّ المسار الذي يحتوي على نقطة إشارة لنقطة الانطلاق ونقطة إشارة عبور
ونقطة إشارة للوجهة يحتوي على مرحلة واحدة فقط من المسار
تربط بين نقطة الانطلاق والوجهة، أثناء المرور من خلال نقطة إشارة
(تُعرف باسم via) الوسيطة.
يمكنك ضبط نقطة طريق وسيطة لتكون نقطة طريق تمرير من خلال
ضبط السمة via لنقطة الطريق على true باستخدام إما
نقطة الطريق (REST) أو
نقطة الطريق (gRPC).
تكون السمة via الأكثر فعالية عند إنشاء مسارات استجابةً لشدّ المستخدِم للنقاط المرجعية على الخريطة. يتيح ذلك للمستخدم الاطّلاع على شكل المسار النهائي في الوقت الفعلي، ويساعد في ضمان وضع نقاط الطريق في مواقع يمكن الوصول إليها من خلال "مسارات الحوسبة".
يوضّح المثال التالي كيفية وضع علامة على نقطة مسار وسيطة باعتبارها نقطة مسار
عبور.
الوصول إلى أرقام تعريف الأماكن لنقاط الطريق الوسيطة
إذا حدّدت الموقع الجغرافي لنقطة بداية أو وجهة أو نقطة مسار وسيطة
بصفتها سلسلة عنوان أو رمز موقع مفتوح، تحاول واجهة برمجة التطبيقات العثور على
الموقع الجغرافي الأكثر صلةً الذي يتضمّن معرّف مكان متوافقًا. يحتوي صفيف
geocodingResults.intermediates
في النتائج على معرّف المكان المقابل لموقع نقاط الالتفاف
، بالإضافة إلى بيانات إضافية عن الموقع الجغرافي.
بالنسبة إلى كل عنصر من مصفوفة intermediates، استخدِم سمة
intermediateWaypointRequestIndex لتحديد نقطة الالتفاف
المتوسطة في الطلب التي تتوافق مع رقم تعريف المكان في الاستجابة.
على سبيل المثال:
يمكنك تحديد ثلاث نقاط مسار وسيطة في طلب. يتم تحديد نقطتَين من نقاط الالتفاف هذه باستخدام سلاسل عناوين ونقطة واحدة باستخدام إحداثيات خط العرض/خط الطول.
يمكنك تضمين geocodingResults في قناع حقل الاستجابة لتحديد
عرض صفيف geocodingResults في النتائج.
curl-XPOST-d'{"origin":{"address":"1600 Amphitheatre Parkway, Mountain View, CA"},"destination":{"address":"24 Willie Mays Plaza, San Francisco, CA 94107"},"intermediates":[{"address":"450 Serra Mall, Stanford, CA 94305, USA"},{"location":{"latLng":{"latitude":37.419734,"longitude":-122.0807784}}},{"address":"1836 El Camino Real, Redwood City, CA 94063"}],"travelMode":"DRIVE",}'-H'Content-Type:application/json'-H'X-Goog-Api-Key:YOUR_API_KEY'
-H'X-Goog-FieldMask:routes.duration,routes.distanceMeters,routes.legs,geocodingResults''https://routes.googleapis.com/directions/v2:computeRoutes'
يتضمّن الردّ صفيف geocodingResults الذي يحتوي على معرّف المكان ل
نقطة البداية والوجهة ونقطةَين من نقاط الالتفاف الثلاث. هذه هي نقاط الالتفاف في الفهرسَين 0 و2 من الطلب. بما أنّ نقطة الطريق في الفهرس 1 من
الطلب تم تحديدها باستخدام إحداثيات خط العرض/خط الطول، تم
حذفها من صفيف geocodingResults في الاستجابة.
تاريخ التعديل الأخير: 2025-06-20 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-06-20 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eIntermediate waypoints can be designated as pass-through points using the \u003ccode\u003evia\u003c/code\u003e property to avoid unnecessary stops.\u003c/p\u003e\n"],["\u003cp\u003eSetting \u003ccode\u003evia\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e allows for a more direct route, but may result in detours or route calculation failures if the waypoint is inaccessible.\u003c/p\u003e\n"],["\u003cp\u003eWhen using address strings or Plus codes for waypoints, the API returns place IDs for these locations in the \u003ccode\u003egeocodingResults\u003c/code\u003e array.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egeocodingResults\u003c/code\u003e array helps identify the place IDs of waypoints, which can be useful for subsequent requests or analysis.\u003c/p\u003e\n"],["\u003cp\u003eWaypoints specified using latitude/longitude coordinates or place IDs are excluded from the \u003ccode\u003egeocodingResults\u003c/code\u003e array.\u003c/p\u003e\n"]]],[],null,["# Set a point for a route to pass through\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\nBy default, intermediate waypoints are used for stopping for pickups and\ndropoffs, but you can also specify that an intermediate waypoint is meant just\nto pass through.\n\nA route that contains an origin waypoint, a pass-through intermediate\nwaypoint, and a destination waypoint contains just one route leg that\nconnects the origin and the destination, while passing through the intermediate\n(called a `via`) waypoint.\n\nConfigure an intermediate waypoint to be a pass-through waypoint by\nsetting the `via` property of the waypoint to `true` using either\n[Waypoint](/maps/documentation/routes/reference/rest/v2/Waypoint) (REST) or\n[Waypoint](/maps/documentation/routes/reference/rpc/google.maps.routing.v2#waypoint) (gRPC).\n\nThe `via` property is most effective when creating routes in response to\nthe user dragging the waypoints on the map. Doing so allows the user to see how\nthe final route may look in real-time and helps ensure that waypoints are placed\nin locations that are accessible to the Compute Routes.\n| **Caution:** Using the `via:` prefix 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 Routes API is unable to create a route through that point.\n\nThe following example demonstrates how to mark an intermediate waypoint as a\npass-through waypoint. \n\n```cplint\n{\n \"location\": {\n \"latLng\": {\n \"latitude\":37.419734,\n \"longitude\":-122.0827784\n }\n },\n \"via\": true\n}\n```\n\nAccess place IDs for intermediate waypoints\n-------------------------------------------\n\nIf you specify the location of an origin, destination, or intermediate waypoint\nas an **address string** or as a **Plus code** , the API attempts to find the\nmost relevant location which has a corresponding place ID. The\n[`geocodingResults.intermediates`](/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes#geocodingresults)\narray in the results contains the place ID corresponding to the location of the\nwaypoints, along with additional data about the location.\n| **Note:** If a waypoint is specified as a place ID or as latitude/longitude coordinates, it is omitted from the place ID lookup results.\n\nFor each element of the `intermediates` array, use the\n`intermediateWaypointRequestIndex` property to determine which intermediate\nwaypoint in the request corresponds to the place ID in the response.\n\nFor example:\n\n- You specify three intermediate waypoints in a request. Two of these\n waypoints are specified by address strings and one by latitude/longitude\n coordinates.\n\n- You include `geocodingResults` in the response field mask to specify to\n return the `geocodingResults` array in the results.\n\n```json\ncurl -X POST -d '{\n \"origin\":{\n \"address\": \"1600 Amphitheatre Parkway, Mountain View, CA\"\n },\n \"destination\":{\n \"address\": \"24 Willie Mays Plaza, San Francisco, CA 94107\"\n },\n \"intermediates\": [\n {\n \"address\": \"450 Serra Mall, Stanford, CA 94305, USA\"\n },\n {\n \"location\":{\n \"latLng\":{\n \"latitude\": 37.419734,\n \"longitude\": -122.0807784\n }\n }\n },\n {\n \"address\": \"1836 El Camino Real, Redwood City, CA 94063\"\n }\n ],\n \"travelMode\": \"DRIVE\",\n}'\n-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: YOUR_API_KEY'\n-H 'X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.legs,geocodingResults'\n'https://routes.googleapis.com/directions/v2:computeRoutes'\n```\n\nThe response includes the `geocodingResults` array containing the place ID for\nthe origin, destination, and for two of the three waypoints. These are the\nwaypoints at index 0 and 2 of the request. Because the waypoint at index 1 of\nthe request was specified by using latitude/longitude coordinates, it is\nomitted from the `geocodingResults` array in the response. \n\n```json\n{\n \"routes\": [{...}],\n \"geocodingResults\": {\n \"origin\": {\n \"geocoderStatus\": {},\n \"type\": [\n \"premise\"\n ],\n \"placeId\": \"ChIJj38IfwK6j4ARNcyPDnEGa9g\"\n },\n \"destination\": {\n \"geocoderStatus\": {},\n \"type\": [\n \"premise\"\n ],\n \"placeId\": \"ChIJI7ES6tl_j4ARVpDZoXbWAiY\"\n },\n \"intermediates\": [\n {\n \"geocoderStatus\": {},\n \"intermediateWaypointRequestIndex\": 0,\n \"type\": [\n \"street_address\"\n ],\n \"placeId\": \"ChIJvdLMGyq7j4ARScE5tWX_C0Y\"\n },\n {\n \"geocoderStatus\": {},\n \"intermediateWaypointRequestIndex\": 2,\n \"type\": [\n \"premise\"\n ],\n \"placeId\": \"ChIJkTc0GKajj4AR9UMsOSHwGD0\"\n }\n ]\n }\n}\n```"]]