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

## [Task](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#Task)
interface


interface
`google.maps.journeySharing.Task`

The details for a task returned by Fleet Engine.

| ### Properties ||
|---|---|
| `attributes` | **Type:** `Object<string, *>` Attributes assigned to the task. |
| `name` | **Type:** `string` The task name in the format "providers/{provider_id}/tasks/{task_id}". The task_id must be a unique identifier and not a tracking ID. To store a tracking ID of a shipment, use the tracking_id field. Multiple tasks can have the same tracking_id. |
| `remainingVehicleJourneySegments` | **Type:** `Array<VehicleJourneySegment>` Information about the segments left to be completed for this task. |
| `status` | **Type:** `string` The current execution state of the task. |
| `type` | **Type:** `string` The task type; for example, a break or shipment. |
| `estimatedCompletionTime` optional | **Type:** `Date optional` The timestamp of the estimated completion time of the task. |
| `latestVehicleLocationUpdate` optional | **Type:** `VehicleLocationUpdate optional` Information specific to the last location update. |
| `outcome` optional | **Type:** `string optional` The outcome of the task. |
| `outcomeLocation` optional | **Type:** `LatLngLiteral optional` The location where the task was completed (from provider). |
| `outcomeLocationSource` optional | **Type:** `string optional` The setter of the task outcome location ('PROVIDER' or 'LAST_VEHICLE_LOCATION'). |
| `outcomeTime` optional | **Type:** `Date optional` The timestamp of when the task's outcome was set (from provider). |
| `plannedLocation` optional | **Type:** `LatLngLiteral optional` The location where the task is to be completed. |
| `targetTimeWindow` optional | **Type:** `TimeWindow optional` The time window during which the task should be completed. |
| `trackingId` optional | **Type:** `string optional` The tracking ID of the shipment. |
| `vehicleId` optional | **Type:** `string optional` The ID of the vehicle performing this task. |

## [TaskInfo](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#TaskInfo)
interface


interface
`google.maps.journeySharing.TaskInfo`

TaskInfo type, used by `DeliveryVehicleStop`.

| ### Properties ||
|---|---|
| `extraDurationMillis` optional | **Type:** `number optional` The extra time it takes to perform the task, in milliseconds. |
| `id` optional | **Type:** `string optional` The ID of the task. |
| `targetTimeWindow` optional | **Type:** `TimeWindow optional` The time window during which the task should be completed. |

## [TaskTrackingInfo](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#TaskTrackingInfo)
interface


interface
`google.maps.journeySharing.TaskTrackingInfo`

The details for a task tracking info object returned by Fleet Engine.

