Map View

Stay organized with collections Save and categorize content based on your preferences.

JourneySharingMapView class

google.maps.journeySharing.JourneySharingMapView class

The map view.

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

JourneySharingMapView
JourneySharingMapView(options)
Parameters: 
Instantiates a map view.
anticipatedRoutePolylines
Type:  Array<Polyline>
Returns the anticipated route polylines, if any.
anticipatedRoutePolylineSetup
Configures options for an anticipated route polyline. Invoked whenever a new anticipated route polyline is rendered.

If specifying a function, the function can and should modify the input's defaultPolylineOptions field containing a google.maps.PolylineOptions object, and return it as polylineOptions in the output PolylineSetupOptions object.

Specifying a PolylineSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same PolylineSetupOptions object in different PolylineSetup functions or static values, and do not reuse the same google.maps.PolylineOptions object for the polylineOptions key in different PolylineSetupOptions objects. If polylineOptions or visible is unset or null, it will be overwritten with the default. Any values set for polylineOptions.map or polylineOptions.path will be ignored.

automaticViewportMode
This Field is read-only. Automatic viewport mode.
destinationMarkers
Type:  Array<Marker>
Returns the destination markers, if any.
destinationMarkerSetup
Type:  MarkerSetup
Configures options for a destination location marker. Invoked whenever a new destination marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

element
Type:  Element
This Field is read-only. The DOM element backing the view.
enableTraffic
Type:  boolean
Enables or disables the traffic layer.
locationProvider
This Field is read-only. A source of tracked locations to be shown in the tracking map view.
map
Type:  Map
The map object contained in the map view.
mapOptions
Type:  MapOptions
The map options passed into the map via the map view.
originMarkers
Type:  Array<Marker>
Returns the origin markers, if any.
originMarkerSetup
Type:  MarkerSetup
Configures options for an origin location marker. Invoked whenever a new origin marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

pingMarkerSetup
Type:  MarkerSetup
Configures options for a ping location marker. Invoked whenever a new ping marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

successfulTaskMarkers
Type:  Array<Marker>
Returns the successful task markers, if any.
successfulTaskMarkerSetup
Type:  MarkerSetup
Configures options for a successful task location marker. Invoked whenever a new successful task marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

takenRoutePolylines
Type:  Array<Polyline>
Returns the taken route polylines, if any.
takenRoutePolylineSetup
Configures options for a taken route polyline. Invoked whenever a new taken route polyline is rendered.

If specifying a function, the function can and should modify the input's defaultPolylineOptions field containing a google.maps.PolylineOptions object, and return it as polylineOptions in the output PolylineSetupOptions object.

Specifying a PolylineSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same PolylineSetupOptions object in different PolylineSetup functions or static values, and do not reuse the same google.maps.PolylineOptions object for the polylineOptions key in different PolylineSetupOptions objects.

Any values set for polylineOptions.map or polylineOptions.path will be ignored. Any unset or null value will be overwritten with the default.

taskOutcomeMarkers
Type:  Array<Marker>
Returns the task outcome markers, if any.
taskOutcomeMarkerSetup
Type:  MarkerSetup
Configures options for a task outcome location marker. Invoked whenever a new task outcome location marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

unsuccessfulTaskMarkers
Type:  Array<Marker>
Returns the unsuccessful task markers, if any.
unsuccessfulTaskMarkerSetup
Type:  MarkerSetup
Configures options for an unsuccessful task location marker. Invoked whenever a new unsuccessful task marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

vehicleMarkers
Type:  Array<Marker>
Returns the vehicle markers, if any.
vehicleMarkerSetup
Type:  MarkerSetup
Configures options for a vehicle location marker. Invoked whenever a new vehicle marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

waypointMarkers
Type:  Array<Marker>
Returns the waypoint markers, if any.
waypointMarkerSetup
Type:  MarkerSetup
Configures options for a waypoint location marker. Invoked whenever a new waypoint marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

JourneySharingMapViewOptions interface

google.maps.journeySharing.JourneySharingMapViewOptions interface

Options for the map view.

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

element
Type:  Element
The DOM element backing the view. Required.
locationProvider
A source of tracked locations to be shown in the tracking map view. Required.
anticipatedRoutePolylineSetup optional
Type:  PolylineSetup optional
Configures options for an anticipated route polyline. Invoked whenever a new anticipated route polyline is rendered.

