RoutingSummary
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
משך הזמן והמרחק מנקודת המוצא של הניתוב למקום בתגובה, וחלק שני מהמקום הזה ליעד, אם הבקשה הזו נשלחה. הערה: הוספת routingSummaries
במסכת השדה בלי לכלול גם את הפרמטר routingParameters.origin
או את הפרמטר searchAlongRouteParameters.polyline.encodedPolyline
בבקשה גורמת לשגיאה.
ייצוג ב-JSON |
{
"legs": [
{
object (Leg )
}
],
"directionsUri": string
} |
שדות |
legs[] |
object (Leg )
השלבים של הנסיעה. כשמחשבים את משך הנסיעה ואת המרחק מנקודת מוצא מוגדרת, legs מכיל מקטע אחד שמכיל את משך הנסיעה ואת המרחק מנקודת המוצא ליעד. כשמבצעים חיפוש לאורך מסלול, השדה legs מכיל שתי קטעים: אחד מהמוצא למקום, והשני מהמקום ליעד.
|
directionsUri |
string
קישור להצגת מסלול הגעה במפות Google באמצעות נקודות העצירה מסיכום המסלול. אין ערובה שהמסלול שנוצר באמצעות הקישור הזה יהיה זהה למסלול ששימש ליצירת סיכום הניתוב. הקישור משתמש במידע שסופק בבקשה, משדות כמו routingParameters ו-searchAlongRouteParameters במקרים הרלוונטיים, כדי ליצור את הקישור לקבלת מסלול הגעה.
|
רגל
שלב הוא קטע יחיד במסע ממיקום אחד למיקום אחר.
ייצוג ב-JSON |
{
"duration": string,
"distanceMeters": integer
} |
שדות |
duration |
string (Duration format)
משך הזמן שנדרש כדי להשלים את הקטע הזה בנסיעה. משך הזמן בשניות, עם עד תשע ספרות עשרוניות, שמסתיימים ב-'s '. דוגמה: "3.5s" .
|
distanceMeters |
integer
המרחק של מקטע הנסיעה הזה.
|
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-31 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-31 (שעון UTC)."],[[["\u003cp\u003eRouting Summary provides the duration and distance between an origin and a destination, or between an origin, a place, and a destination when searching along a route.\u003c/p\u003e\n"],["\u003cp\u003eIt includes a directions URI for viewing the route on Google Maps.\u003c/p\u003e\n"],["\u003cp\u003eA Leg within the Routing Summary represents a portion of the journey, containing duration and distance in meters.\u003c/p\u003e\n"],["\u003cp\u003eWhen searching along a route, the \u003ccode\u003elegs\u003c/code\u003e field will contain two legs: one from the origin to the place and another from the place to the destination.\u003c/p\u003e\n"]]],["The content details routing summary data, including journey legs and a directions link. A routing summary contains \"legs,\" with each leg representing a portion of a journey. Each `leg` provides `duration` (time to complete the leg) and `distanceMeters`. The `directionsUri` field provides a Google Maps link for directions. When searching along a route, the summary includes two legs, otherwise it only includes one. Including `routingSummaries` in a request requires including an `origin` or `encodedPolyline` parameter.\n"],null,["# RoutingSummary\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Leg](#Leg)\n - [JSON representation](#Leg.SCHEMA_REPRESENTATION)\n\nThe duration and distance from the routing origin to a place in the response, and a second leg from that place to the destination, if requested. **Note:** Adding `routingSummaries` in the field mask without also including either the `routingParameters.origin` parameter or the `searchAlongRouteParameters.polyline.encodedPolyline` parameter in the request causes an error.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"legs\": [ { object (/maps/documentation/places/web-service/reference/rest/v1/RoutingSummary#Leg) } ], \"directionsUri\": string } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `legs[]` | `object (`[Leg](/maps/documentation/places/web-service/reference/rest/v1/RoutingSummary#Leg)`)` The legs of the trip. When you calculate travel duration and distance from a set origin, `legs` contains a single leg containing the duration and distance from the origin to the destination. When you do a search along route, `legs` contains two legs: one from the origin to place, and one from the place to the destination. |\n| `directionsUri` | `string` A link to show directions on Google Maps using the waypoints from the given routing summary. The route generated by this link is not guaranteed to be the same as the route used to generate the routing summary. The link uses information provided in the request, from fields including `routingParameters` and `searchAlongRouteParameters` when applicable, to generate the directions link. |\n\nLeg\n---\n\nA leg is a single portion of a journey from one location to another.\n\n| JSON representation |\n|-----------------------------------------------------------|\n| ``` { \"duration\": string, \"distanceMeters\": integer } ``` |\n\n| Fields ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `duration` | `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` The time it takes to complete this leg of the trip. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n| `distanceMeters` | `integer` The distance of this leg of the trip. |"]]