<iframe src="https://developers.devsite.google/frame/maps/documentation/javascript/reference/journey-sharing-shipment-tracking_138329b06034bb83b82c040a9d6bc6f8c22c44c4f2fa79fea7ad67d7ce0af9a2.frame" class="framebox inherit-locale redirect-iframe" allow="clipboard-write https://developers.devsite.google" allowfullscreen is-upgraded></iframe>

## [FleetEngineShipmentLocationProvider](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-shipment-tracking.md.txt#FleetEngineShipmentLocationProvider)
class


class
`google.maps.journeySharing.FleetEngineShipmentLocationProvider`
extends `PollingLocationProvider, LocationProvider`

library `"journeySharing"`

Shipment location provider.

```javascript
const {FleetEngineShipmentLocationProvider} = await google.maps.importLibrary("journeySharing");
```

| ### Constructor ||
|---|---|
| `FleetEngineShipmentLocationProvider` | `FleetEngineShipmentLocationProvider(options)` **Parameters:** - `options: FleetEngineShipmentLocationProviderOptions` Options for the location provider. Creates a new location provider for Fleet Engine shipment tracking. |

| ### Properties ||
|---|---|
| `trackingId` | **Type:** `string` The tracking ID for the task that this location provider observes. Set this field to begin tracking. |

| ### Methods ||
|---|---|
| `refresh` | `refresh()` **Parameters:** None **Return Value:** `void` Explicitly refreshes the tracked location. |

| ### Events ||
|---|---|
| `error` | `function(event)` **Arguments:** - `event: ErrorEvent` Event that is triggered when the location provider encounters an error. |
| `update` | `function(event)` **Arguments:** - `event: FleetEngineShipmentLocationProviderUpdateEvent` Event that is triggered when a Fleet Engine data update request has finished. |

## [FleetEngineShipmentLocationProviderOptions](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-shipment-tracking.md.txt#FleetEngineShipmentLocationProviderOptions)
interface


interface
`google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions`

Options for shipment location provider.

| ### Properties ||
|---|---|
| `authTokenFetcher` | **Type:** `AuthTokenFetcher` Provides JSON Web Tokens for authenticating the client to Fleet Engine. |
| `projectId` | **Type:** `string` The consumer's project ID from Google Cloud Console. |
| `activePolylineCustomization` optional | **Type:** `(function(ShipmentPolylineCustomizationFunctionParams): void)|PolylineOptions optional` Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through. Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling). - If a `PolylineOptions` object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist. - If a function is specified, it is invoked once when the polyline is created. (On this invocation, the `isNew` parameter in the function parameters object is set to `true`.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed. See `ShipmentPolylineCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `deliveryVehicleMarkerCustomization` optional | **Type:** `(function(ShipmentMarkerCustomizationFunctionParams): void)|MarkerOptions optional` Customization applied to the delivery vehicle marker. Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling). - If a `MarkerOptions` object is specified, the changes specified in it are applied to the marker after the marker has been created, overwriting its default options if they exist. - If a function is specified, it is invoked once when the marker is created, before it is added to the map view. (On this invocation, the `isNew` parameter in the function parameters object is set to `true`.) Additionally, this function is invoked when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this marker have changed. See `ShipmentMarkerCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `destinationMarkerCustomization` optional | **Type:** `(function(ShipmentMarkerCustomizationFunctionParams): void)|MarkerOptions optional` Customization applied to the destination marker. Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling). - If a `MarkerOptions` object is specified, the changes specified in it are applied to the marker after the marker has been created, overwriting its default options if they exist. - If a function is specified, it is invoked once when the marker is created, before it is added to the map view. (On this invocation, the `isNew` parameter in the function parameters object is set to `true`.) Additionally, this function is invoked when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this marker have changed. See `ShipmentMarkerCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `pollingIntervalMillis` optional | **Type:** `number optional` Minimum time between fetching location updates in milliseconds. If it takes longer than `pollingIntervalMillis` to fetch a location update, the next location update is not started until the current one finishes. Setting this value to 0, Infinity, or a negative value disables automatic location updates. A new location update is fetched once if the tracking ID parameter (for example, the shipment tracking ID of the shipment location provider), or a filtering option (for example, viewport bounds or attribute filters for fleet location providers) changes. The default, and minimum, polling interval is 5000 milliseconds. If you set the polling interval to a lower positive value, 5000 is stored and used. |
| `remainingPolylineCustomization` optional | **Type:** `(function(ShipmentPolylineCustomizationFunctionParams): void)|PolylineOptions optional` Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through. Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling). - If a `PolylineOptions` object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist. - If a function is specified, it is invoked once when the polyline is created. (On this invocation, the `isNew` parameter in the function parameters object is set to `true`.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed. See `ShipmentPolylineCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `takenPolylineCustomization` optional | **Type:** `(function(ShipmentPolylineCustomizationFunctionParams): void)|PolylineOptions optional` Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through. Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling). - If a `PolylineOptions` object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist. - If a function is specified, it is invoked once when the polyline is created. (On this invocation, the `isNew` parameter in the function parameters object is set to `true`.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed. See `ShipmentPolylineCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `trackingId` optional | **Type:** `string optional` The tracking ID of the task to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any task; use `FleetEngineShipmentLocationProvider.trackingId` to set the tracking ID and begin tracking. |

## [FleetEngineShipmentLocationProviderUpdateEvent](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-shipment-tracking.md.txt#FleetEngineShipmentLocationProviderUpdateEvent)
interface


interface
`google.maps.journeySharing.FleetEngineShipmentLocationProviderUpdateEvent`

The event object passed to the event handler when the `FleetEngineShipmentLocationProvider.update` event is triggered.

| ### Properties ||
|---|---|
| `taskTrackingInfo` optional | **Type:** `TaskTrackingInfo optional` The task tracking info structure returned by the update. Unmodifiable. |