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

## [FleetEngineTripLocationProvider](https://developers.google.com/maps/documentation/javascript/reference/3.63/journey-sharing-trip-and-order-progress.md.txt#FleetEngineTripLocationProvider)
class


`google.maps.journeySharing.FleetEngineTripLocationProvider`
class

Trip location provider.

This class extends
`PollingLocationProvider`.

Access by calling `const {FleetEngineTripLocationProvider} = await google.maps.importLibrary("journeySharing")`.   
See [Libraries in the Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/libraries.md.txt).

| ### Constructor ||
|---|---|
| `FleetEngineTripLocationProvider` | `FleetEngineTripLocationProvider(options)` **Parameters:** - `options`: `FleetEngineTripLocationProviderOptions` Options for the location provider. Creates a new location provider for a Fleet Engine trip. |

| ### Static Methods ||
|---|---|
| `TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION` | `TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION(params)` **Parameters:** - `params`: `TripPolylineCustomizationFunctionParams` The parameters provided to the polyline customization function. **Return Value:** None Polyline customization function that colors the active polyline according to its speed reading. Specify this function as the `FleetEngineTripLocationProviderOptions.activePolylineCustomization` to render a traffic-aware polyline for the active polyline. |
| `TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION` | `TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION(params)` **Parameters:** - `params`: `TripPolylineCustomizationFunctionParams` The parameters provided to the polyline customization function. **Return Value:** None Polyline customization function that colors the remaining polyline according to its speed reading. Specify this function as the `FleetEngineTripLocationProviderOptions.remainingPolylineCustomization` to render a traffic-aware polyline for the remaining polyline. |

| ### Properties ||
|---|---|
| `tripId` | **Type:** `string` The ID for the trip 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`: `FleetEngineTripLocationProviderUpdateEvent` Event that is triggered when a Fleet Engine data update request has finished. |

## [FleetEngineTripLocationProviderOptions](https://developers.google.com/maps/documentation/javascript/reference/3.63/journey-sharing-trip-and-order-progress.md.txt#FleetEngineTripLocationProviderOptions)
interface


`google.maps.journeySharing.FleetEngineTripLocationProviderOptions`
interface

Options for trip 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(TripPolylineCustomizationFunctionParams): 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 `TripPolylineCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `destinationMarkerCustomization optional` | **Type:** `(function(TripMarkerCustomizationFunctionParams): 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 `TripMarkerCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `originMarkerCustomization optional` | **Type:** `(function(TripMarkerCustomizationFunctionParams): void)|MarkerOptions optional` Customization applied to the origin 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 `TripMarkerCustomizationFunctionParams` 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 disables recurring location updates. A new location update is fetched if any of the parameters observed by the location provider changes. The default polling interval is 5000 milliseconds, the minimum interval. If you set the polling interval to a lower non-zero value, 5000 is used. |
| `remainingPolylineCustomization optional` | **Type:** `(function(TripPolylineCustomizationFunctionParams): 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 `TripPolylineCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `takenPolylineCustomization optional` | **Type:** `(function(TripPolylineCustomizationFunctionParams): 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 `TripPolylineCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `tripId optional` | **Type:** `string optional` The trip ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any trip; use `FleetEngineTripLocationProvider.tripId` to set the ID and begin tracking. |
| `vehicleMarkerCustomization optional` | **Type:** `(function(TripMarkerCustomizationFunctionParams): void)|MarkerOptions optional` Customization applied to the 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 `TripMarkerCustomizationFunctionParams` for a list of supplied parameters and their uses. |
| `waypointMarkerCustomization optional` | **Type:** `(function(TripWaypointMarkerCustomizationFunctionParams): void)|MarkerOptions optional` Customization applied to a waypoint 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 `TripWaypointMarkerCustomizationFunctionParams` for a list of supplied parameters and their uses. |

## [FleetEngineTripLocationProviderUpdateEvent](https://developers.google.com/maps/documentation/javascript/reference/3.63/journey-sharing-trip-and-order-progress.md.txt#FleetEngineTripLocationProviderUpdateEvent)
interface


`google.maps.journeySharing.FleetEngineTripLocationProviderUpdateEvent`
interface

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

| ### Properties ||
|---|---|
| `trip optional` | **Type:** `Trip optional` The trip structure returned by the update. Unmodifiable. |