JavaScript Consumer SDK quick reference

The JavaScript Consumer SDK lets a web-based consumer app show the location of vehicles and other locations of interest tracked in Fleet Engine on a map, so consumers can follow the progress of an on-demand trip or a scheduled shipment. It loads as the journeySharing library of the Maps JavaScript API.

JavaScript Consumer SDK: key facts

  • Product: JavaScript Consumer SDK
  • Also known as: Consumer SDK for JavaScript, Mobility services on-demand trips JavaScript, JavaScript SDK
  • Category: Routes
  • Platform: JavaScript (browser)
  • Runs on: Client (app or browser code)
  • Launch stage: GA
  • Lifecycle: Active
  • Overview: JavaScript Consumer SDK overview

JavaScript Consumer SDK: when to use it

Use JavaScript Consumer SDK when:

  • You need to show consumers a vehicle's live location and route for an on-demand trip that Fleet Engine tracks, in a web page or web app.
  • You need to let consumers follow the pickup or delivery progress of a scheduled shipment tracked in Fleet Engine in a browser.
  • You need to show ETA, remaining distance, and live traffic on the route for a trip in a web-based map view.
  • You need to customize trip markers, route polylines, or map styling in a web consumer tracking view.

Don't use JavaScript Consumer SDK when:

  • You need a trip-following consumer experience inside a native Android app. Use Consumer SDK for Android instead.
  • You need a trip-following consumer experience inside a native iOS app. Use Consumer SDK for iOS instead.
  • You need to report driver location and trip progress from the driver's Android app to Fleet Engine. Use Driver SDK for Android instead.
  • You need to report driver location and trip progress from the driver's iOS app to Fleet Engine. Use Driver SDK for iOS instead.
  • You need a general web map that doesn't follow Fleet Engine trips or tasks. Use Maps JavaScript API instead.

JavaScript Consumer SDK: setup

JavaScript Consumer SDK: common mistakes

JavaScript Consumer SDK: legacy and deprecated features

  • JourneySharingMapView and JourneySharingMapViewOptions marker and polyline setup options (vehicleMarkerSetup, originMarkerSetup, destinationMarkerSetup, waypointMarkerSetup, anticipatedRoutePolylineSetup, takenRoutePolylineSetup, and others): Deprecated. Replacement: MarkerCustomizationFunction and PolylineCustomizationFunction options on the location provider (for example, vehicleMarkerCustomization). Symptom: Scheduled for removal in a future release. See the migration guide.
  • JourneySharingMapView.locationProvider and JourneySharingMapViewOptions.locationProvider: Deprecated. Replacement: JourneySharingMapView.locationProviders and JourneySharingMapViewOptions.locationProviders.
  • JourneySharingMapView marker and polyline list properties (vehicleMarkers, originMarkers, destinationMarkers, waypointMarkers, anticipatedRoutePolylines, takenRoutePolylines, and task marker properties): Deprecated. Replacement: MarkerCustomizationFunction and PolylineCustomizationFunction callbacks on the location provider. See the migration guide.

What you can do with JavaScript Consumer SDK

See the guides linked below for each task, or compare across products in the Capabilities Explorer.