Shipment Tracking

FleetEngineShipmentLocationProvider class

google.maps.journeySharing.FleetEngineShipmentLocationProvider class

Shipment location provider.

This class extends PollingLocationProvider.

Load using the &libraries=journeySharing URL parameter. See Libraries in the Maps JavaScript API.

When using v=beta, can be accessed by calling const {FleetEngineShipmentLocationProvider} = await google.map.importLibrary("journeySharing"). See Libraries in the Maps JavaScript API.

FleetEngineShipmentLocationProvider
FleetEngineShipmentLocationProvider(options)
Parameters: 
Creates a new location provider for Fleet Engine shipment tracking.
trackingId
Type:  string
The tracking ID for the task that this location provider observes. Set this field to begin tracking.
Inherited: isPolling
getTask
getTask()
Parameters:  None
Return Value:  Task|null
Returns the currently tracked task.
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

FleetEngineShipmentLocationProviderOptions interface

google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions interface

Options for shipment location provider.

Load using the &libraries=journeySharing URL parameter. See Libraries in the Maps JavaScript API.

authTokenFetcher
Provides JSON Web Tokens for authenticating the client to Fleet Engine.
projectId
Type:  string
The consumer's project ID from Google Cloud Console.
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 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.
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 interface

google.maps.journeySharing.FleetEngineShipmentLocationProviderUpdateEvent interface

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

Load using the &libraries=journeySharing URL parameter. See Libraries in the Maps JavaScript API.

task optional
Type:  Task optional
The task structure returned by the update. Unmodifiable.