Map View Stay organized with collections Save and categorize content based on your preferences.
JourneySharingMapViewclass
google.maps.journeySharing.JourneySharingMapView
class
The map view.
Access by callingconst {JourneySharingMapView} = await google.maps.importLibrary("journeySharing")
.
SeeLibraries in the Maps JavaScript API.
Constructor | |
---|---|
JourneySharingMapView | JourneySharingMapView(options) Parameters:
Instantiates a map view. |
Methods | |
---|---|
addLocationProvider | addLocationProvider(locationProvider) Parameters:
Return Value: None Adds a location provider to the map view. If the location provider is already added, no action is performed. |
removeLocationProvider | removeLocationProvider(locationProvider) Parameters:
Return Value: None Removes a location provider from the map view. If the location provider is not already added to the map view, no action is performed. |
JourneySharingMapViewOptionsinterface
google.maps.journeySharing.JourneySharingMapViewOptions
interface
Options for the map view.
AutomaticViewportModeconstants
google.maps.journeySharing.AutomaticViewportMode
constants
Automatic viewport mode.
Access by callingconst {AutomaticViewportMode} = await google.maps.importLibrary("journeySharing")
.
SeeLibraries in the Maps JavaScript API.
Constants | |
---|---|
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. |
LocationProviderabstract class
google.maps.journeySharing.LocationProvider
abstract class
Parent class of all location providers.
Methods | |
---|---|
addListener | addListener(eventName, handler) Parameters:
Return Value: MapsEventListener Adds a MapsEventListener for an event fired by this location provider. Returns an identifier for this listener that can be used withevent.removeListener . |
PollingLocationProviderabstract class
google.maps.journeySharing.PollingLocationProvider
abstract class
Parent class of polling location providers.
This abstract class extendsLocationProvider
.
Properties | |
---|---|
isPolling | Type: boolean True if this location provider is polling. Read only. |
pollingIntervalMillis | Type: number 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, Infinity, or a negative value disables automatic location updates. A new location update is fetched once if the tracking ID parameter (for example, the shipment tracking ID of the shipment location provider), or a filtering option (for example, viewport bounds or attribute filters for fleet location providers) changes. The default, and minimum, polling interval is 5000 milliseconds. If you set the polling interval to a lower positive value, 5000 is stored and used. |
Methods | |
---|---|
Inherited:addListener |
Events | |
---|---|
ispollingchange | function(event) Arguments: Event that is triggered when the polling state of the location provider is updated. Use PollingLocationProvider.isPolling to determine the current polling state. |
PollingLocationProviderIsPollingChangeEventinterface
google.maps.journeySharing.PollingLocationProviderIsPollingChangeEvent
interface
The event object passed to the event handler when thePollingLocationProvider.ispollingchange
event is triggered.
Properties | |
---|---|
erroroptional | Type: Erroroptional The error that caused the polling state to change, if the state change was caused by an error. Undefined if the state change was due to normal operations. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-18 UTC.