Tổng quan về việc cần làm đã lên lịch của SDK người tiêu dùng
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Điều chỉnh trải nghiệm của người tiêu dùng đối với các công việc theo lịch bằng cách cho phép người tiêu dùng theo dõi tiến trình giao hàng hoặc đơn đặt hàng dịch vụ theo lịch.
Consumer SDK là gì cho các tác vụ định kỳ?
Consumer SDK là một tính năng của Fleet Engine dành cho các tác vụ theo lịch trình, đồng thời bao gồm cả bộ công cụ để tạo trải nghiệm cho người tiêu dùng. Các bộ công cụ này cho phép bạn tạo màn hình dựa trên bản đồ để trực quan hoá tiến trình của người lái xe và cho biết trạng thái của nhiệm vụ liên quan đến một điểm dừng theo lịch. Nền tảng này được thiết kế cho 2 đối tượng chính:
- Người dùng cuối là người tiêu dùng muốn biết trạng thái giao hàng của một đơn đặt hàng riêng lẻ. Tài liệu này trình bày cách triển khai trải nghiệm người dùng đó bằng Consumer SDK trong JavaScript, cung cấp lớp
FleetEngineShipmentLocationProvider
và các giao diện liên kết.
- Đơn vị vận hành đội xe muốn theo dõi trạng thái giao hàng và trạng thái xe của toàn bộ đội xe. Để biết thông tin về cách theo dõi đội xe, hãy xem Hướng dẫn theo dõi đội xe.

Tại sao nên dùng Consumer SDK cho các tác vụ theo lịch?
Việc tích hợp Consumer SDK vào các ứng dụng tiêu dùng có tác vụ theo lịch biểu sẽ giúp bạn mang đến trải nghiệm toàn diện cho người tiêu dùng, với thông tin cập nhật vị trí gần như theo thời gian thực và các vị trí được điều chỉnh theo đường. Người tiêu dùng có thể xem vị trí và thông tin chi tiết về tiến trình của xe giao hàng, giúp họ biết được lô hàng của mình đang ở đâu.
Bạn có thể làm gì với Consumer SDK?
Sử dụng Consumer SDK để chia sẻ thông tin vận chuyển sau đây với người tiêu dùng:
- Vị trí theo thời gian thực của xe giao hàng trên bản đồ.
- Thời gian dự kiến giao hàng, được điều chỉnh theo các tình huống thay đổi, chẳng hạn như tình hình giao thông.
- Tuyến đường mà xe đang đi.
- Khoảng cách và số điểm dừng còn lại trước khi lô hàng được giao.
Bạn cũng có thể tạo những trải nghiệm liền mạch khác cho người tiêu dùng dựa trên vị trí trong ứng dụng hoặc trang web dành cho người tiêu dùng của mình dựa trên thông tin vị trí từ Driver SDK. Để biết thông tin chi tiết về Driver SDK, hãy xem bài viết Tổng quan về các tác vụ theo lịch của Driver SDK.
Các thành phần SDK dành cho người dùng
JavaScript Consumer SDK có các thành phần sau:
- Một thành phần bản đồ JavaScript là một giải pháp thay thế tức thì cho thực thể
google.maps.Map
tiêu chuẩn.
- Các thành phần dữ liệu để kết nối với Fleet Engine.
- Các thành phần để trực quan hoá xe và tuyến đường khi xe di chuyển đến một điểm đến.
- Nguồn cấp dữ liệu thô cho thời gian đến dự kiến của người lái xe hoặc quãng đường còn lại cần lái.
Bảng sau đây mô tả các thành phần.
Thành phần |
Mô tả |
Chế độ xem bản đồ |
Chế độ xem bản đồ minh hoạ tiến trình của xe, cập nhật chế độ xem khi xe di chuyển dọc theo tuyến đường. |
Nhà cung cấp vị trí giao hàng |
Nhà cung cấp dịch vụ theo dõi lô hàng cung cấp một nguồn cấp dữ liệu vị trí để bản đồ có thể hiển thị thông tin hữu ích về lô hàng, chẳng hạn như vị trí nhận hoặc giao lô hàng, cũng như vị trí và tuyến đường của xe giao hàng.
|
Trình tìm nạp mã thông báo xác thực |
Trình tìm nạp mã thông báo xác thực nhận JSON Web Token (JWT) từ máy chủ phụ trợ của bạn để xác thực quyền truy cập vào dữ liệu vị trí được lưu trữ trong Fleet Engine. Bạn triển khai một trình tìm nạp mã thông báo xác thực trong ứng dụng web bằng cách sử dụng Thư viện chia sẻ hành trình JavaScript. Xin lưu ý rằng bạn cũng phải triển khai dịch vụ tạo JSON Web Token (JWT) cho Fleet Engine trên máy chủ phụ trợ. |
Các lựa chọn về kiểu bản đồ |
Bạn có thể sử dụng các lựa chọn tạo kiểu tuỳ chỉnh để thay đổi kiểu mặc định của bản đồ cho phù hợp với kiểu của ứng dụng web. |
Cách sử dụng Consumer SDK
Bước tiếp theo
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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)"]]