RoutingSummary
ระยะเวลาและระยะทางจากต้นทางการกำหนดเส้นทางไปยังสถานที่ในการตอบกลับ และระยะทางส่วนที่สองจากสถานที่นั้นไปยังปลายทาง หากขอ หมายเหตุ: การเพิ่ม routingSummaries
ในมาสก์ฟิลด์โดยไม่ใส่พารามิเตอร์ routingParameters.origin
หรือพารามิเตอร์ searchAlongRouteParameters.polyline.encodedPolyline
ไว้ในคําขอด้วยจะทําให้เกิดความผิดพลาด
การแสดง JSON |
{
"legs": [
{
object (Leg )
}
],
"directionsUri": string
} |
ช่อง |
legs[] |
object (Leg )
เที่ยวบินของการเดินทาง เมื่อคุณคำนวณระยะเวลาและระยะทางในการเดินทางจากต้นทางที่กำหนด legs จะมีเส้นทางเดียวที่มีระยะเวลาและระยะทางจากต้นทางไปยังปลายทาง เมื่อคุณค้นหาเส้นทาง legs จะมี 2 ช่วง ได้แก่ ช่วงจากต้นทางไปยังสถานที่ และอีกช่วงจากสถานที่ไปยังปลายทาง
|
directionsUri |
string
ลิงก์เพื่อแสดงเส้นทางใน Google Maps โดยใช้จุดแวะพักจากสรุปเส้นทางที่ระบุ เราไม่รับประกันว่าเส้นทางที่ลิงก์นี้สร้างขึ้นจะเหมือนกับเส้นทางที่ใช้สร้างสรุปการกำหนดเส้นทาง ลิงก์จะใช้ข้อมูลที่ระบุในคำขอจากช่องต่างๆ ซึ่งรวมถึง routingParameters และ searchAlongRouteParameters (หากมี) เพื่อสร้างลิงก์เส้นทาง
|
ขา
ส่วนคือส่วนของการเดินทางจากจุดหนึ่งไปยังอีกจุดหนึ่ง
การแสดง JSON |
{
"duration": string,
"distanceMeters": integer
} |
ช่อง |
duration |
string (Duration format)
เวลาที่ใช้ในการเดินทางขานี้ ระยะเวลาเป็นวินาทีที่มีเศษทศนิยมได้สูงสุด 9 หลัก โดยลงท้ายด้วย "s " เช่น "3.5s"
|
distanceMeters |
integer
ระยะทางของการเดินทางส่วนนี้
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-02-27 UTC
[null,null,["อัปเดตล่าสุด 2025-02-27 UTC"],[[["Routing 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."],["It includes a directions URI for viewing the route on Google Maps."],["A Leg within the Routing Summary represents a portion of the journey, containing duration and distance in meters."],["When searching along a route, the `legs` field will contain two legs: one from the origin to the place and another from the place to the destination."]]],["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"]]