Trip and Order Progress

FleetEngineTripLocationProvider class

google.maps.journeySharing.FleetEngineTripLocationProvider class

Trip location provider.

This class extends PollingLocationProvider.

Access by callingconst {FleetEngineTripLocationProvider} = await google.maps.importLibrary( "journeySharing" ).SeeLibraries in the Maps JavaScript API.

FleetEngineTripLocationProvider
FleetEngineTripLocationProvider(options)
Parameters:
Creates a new location provider for a Fleet Engine trip.
tripId
Type:string
The ID for the trip that this location provider observes. Set this field to begin tracking.
Inherited: isPolling, pollingIntervalMillis
refresh
refresh()
Parameters:None
Return Value:void
Explicitly refreshes the tracked location.
Inherited: addListener
error
function(event)
Arguments:
Event that is triggered when the location provider encounters an error.
update
function(event)
Event that is triggered when a Fleet Engine data update request has finished.
Inherited: ispollingchange

FleetEngineTripLocationProviderOptions interface

google.maps.journeySharing.FleetEngineTripLocationProviderOptions interface

Options for trip location provider.

authTokenFetcher
Provides JSON Web Tokens for authenticating the client to Fleet Engine.
projectId
Type:string
The consumer's project ID from Google Cloud Console.
destinationMarkerCustomizationoptional
Customization applied to the destination marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If aMarkerOptionsobject 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, theisNewparameter in the function parameters object is set totrue.) 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.

    SeeTripMarkerCustomizationFunctionParamsfor a list of supplied parameters and their uses.
originMarkerCustomizationoptional
Customization applied to the origin marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If aMarkerOptionsobject 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, theisNewparameter in the function parameters object is set totrue.) 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.

    SeeTripMarkerCustomizationFunctionParamsfor a list of supplied parameters and their uses.
pollingIntervalMillisoptional
Type:numberoptional
Minimum time between fetching location updates in milliseconds. If it takes longer thanpollingIntervalMillisto 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.
tripIdoptional
Type:stringoptional
The trip ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any trip; useFleetEngineTripLocationProvider.tripIdto set the ID and begin tracking.
vehicleMarkerCustomizationoptional
Customization applied to the vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If aMarkerOptionsobject 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, theisNewparameter in the function parameters object is set totrue.) 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.

    SeeTripMarkerCustomizationFunctionParamsfor a list of supplied parameters and their uses.
waypointMarkerCustomizationoptional
Customization applied to a waypoint marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If aMarkerOptionsobject 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, theisNewparameter in the function parameters object is set totrue.) 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.

    SeeTripWaypointMarkerCustomizationFunctionParamsfor a list of supplied parameters and their uses.

FleetEngineTripLocationProviderUpdateEvent interface

google.maps.journeySharing.FleetEngineTripLocationProviderUpdateEvent interface

The event object passed to the event handler when theFleetEngineTripLocationProvider.updateevent is triggered.

tripoptional
Type:Tripoptional
The trip structure returned by the update. Unmodifiable.