ภาพรวมงานที่กำหนดเวลาไว้ของ SDK ของผู้บริโภค
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ปรับแต่งประสบการณ์ของผู้บริโภคสำหรับงานที่กำหนดเวลาไว้โดยอนุญาตให้ผู้บริโภค
ติดตามความคืบหน้าของการนำส่งหรือคำสั่งซื้อบริการที่กำหนดเวลาไว้
Consumer SDK สำหรับงานที่กำหนดเวลาคืออะไร
Consumer SDK เป็นฟีเจอร์ของ Fleet Engine สำหรับงานที่กำหนดเวลาไว้ ซึ่งมีชุดเครื่องมือสำหรับสร้างประสบการณ์ของผู้ใช้ด้วย ชุดเครื่องมือเหล่านี้ช่วยให้คุณ
สร้างการแสดงผลตามแผนที่เพื่อแสดงภาพความคืบหน้าของคนขับ
และแสดงสถานะของงานที่เชื่อมโยงกับจุดจอดที่กำหนดเวลาไว้ โดยออกแบบมาสำหรับกลุ่มเป้าหมายหลัก 2 กลุ่ม ได้แก่
- ผู้ใช้ปลายทางที่เป็นผู้บริโภคที่ต้องการทราบสถานะการนำส่งสำหรับคำสั่งจัดส่งแต่ละรายการ เอกสารนี้ครอบคลุมวิธีใช้ประสบการณ์ของผู้บริโภคดังกล่าวกับ Consumer SDK ใน JavaScript ซึ่งมีคลาส
FleetEngineShipmentLocationProvider
และอินเทอร์เฟซที่เกี่ยวข้อง
- ผู้ให้บริการยานพาหนะที่ต้องการติดตามสถานะการนำส่งและยานพาหนะสำหรับ
ยานพาหนะทั้งกอง ดูข้อมูลเกี่ยวกับการติดตามกลุ่มยานพาหนะได้ที่คู่มือการติดตามกลุ่มยานพาหนะ

