Consumer SDK 排程工作總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
讓消費者追蹤預定送貨或服務訂單的進度,打造專屬的消費者體驗。
什麼是排定工作的 Consumer SDK?
Consumer SDK 是 Fleet Engine 的一項功能,適用於排定工作,並提供工具包,方便您打造消費者體驗。這些工具包可讓您建立地圖顯示畫面,以視覺化方式呈現駕駛人的進度,並顯示與預定停靠點相關聯的工作狀態。這項功能主要適用於兩類目標對象:
- 消費者使用者想瞭解個別出貨訂單的運送狀態。本文說明如何使用 JavaScript 中的 Consumer SDK 實作這項消費者體驗,該 SDK 提供
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 行程分享程式庫,在網頁應用程式中導入驗證權杖擷取器。請注意,您也必須在後端伺服器上為 Fleet Engine 實作 JSON Web Token (JWT) 建立服務。 |
地圖樣式選項 |
您可以透過自訂樣式選項,變更地圖的預設樣式,使其與網頁應用程式的樣式相符。 |
如何使用 Consumer SDK
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-12 (世界標準時間)。
[null,null,["上次更新時間:2025-08-12 (世界標準時間)。"],[[["\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)"]]