| ### Properties ||
|---|---|
| `attributes` | **Type:** `Object<string, *>` Attributes assigned to the task. |
| `name` | **Type:** `string` The name in the format "providers/{provider_id}/taskTrackingInfo/{tracking_id}", where `tracking_id` represents the tracking ID. |
| `trackingId` | **Type:** `string` The tracking ID of a Task. - Must be a valid Unicode string. - Limited to a maximum length of 64 characters. - Normalized according to [Unicode Normalization Form C](http://www.unicode.org/reports/tr15/). - May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'. |
| `estimatedArrivalTime` optional | **Type:** `Date optional` The estimated arrival time to the stop location. |
| `estimatedTaskCompletionTime` optional | **Type:** `Date optional` The estimated completion time of a Task. |
| `latestVehicleLocationUpdate` optional | **Type:** `VehicleLocationUpdate optional` Information specific to the last location update. |
| `plannedLocation` optional | **Type:** `LatLng optional` The location where the Task will be completed. |
| `remainingDrivingDistanceMeters` optional | **Type:** `number optional` The total remaining distance in meters to the `VehicleStop` of interest. |
| `remainingStopCount` optional | **Type:** `number optional` Indicates the number of stops the vehicle remaining until the task stop is reached, including the task stop. For example, if the vehicle's next stop is the task stop, the value will be 1. |
| `routePolylinePoints` optional | **Type:** `Array<LatLng> optional` A list of points which when connected forms a polyline of the vehicle's expected route to the location of this task. |
| `state` optional | **Type:** `string optional` The current execution state of the Task. |
| `targetTimeWindow` optional | **Type:** `TimeWindow optional` The time window during which the task should be completed. |
| `taskOutcome` optional | **Type:** `string optional` The outcome of attempting to execute a Task. |
| `taskOutcomeTime` optional | **Type:** `Date optional` The time when the Task's outcome was set by the provider. |

## [Trip](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#Trip)
interface


interface
`google.maps.journeySharing.Trip`

The details for a trip returned by Fleet Engine.

| ### Properties ||
|---|---|
| `name` | **Type:** `string` In the format "providers/{provider_id}/trips/{trip_id}". The trip_id must be a unique identifier. |
| `passengerCount` | **Type:** `number` Number of passengers on this trip; does not include the driver. |
| `remainingWaypoints` | **Type:** `Array<VehicleWaypoint>` An array of waypoints indicating the path from the current location to the drop-off point. |
| `status` | **Type:** `string` Current status of the trip. Possible values are UNKNOWN_TRIP_STATUS, NEW, ENROUTE_TO_PICKUP, ARRIVED_AT_PICKUP, ARRIVED_AT_INTERMEDIATE_DESTINATION, ENROUTE_TO_INTERMEDIATE_DESTINATION, ENROUTE_TO_DROPOFF, COMPLETE, or CANCELED. |
| `type` | **Type:** `string` The type of the trip. Possible values are UNKNOWN_TRIP_TYPE, SHARED or EXCLUSIVE. |
| `vehicleId` | **Type:** `string` ID of the vehicle making this trip. |
| `actualDropOffLocation` optional | **Type:** `LatLngLiteral optional` Location where the customer was dropped off. |
| `actualPickupLocation` optional | **Type:** `LatLngLiteral optional` Location where the customer was picked up. |
| `dropOffTime` optional | **Type:** `Date optional` The estimated future time when the passengers will be dropped off, or the actual time when they were dropped off. |
| `latestVehicleLocationUpdate` optional | **Type:** `VehicleLocationUpdate optional` Information specific to the last location update. |
| `pickupTime` optional | **Type:** `Date optional` The estimated future time when the passengers will be picked up, or the actual time when they were picked up. |
| `plannedDropOffLocation` optional | **Type:** `LatLngLiteral optional` Location where the customer indicates they will be dropped off. |
| `plannedPickupLocation` optional | **Type:** `LatLngLiteral optional` Location where customer indicates they will be picked up. |

## [DeliveryVehicle](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#DeliveryVehicle)
interface


interface
`google.maps.journeySharing.DeliveryVehicle`

The details for a delivery vehicle returned by Fleet Engine.

| ### Properties ||
|---|---|
| `attributes` | **Type:** `Object<string, string optional>` Custom delivery vehicle attributes. |
| `name` | **Type:** `string` In the format "providers/{provider_id}/deliveryVehicles/{delivery_vehicle_id}". The delivery_vehicle_id must be a unique identifier. |
| `navigationStatus` | **Type:** `string` The current navigation status of the vehicle. |
| `remainingDistanceMeters` | **Type:** `number` The remaining driving distance in the current route segment, in meters. |
| `remainingVehicleJourneySegments` | **Type:** `Array<VehicleJourneySegment>` The journey segments assigned to this delivery vehicle, starting from the vehicle's most recently reported location. This is only populated when the `DeliveryVehicle` data object is provided through `FleetEngineDeliveryVehicleLocationProvider`. |
| `currentRouteSegmentEndPoint` optional | **Type:** `LatLngLiteral optional` The location where the current route segment ends. |
| `latestVehicleLocationUpdate` optional | **Type:** `VehicleLocationUpdate optional` The last reported location of the delivery vehicle. |
| `remainingDurationMillis` optional | **Type:** `number optional` The remaining driving duration in the current route segment, in milliseconds. |

## [DeliveryVehicleStop](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#DeliveryVehicleStop)
interface


interface
`google.maps.journeySharing.DeliveryVehicleStop`

DeliveryVehicleStop type

| ### Properties ||
|---|---|
| `tasks` | **Type:** `Array<TaskInfo>` The list of Tasks to be performed at this stop. - `id`: the ID of the task. - `extraDurationMillis`: the extra time it takes to perform the task, in milliseconds. |
| `plannedLocation` optional | **Type:** `LatLngLiteral optional` The location of the stop. |
| `state` optional | **Type:** `DeliveryVehicleStopState optional` The state of the stop. |

## [DeliveryVehicleStopState](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#DeliveryVehicleStopState)
constants


constants
`google.maps.journeySharing.DeliveryVehicleStopState`

library `"journeySharing"`

The current state of a `DeliveryVehicleStop`.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `DeliveryVehicleStopStateString` type.

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

| ### Constants ||
|---|---|
| `ARRIVED` | Arrived at stop. Assumes that when the vehicle is routing to the next stop, that all previous stops have been completed. |
| `ENROUTE` | Assigned and actively routing. |
| `NEW` | Created, but not actively routing. |
| `UNSPECIFIED` | Unknown. |

## [VehicleJourneySegment](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#VehicleJourneySegment)
interface


interface
`google.maps.journeySharing.VehicleJourneySegment`

VehicleJourneySegment type

| ### Properties ||
|---|---|
| `drivingDistanceMeters` optional | **Type:** `number optional` The travel distance from the previous stop to this stop, in meters. |
| `drivingDurationMillis` optional | **Type:** `number optional` The travel time from the previous stop this stop, in milliseconds. |
| `path` optional | **Type:** `Array<LatLngLiteral> optional` The path from the previous stop (or the vehicle's current location, if this stop is the first in the list of stops) to this stop. |
| `stop` optional | **Type:** `DeliveryVehicleStop optional` Information about the stop. |

## [VehicleLocationUpdate](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#VehicleLocationUpdate)
interface


interface
`google.maps.journeySharing.VehicleLocationUpdate`

VehicleLocationUpdate type

| ### Properties ||
|---|---|
| `heading` optional | **Type:** `number optional` The heading of the update. 0 corresponds to north, 180 to south. |
| `location` optional | **Type:** `LatLngLiteral|LatLng optional` The location of the update. |
| `speedKilometersPerHour` optional | **Type:** `number optional` The speed in kilometers per hour. |
| `time` optional | **Type:** `Date optional` The time this update was received from the vehicle. |

## [VehicleWaypoint](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#VehicleWaypoint)
interface


interface
`google.maps.journeySharing.VehicleWaypoint`

VehicleWaypoint type.

| ### Properties ||
|---|---|
| `distanceMeters` optional | **Type:** `number optional` The path distance between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in meters. |
| `durationMillis` optional | **Type:** `number optional` Travel time between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in milliseconds. |
| `location` optional | **Type:** `LatLngLiteral optional` The location of the waypoint. |
| `path` optional | **Type:** `Array<LatLngLiteral> optional` The path from the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint. |
| `speedReadingIntervals` optional | **Type:** `Array<SpeedReadingInterval> optional` The list of traffic speeds along the path from the previous waypoint (or vehicle location) to the current waypoint. Each interval in the list describes the traffic on a contiguous segment on the path; the interval defines the starting and ending points of the segment via their indices. See the definition of `SpeedReadingInterval` for more details. |

## [Vehicle](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#Vehicle)
interface


interface
`google.maps.journeySharing.Vehicle`

The details for a vehicle returned by Fleet Engine.

| ### Properties ||
|---|---|
| `attributes` | **Type:** `Object<string, *>` Custom vehicle attributes. |
| `name` | **Type:** `string` In the format "providers/{provider_id}/vehicles/{vehicle_id}". The vehicle_id must be a unique identifier. |
| `navigationStatus` | **Type:** `VehicleNavigationStatus` The current navigation status of the vehicle. |
| `remainingDistanceMeters` | **Type:** `number` The remaining driving distance in the current route segment, in meters. |
| `vehicleState` | **Type:** `VehicleState` The vehicle state. |
| `vehicleType` | **Type:** `VehicleType` The type of this vehicle. |
| `currentRouteSegmentEndPoint` optional | **Type:** `TripWaypoint optional` The waypoint where current route segment ends. |
| `currentRouteSegmentVersion` optional | **Type:** `Date optional` Time when the current route segment was set. |
| `currentTrips` optional | **Type:** `Array<string> optional` List of trip IDs for trips currently assigned to this vehicle. |
| `etaToFirstWaypoint` optional | **Type:** `Date optional` The ETA to the first entry in the waypoints field. |
| `latestLocation` optional | **Type:** `VehicleLocationUpdate optional` The last reported location of the vehicle. |
| `maximumCapacity` optional | **Type:** `number optional` The total numbers of riders this vehicle can carry. The driver is not considered in this value. |
| `supportedTripTypes` optional | **Type:** `Array<TripType> optional` Trip types supported by this vehicle. |
| `waypoints` optional | **Type:** `Array<TripWaypoint> optional` The remaining waypoints assigned to this Vehicle. |
| `waypointsVersion` optional | **Type:** `Date optional` Last time the waypoints field was updated. |

## [VehicleNavigationStatus](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#VehicleNavigationStatus)
constants


constants
`google.maps.journeySharing.VehicleNavigationStatus`

library `"journeySharing"`

The current navigation status of a `Vehicle`.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `VehicleNavigationStatusString` type.

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

| ### Constants ||
|---|---|
| `ARRIVED_AT_DESTINATION` | The vehicle is within approximately 50m of the destination. |
| `ENROUTE_TO_DESTINATION` | Turn-by-turn navigation is available and the Driver app navigation has entered GUIDED_NAV mode. |
| `NO_GUIDANCE` | The Driver app's navigation is in FREE_NAV mode. |
| `OFF_ROUTE` | The vehicle has gone off the suggested route. |
| `UNKNOWN_NAVIGATION_STATUS` | Unspecified navigation status. |

## [VehicleState](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#VehicleState)
constants


constants
`google.maps.journeySharing.VehicleState`

library `"journeySharing"`

The current state of a `Vehicle`.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `VehicleStateString` type.

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

| ### Constants ||
|---|---|
| `OFFLINE` | The vehicle is not accepting new trips. |
| `ONLINE` | The vehicle is accepting new trips. |
| `UNKNOWN_VEHICLE_STATE` | Unknown vehicle state. |

## [VehicleType](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#VehicleType)
constants


constants
`google.maps.journeySharing.VehicleType`

library `"journeySharing"`

The type of `Vehicle`.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `VehicleTypeString` type.

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

| ### Constants ||
|---|---|
| `AUTO` | An automobile. |
| `TAXI` | Any vehicle that acts as a taxi (typically licensed or regulated). |
| `TRUCK` | A vehicle with a large storage capacity. |
| `TWO_WHEELER` | A motorcycle, moped, or other two-wheeled vehicle. |
| `UNKNOWN` | Unknown vehicle type. |

## [TripType](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#TripType)
constants


constants
`google.maps.journeySharing.TripType`

library `"journeySharing"`

Trip types supported by a `Vehicle`.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `TripTypeString` type.

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

| ### Constants ||
|---|---|
| `EXCLUSIVE` | The trip is exclusive to a vehicle. |
| `SHARED` | The trip may share a vehicle with other trips. |
| `UNKNOWN_TRIP_TYPE` | Unknown trip type. |

## [TripWaypoint](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#TripWaypoint)
interface


interface
`google.maps.journeySharing.TripWaypoint`

TripWaypoint type.

| ### Properties ||
|---|---|
| `distanceMeters` optional | **Type:** `number optional` The path distance between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in meters. |
| `durationMillis` optional | **Type:** `number optional` Travel time between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in milliseconds. |
| `location` optional | **Type:** `LatLng optional` The location of the waypoint. |
| `path` optional | **Type:** `Array<LatLng> optional` The path from the previous stop (or the vehicle's current location, if this stop is the first in the list of stops) to this stop. |
| `speedReadingIntervals` optional | **Type:** `Array<SpeedReadingInterval> optional` The list of traffic speeds along the path from the previous waypoint (or vehicle location) to the current waypoint. Each interval in the list describes the traffic on a contiguous segment on the path; the interval defines the starting and ending points of the segment via their indices. See the definition of `SpeedReadingInterval` for more details. |
| `tripId` optional | **Type:** `string optional` The trip associated with this waypoint. |
| `waypointType` optional | **Type:** `WaypointType optional` The role this waypoint plays in this trip, such as pickup or dropoff. |

## [WaypointType](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#WaypointType)
constants


constants
`google.maps.journeySharing.WaypointType`

library `"journeySharing"`

Waypoint types supported by `Vehicle`.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `WaypointTypeString` type.

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

| ### Constants ||
|---|---|
| `DROP_OFF_WAYPOINT_TYPE` | Waypoints for dropping off riders. |
| `INTERMEDIATE_DESTINATION_WAYPOINT_TYPE` | Waypoints for intermediate destinations in a multi-destination trip. |
| `PICKUP_WAYPOINT_TYPE` | Waypoints for picking up riders. |
| `UNKNOWN_WAYPOINT_TYPE` | Unknown waypoint type. |

## [TimeWindow](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#TimeWindow)
interface


interface
`google.maps.journeySharing.TimeWindow`

A time range.

| ### Properties ||
|---|---|
| `endTime` | **Type:** `Date` The end time of the time window (inclusive). |
| `startTime` | **Type:** `Date` The start time of the time window (inclusive). |

## [Speed](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#Speed)
constants


constants
`google.maps.journeySharing.Speed`

library `"journeySharing"`

The classification of polyline speed based on traffic data.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `SpeedString` type.

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

| ### Constants ||
|---|---|
| `NORMAL` | Normal speed, no slowdown is detected. |
| `SLOW` | Slowdown detected, but no traffic jam formed. |
| `TRAFFIC_JAM` | Traffic jam detected. |

## [SpeedReadingInterval](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-fleet-engine-entities.md.txt#SpeedReadingInterval)
interface


interface
`google.maps.journeySharing.SpeedReadingInterval`

Traffic density indicator on a contiguous path segment. The interval defines the starting and ending points of the segment via their indices.

| ### Properties ||
|---|---|
| `endPolylinePointIndex` | **Type:** `number` The zero-based index of the ending point of the interval in the path. |
| `speed` | **Type:** `Speed` Traffic speed in this interval. |
| `startPolylinePointIndex` | **Type:** `number` The zero-based index of the starting point of the interval in the path. |