If specifying a function, the function can and should modify the input's defaultPolylineOptions field containing a google.maps.PolylineOptions object, and return it as polylineOptions in the output PolylineSetupOptions object.

Specifying a PolylineSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same PolylineSetupOptions object in different PolylineSetup functions or static values, and do not reuse the same google.maps.PolylineOptions object for the polylineOptions key in different PolylineSetupOptions objects. If polylineOptions or visible is unset or null, it will be overwritten with the default. Any values set for polylineOptions.map or polylineOptions.path will be ignored.

automaticViewportMode optional
Type:  AutomaticViewportMode optional
Automatic viewport mode. Default value is FIT_ANTICIPATED_ROUTE, which enables the map view to automatically adjust the viewport to fit vehicle markers, location markers, and any visible anticipated route polylines. Set this to NONE to turn off automatic fitting.
destinationMarkerSetup optional
Type:  MarkerSetup optional
Configures options for a destination location marker. Invoked whenever a new destination marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

mapOptions optional
Type:  MapOptions optional
Map options passed into the google.maps.Map constructor.
originMarkerSetup optional
Type:  MarkerSetup optional
Configures options for an origin location marker. Invoked whenever a new origin marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

pingMarkerSetup optional
Type:  MarkerSetup optional
Configures options for a ping location marker. Invoked whenever a new ping marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

successfulTaskMarkerSetup optional
Type:  MarkerSetup optional
Configures options for a successful task location marker. Invoked whenever a new successful task marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

takenRoutePolylineSetup optional
Type:  PolylineSetup optional
Configures options for a taken route polyline. Invoked whenever a new taken route polyline is rendered.

If specifying a function, the function can and should modify the input's defaultPolylineOptions field containing a google.maps.PolylineOptions object, and return it as polylineOptions in the output PolylineSetupOptions object.

Specifying a PolylineSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same PolylineSetupOptions object in different PolylineSetup functions or static values, and do not reuse the same google.maps.PolylineOptions object for the polylineOptions key in different PolylineSetupOptions objects.

Any values set for polylineOptions.map or polylineOptions.path will be ignored. Any unset or null value will be overwritten with the default.

taskOutcomeMarkerSetup optional
Type:  MarkerSetup optional
Configures options for a task outcome location marker. Invoked whenever a new task outcome location marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

unsuccessfulTaskMarkerSetup optional
Type:  MarkerSetup optional
Configures options for an unsuccessful task location marker. Invoked whenever a new unsuccessful task marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

vehicleMarkerSetup optional
Type:  MarkerSetup optional
Configures options for a vehicle location marker. Invoked whenever a new vehicle marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

waypointMarkerSetup optional
Type:  MarkerSetup optional
Configures options for a waypoint location marker. Invoked whenever a new waypoint marker is rendered.

If specifying a function, the function can and should modify the input's defaultMarkerOptions field containing a google.maps.MarkerOptions object, and return it as markerOptions in the output MarkerSetupOptions object.

Specifying a MarkerSetupOptions object has the same effect as specifying a function that returns that static object.

Do not reuse the same MarkerSetupOptions object in different MarkerSetup functions or static values, and do not reuse the same google.maps.MarkerOptions object for the markerOptions key in different MarkerSetupOptions objects. If markerOptions is unset or null, it will be overwritten with the default. Any value set for markerOptions.map or markerOptions.position will be ignored.

AutomaticViewportMode constants

google.maps.journeySharing.AutomaticViewportMode constants

Automatic viewport mode.

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

FIT_ANTICIPATED_ROUTE Automatically adjust the viewport to fit markers and any visible anticipated route polylines. This is the default.
NONE Do not automatically adjust the viewport.

LocationProvider abstract class

google.maps.journeySharing.LocationProvider abstract class

Parent class of location providers. Use the child location provider that suits your purpose, rather than the parent class.

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

addListener
addListener(eventName, handler)
Parameters: 
  • eventNamestring The name of the event to listen for.
  • handlerFunction The event handler.
Return Value:  MapsEventListener
Adds a MapsEventListener for an event fired by this location provider. Returns an identifier for this listener that can be used with event.removeListener.