ภาพรวมคลาส Route Matrix
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
บทนำ
คลาส RouteMatrix
จะแสดงระยะทางและเวลาในการเดินทางสำหรับเมทริกซ์
ของเส้นทางระหว่างต้นทางและปลายทางที่แตกต่างกัน คำนวณเวลาในการเดินทางและ
ระยะทางสำหรับหลายๆ จุดหมายปลายทางได้สูงสุด 625 องค์ประกอบของเส้นทาง
หากต้องการเส้นทางการขับขี่ หากสนใจเส้นทาง ให้ใช้
คลาสเส้นทาง
กำลังย้ายข้อมูลใช่ไหม หากคุณย้ายข้อมูลจาก Distance Matrix Service (เดิม)
ไปยังคลาส RouteMatrix
โปรดดู
ย้ายข้อมูลไปยังคลาสเมตริกเส้นทาง
เหตุใดจึงต้องใช้RouteMatrix
คลาส
ด้วยคลาส RouteMatrix
คุณจะกำหนดเส้นทางที่มีประสิทธิภาพที่สุดสำหรับการกำหนดเวลาการจัดส่งได้ เช่น
- วิธีที่ดีที่สุดในการมอบหมายให้กลุ่มคนงานรับพัสดุหลายชิ้น
- กำหนดคลังสินค้าที่ดีที่สุดในการจัดส่งพัสดุไปยังปลายทางสุดท้าย
คุณทำอะไรได้บ้างในRouteMatrix
ชั้นเรียน
RouteMatrix
คลาสช่วยให้คุณรับเมทริกซ์ของเส้นทางที่เป็นไปได้
ระหว่างจุดเริ่มต้นและจุดสิ้นสุดหลายแห่ง คุณระบุต้นทางและปลายทางได้หลายรายการต่อคำขอฝั่งเซิร์ฟเวอร์ โดยมีจำนวนต้นทางคูณด้วยจำนวนปลายทางสูงสุด 625 รายการ
คุณขอข้อมูลเส้นทางประเภทนี้เพื่อพิจารณาวิธีที่มีประสิทธิภาพมากที่สุดในการกำหนดเส้นทาง
ผู้โดยสาร การจัดส่ง หรือคนทำงานระหว่างต้นทางและปลายทางหลายแห่งได้
- ระยะทางเป็นกิโลเมตรหรือไมล์สำหรับโหมดการเดินทางที่เลือก
- เวลาเดินทางโดยประมาณในการจราจร
ขั้นตอนถัดไป
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[null,null,["อัปเดตล่าสุด 2025-08-27 UTC"],[],[],null,["**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\nIntroduction\n\nThe `RouteMatrix` class returns distances and travel times for a matrix\nof routes between different origin and destination locations. Calculate travel times and\ndistances for multiple destinations for up to 625 route elements.\n\n**Need Driving Routes?** If you are interested in route directions, use the\n[Route class](/maps/documentation/javascript/routes/route-class-overview).\n\n**Migrating?** If you are migrating from the Distance Matrix Service (Legacy)\nto the `RouteMatrix` class, see\n[Migrate to the Route Matrix class](/maps/documentation/javascript/routes/route-matrix-js-migration).\n\nWhy use the `RouteMatrix` class?\n\nWith the `RouteMatrix` class, you can determine the most efficient routes for dispatch\nscheduling, such as:\n\n- How best to assign a set of workers to pick up a series of packages\n- Determine the best warehouse from which to ship packages to their final destination\n\nWhat can you do with the `RouteMatrix` class?\n\nWith the `RouteMatrix` class, you can get a matrix of possible\nroutes between many start and end locations. You can specify multiple origins and\ndestinations per server-side request with the number of origins times the number of\ndestinations up to 625.\n\nYou can request these kinds of route data to determine the most efficient way to route\npassengers, shipments, or workers between multiple origins and destinations:\n\n- Distance in kilometers or miles for a selected travel mode\n- Estimated travel time in traffic\n\nNext steps\n\n- [Get started](/maps/documentation/javascript/routes/start)\n- [Get a route matrix](/maps/documentation/routes/get-route-matrix)"]]