เหตุผลที่ควรใช้ Consumer SDK สำหรับงานที่กำหนดเวลาไว้
การผสานรวม Consumer SDK เข้ากับแอปพลิเคชันสำหรับผู้บริโภคที่กำหนดเวลาไว้
จะช่วยให้คุณมอบประสบการณ์การใช้งานที่ครอบคลุมแก่ผู้บริโภค พร้อมการอัปเดตตำแหน่งแบบเกือบเรียลไทม์
และตำแหน่งที่ปรับตามถนน ผู้บริโภคจะเห็นรายละเอียดตำแหน่งและความคืบหน้าของยานพาหนะนำส่ง ซึ่งจะช่วยให้ทราบว่าสินค้าที่จัดส่งอยู่ตรงไหน
คุณใช้ Consumer SDK ทำอะไรได้บ้าง
ใช้ Consumer SDK เพื่อแชร์ข้อมูลการจัดส่งต่อไปนี้กับผู้บริโภค
- ตำแหน่งแบบเรียลไทม์ของยานพาหนะนำส่งบนแผนที่
- เวลาที่คาดว่าจะนำส่งพัสดุ ซึ่งปรับตามสถานการณ์ที่เปลี่ยนแปลง เช่น
การจราจร
- เส้นทางที่ยานพาหนะใช้
- ระยะทางและจำนวนจุดแวะพักที่เหลืออยู่ก่อนที่ระบบจะนำส่งสินค้า
นอกจากนี้ คุณยังสร้างประสบการณ์การใช้งานอื่นๆ ที่ราบรื่นสำหรับผู้บริโภคที่เปิดใช้ตำแหน่งภายในแอปหรือเว็บไซต์สำหรับผู้บริโภคได้โดยอิงตามข้อมูลตำแหน่งจาก Driver SDK ดูรายละเอียดเกี่ยวกับ Driver SDK ได้ที่ภาพรวมของงานที่กำหนดเวลาไว้ของ Driver SDK
คอมโพเนนต์ของ Consumer SDK
JavaScript Consumer SDK ประกอบด้วยคอมโพเนนต์ต่อไปนี้
- คอมโพเนนต์แผนที่ JavaScript ซึ่งเป็นตัวแทนแบบดรอปอินสำหรับเอนทิตี
google.maps.Map
มาตรฐาน
- คอมโพเนนต์ข้อมูลที่จะเชื่อมต่อกับ Fleet Engine
- คอมโพเนนต์สำหรับการแสดงภาพยานพาหนะและเส้นทางขณะที่ยานพาหนะเคลื่อนที่ไปยัง
จุดหมาย
- ฟีดข้อมูลดิบสำหรับเวลาถึงโดยประมาณของคนขับหรือระยะทางที่เหลือที่ต้องขับ
ตารางต่อไปนี้อธิบายองค์ประกอบต่างๆ
ส่วนประกอบ |
คำอธิบาย |
มุมมองแผนที่ |
มุมมองแผนที่จะแสดงความคืบหน้าของ
ยานพาหนะ และอัปเดตมุมมองเมื่อยานพาหนะเคลื่อนที่ไปตามเส้นทาง |
ผู้ให้บริการตำแหน่งการจัดส่ง |
ผู้ให้บริการติดตามการจัดส่งจะให้ฟีดตำแหน่งเพื่อให้แผนที่แสดงข้อมูลที่เป็นประโยชน์เกี่ยวกับการจัดส่งได้ เช่น สถานที่รับหรือนำส่งของการจัดส่ง รวมถึงตำแหน่งและเส้นทางของยานพาหนะนำส่ง
|
ตัวดึงข้อมูลโทเค็นการตรวจสอบสิทธิ์ |
ตัวดึงข้อมูลโทเค็นการตรวจสอบสิทธิ์จะรับ JSON Web Token (JWT) จากเซิร์ฟเวอร์แบ็กเอนด์เพื่อตรวจสอบสิทธิ์การเข้าถึงข้อมูลตำแหน่งที่จัดเก็บไว้ใน Fleet Engine คุณใช้ตัวดึงข้อมูลโทเค็นการตรวจสอบสิทธิ์เป็นส่วนหนึ่งของเว็บ
แอปพลิเคชันโดยใช้ไลบรารีการแชร์การเดินทางด้วย JavaScript โปรดทราบว่าคุณต้อง
ใช้บริการสร้าง JSON Web Token (JWT) สำหรับ Fleet Engine ในเซิร์ฟเวอร์แบ็กเอนด์ด้วย
|
ตัวเลือกรูปแบบแผนที่ |
คุณสามารถใช้ตัวเลือกการจัดรูปแบบที่กำหนดเองเพื่อเปลี่ยนการจัดรูปแบบเริ่มต้นของ
แผนที่ให้ตรงกับการจัดรูปแบบของเว็บแอปพลิเคชัน |
วิธีใช้ Consumer SDK
ขั้นตอนถัดไป
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eThe Consumer SDK enables businesses to provide customers with real-time visibility into the location and progress of their scheduled deliveries or service orders.\u003c/p\u003e\n"],["\u003cp\u003eThis SDK offers tools for creating map-based displays within consumer applications, showing the driver's location, estimated time of arrival, and route information.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can integrate the Consumer SDK to create a comprehensive and seamless delivery tracking experience for their customers, improving transparency and satisfaction.\u003c/p\u003e\n"],["\u003cp\u003eKey components of the SDK include a map view, a location provider, authentication mechanisms, and customizable styling options to tailor the experience.\u003c/p\u003e\n"],["\u003cp\u003eTo begin, developers need to set up the JavaScript Consumer SDK, follow a specific shipment for tracking, and customize the map interface as desired.\u003c/p\u003e\n"]]],[],null,["Tailor the consumer experience for scheduled tasks by allowing consumers to\nfollow the progress of their scheduled deliveries or service orders.\n\nWhat is the Consumer SDK for scheduled tasks?\n\nThe Consumer SDK is a feature of Fleet Engine for scheduled tasks that also\nincludes toolkits to create the consumer experience. These toolkits let you\ncreate map-based displays to visualize a driver's\nprogress and show the status of the task associated with a scheduled stop. It's\ndesigned for two primary audiences:\n\n- **Consumer end users** who want to know delivery status for an individual shipment order. This document covers how to implement that consumer experience with the Consumer SDK in JavaScript, which provides the `FleetEngineShipmentLocationProvider` class and associated interfaces.\n- **Fleet operators** who want to track the delivery and vehicle status for an entire fleet of vehicles. For information about tracking fleets, see the [Fleet tracking guide](/maps/documentation/mobility/operations/fleet-tracking).\n\nWhy use the Consumer SDK for scheduled tasks?\n\nIntegrating the Consumer SDK into your scheduled tasks consumer applications\nlets you provide a comprehensive consumer experience, with near real-time\nlocation updates and road-snapped positions. Your consumers can see the delivery\nvehicle's location and progress details that help them understand where their\nshipment is.\n\nWhat can you do with the Consumer SDK?\n\nUse the Consumer SDK to share the following shipment information with your\nconsumers:\n\n- Delivery vehicle's real-time position on a map.\n- ETA for package arrival, adjusted for changing circumstances, such as traffic.\n- Route the vehicle is taking.\n- Distance and number of stops remaining before their shipment is delivered.\n\nYou can also create other seamless geo-enabled consumer experiences inside your\nconsumer app or website based on location information from the Driver SDK. For\ndetails about the Driver SDK, see the\n[Driver SDK scheduled tasks overview](/maps/documentation/mobility/driver-sdk/scheduled).\n\nConsumer SDK components\n\nThe JavaScript Consumer SDK contains the following components:\n\n- A JavaScript map component that is a drop-in replacement for a standard `google.maps.Map` entity.\n- Data components to connect with Fleet Engine.\n- Components for visualization of the vehicle and route as it progresses to a destination.\n- Raw data feeds for a driver's ETA or the remaining distance to drive.\n\nThe following table describes the components.\n\n| Component | Description |\n|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Map view | The map view illustrates the progress of the vehicle, updating the view as the vehicle moves along its route. |\n| Shipment location provider | The shipment tracking provider provides a location feed so that the map can display useful information about the shipment, such as the pickup or delivery location of the shipment and the location and route of the delivery vehicle. |\n| Authentication token fetcher | The authentication token fetcher gets JSON Web Tokens (JWTs) from your backend server to authenticate access to the location data stored in Fleet Engine. You implement an authentication token fetcher as part of your web application using the JavaScript Journey Sharing Library. Note that you must also implement a JSON Web Token (JWT) creation service for Fleet Engine on your backend server. |\n| Map style options | You can use custom styling options to change the default styling of your map to match the styling of your web application. |\n\nHow to use the Consumer SDK\n\n|---|----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Set up the JavaScript Consumer SDK** | For more information, see [Set up the JavaScript Consumer SDK](/maps/documentation/mobility/journey-sharing/scheduled/shipment-tracking/setup). |\n| 2 | **Follow a shipment** | Learn how to initialize the map, start following a shipment, and stop following with appropriate clean up. See [Follow a shipment](/maps/documentation/mobility/journey-sharing/scheduled/shipment-tracking/follow). |\n| 3 | **Customize the map interface** | You can use the JavaScript Consumer SDK for scheduled tasks to customize the map interface, provide marker customization, or style polylines. See [Style a map](/maps/documentation/mobility/journey-sharing/scheduled/shipment-tracking/style-map), [Customize markers](/maps/documentation/mobility/journey-sharing/scheduled/shipment-tracking/customize-markers), and [Customize polylines](/maps/documentation/mobility/journey-sharing/scheduled/shipment-tracking/customize-polylines). |\n\nWhat's next\n\n- [Set up the JavaScript Consumer SDK](/maps/documentation/mobility/journey-sharing/scheduled/shipment-tracking/setup)"]]