diff --git a/attw.json b/attw.json index 9c04e9cd9b4a6b..96f289a3fb8919 100644 --- a/attw.json +++ b/attw.json @@ -324,7 +324,6 @@ "webscopeio__react-textarea-autocomplete", "when", "wnumb", - "wordpress__server-side-render", "yargs-parser", "yargs-parser/v20", "yargs/v16", diff --git a/notNeededPackages.json b/notNeededPackages.json index 5ed19ae673bb75..66cf5f0f092c59 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -8399,6 +8399,10 @@ "libraryName": "@wordpress/rich-text", "asOfVersion": "6.10.0" }, + "wordpress__server-side-render": { + "libraryName": "@wordpress/server-side-render", + "asOfVersion": "6.24.1" + }, "wordpress__shortcode": { "libraryName": "@wordpress/shortcode", "asOfVersion": "4.14.0" diff --git a/types/error-subclass/package.json b/types/error-subclass/package.json index 763c8c6a70d9ef..dbb33d06e5e8a1 100644 --- a/types/error-subclass/package.json +++ b/types/error-subclass/package.json @@ -8,10 +8,5 @@ "devDependencies": { "@types/error-subclass": "workspace:." }, - "owners": [ - { - "name": "Fitbit", - "githubUsername": "fitbit" - } - ] + "owners": [] } diff --git a/types/google.maps/google.maps-tests.ts b/types/google.maps/google.maps-tests.ts index 426125d67a46f0..957b1dc7df3ee1 100644 --- a/types/google.maps/google.maps-tests.ts +++ b/types/google.maps/google.maps-tests.ts @@ -1,3 +1,3 @@ // No tests required for generated types -// Synced from: https://github.com/googlemaps/js-types/commit/5bb0d929a218930283b73cfe3830f85e1e8132ef +// Synced from: https://github.com/googlemaps/js-types/commit/5e9ee0bb9d5664ee9189b18bb7ca6f3df728929c google.maps.Map; diff --git a/types/google.maps/index.d.ts b/types/google.maps/index.d.ts index 879ff71ec53017..d6c9dc9c85568d 100644 --- a/types/google.maps/index.d.ts +++ b/types/google.maps/index.d.ts @@ -17,255 +17,349 @@ //////////////////////////////////////////////////////////////////////////////// -declare namespace google.maps.event { - /** - * Adds the given listener function to the given event name for the given object instance. Returns an identifier for this listener that can be used with removeListener(). - */ - export function addListener(instance: object, eventName: string, handler: Function): google.maps.MapsEventListener; - /** - * Like addListener, but the handler removes itself after handling the first event. - */ - export function addListenerOnce(instance: object, eventName: string, handler: Function): google.maps.MapsEventListener; - /** - * Removes all listeners for all events for the given instance. - */ - export function clearInstanceListeners(instance: object): void; - /** - * Removes all listeners for the given event for the given instance. - */ - export function clearListeners(instance: object, eventName: string): void; - /** - * Returns if there are listeners for the given event on the given instance. Can be used to save the computation of expensive event details. - */ - export function hasListeners(instance: object, eventName: string): boolean; - /** - * Removes the given listener, which should have been returned by addListener above. Equivalent to calling listener.remove(). - */ - export function removeListener(listener: google.maps.MapsEventListener): void; - /** - * Triggers the given event. All arguments after eventName are passed as arguments to the listeners. - */ - export function trigger(instance: object, eventName: string, ...eventArgs: unknown[]): void; - /** - * Cross browser event handler registration. This listener is removed by calling removeListener(handle) for the handle that is returned by this function. - * @deprecated google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead. The feature will continue to work and there is no plan to decommission it. - */ - export function addDomListener(instance: object, eventName: string, handler: Function, capture?: boolean): google.maps.MapsEventListener; - /** - * Wrapper around addDomListener that removes the listener after the first event. - * @deprecated google.maps.event.addDomListenerOnce() is deprecated, use the standard addEventListener() method instead. The feature will continue to work and there is no plan to decommission it. - */ - export function addDomListenerOnce(instance: object, eventName: string, handler: Function, capture?: boolean): google.maps.MapsEventListener; -} - declare namespace google.maps { /** - * Identifiers for map color schemes. Specify these by value, or by using the constant's name. For example, 'FOLLOW_SYSTEM' or google.maps.ColorScheme.FOLLOW_SYSTEM. - * - * Access by calling `const {ColorScheme} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A relational description of a location. Includes a ranked set of nearby landmarks and the areas containing the target location. */ - export enum ColorScheme { + export interface AddressDescriptor { /** - * The dark color scheme for a map. + * A ranked list of containing or adjacent areas. The most useful (recognizable and precise) areas are ranked first. */ - DARK = 'DARK', + areas: google.maps.Area[]; /** - * The color scheme is selected based on system preferences, which are checked once at method execution time. + * A ranked list of nearby landmarks. The most useful (recognizable and nearby) landmarks are ranked first. */ - FOLLOW_SYSTEM = 'FOLLOW_SYSTEM', + landmarks: google.maps.Landmark[]; + } + + export interface AddressValidationLibrary { + + Address: typeof google.maps.addressValidation.Address; + + AddressComponent: typeof google.maps.addressValidation.AddressComponent; + + AddressMetadata: typeof google.maps.addressValidation.AddressMetadata; + + AddressValidation: typeof google.maps.addressValidation.AddressValidation; + + ConfirmationLevel: typeof google.maps.addressValidation.ConfirmationLevel; + + Geocode: typeof google.maps.addressValidation.Geocode; + + Granularity: typeof google.maps.addressValidation.Granularity; /** - * The light color scheme for a map. Default value for legacy Maps JS. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. */ - LIGHT = 'LIGHT', + PossibleNextAction: typeof google.maps.addressValidation.PossibleNextAction; + + USPSAddress: typeof google.maps.addressValidation.USPSAddress; + + USPSData: typeof google.maps.addressValidation.USPSData; + + Verdict: typeof google.maps.addressValidation.Verdict; + } + + export interface AirQualityLibrary { + + AirQualityMeterElement: typeof google.maps.airQuality.AirQualityMeterElement; } - export type ColorSchemeString = `${google.maps.ColorScheme}`; /** - * Identifiers for common MapTypes. Specify these by value, or by using the constant's name. For example, 'satellite' or google.maps.MapTypeId.SATELLITE. + * Animations that can be played on a marker. Use the {@link google.maps.Marker.setAnimation} method on Marker or the {@link google.maps.MarkerOptions.animation} option to play an animation. * - * Access by calling `const {MapTypeId} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {Animation} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum MapTypeId { + export enum Animation { /** - * This map type displays a transparent layer of major streets on satellite images. + * Marker bounces until animation is stopped by calling {@link google.maps.Marker.setAnimation} with null. */ - HYBRID = 'hybrid', + BOUNCE = 1, /** - * This map type displays a normal street map. + * Marker drops from the top of the map to its final location. Animation will cease once the marker comes to rest and {@link google.maps.Marker.getAnimation} will return null. This type of animation is usually specified during creation of the marker. */ - ROADMAP = 'roadmap', + DROP = 2, + } + /** + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A place that is a small region, such as a neighborhood, sublocality, or large complex that contains the target location. + */ + export interface Area { /** - * This map type displays satellite images. + * Defines the spatial relationship between the target location and the area. */ - SATELLITE = 'satellite', + containment: google.maps.ContainmentString; /** - * This map type displays maps with physical features such as terrain and vegetation. + * The name for the area. */ - TERRAIN = 'terrain', + display_name: string; + /** + * The language of the name for the area. + */ + display_name_language_code: string; + /** + * The Place ID of the underlying area. Can be used to resolve more information about the area through Place Details or Place ID Lookup. + */ + place_id: string; } - export type MapTypeIdString = `${google.maps.MapTypeId}`; /** - * Base class for managing network errors in Maps. - * Access by calling `const {MapsNetworkError} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A layer showing bike lanes and paths. + * Access by calling `const {BicyclingLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class MapsNetworkError extends Error { + export class BicyclingLayer extends google.maps.MVCObject { /** - * Identifies the type of error produced by the API. + * A layer that displays bike lanes and paths and demotes large roads. */ - code: google.maps.DirectionsStatusString | google.maps.DistanceMatrixStatusString | google.maps.ElevationStatusString | google.maps.GeocoderStatusString | google.maps.MaxZoomStatusString | google.maps.places.PlacesServiceStatusString | google.maps.RPCStatusString | google.maps.StreetViewStatusString; + constructor(); /** - * Represents the network service that responded with the error. + * Returns the map on which this layer is displayed. */ - endpoint: google.maps.MapsNetworkErrorEndpointString; + getMap(): google.maps.Map | null; + /** + * Renders the layer on the specified map. If map is set to null, the layer will be removed. + */ + setMap(map: google.maps.Map | null): void; } /** - * Represents a server-side error from a web service (i.e. the equivalent of a 5xx code in HTTP). - * Access by calling `const {MapsServerError} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The display options for the Camera control. */ - export class MapsServerError extends google.maps.MapsNetworkError { + export interface CameraControlOptions { + /** + * Position id. Used to specify the position of the control on the map. + * @defaultValue {@link google.maps.ControlPosition.INLINE_START_BLOCK_END} + */ + position?: google.maps.ControlPosition | null; } /** - * Represents a request error from a web service (i.e. the equivalent of a 4xx code in HTTP). - * Access by calling `const {MapsRequestError} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Used for setting the map's camera options. */ - export class MapsRequestError extends google.maps.MapsNetworkError { + export interface CameraOptions { + + center?: google.maps.LatLngLiteral | google.maps.LatLng; + + heading?: number; + + tilt?: number; + + zoom?: number; } /** - * Identifiers for API endpoints used by {@link google.maps.MapsNetworkError} instances. - * - * Access by calling `const {MapsNetworkErrorEndpoint} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Used for retrieving camera parameters, such as that of the GL camera used for the {@link google.maps.WebGLOverlayView}. */ - export enum MapsNetworkErrorEndpoint { + export interface CameraParams extends google.maps.CameraOptions { + + center: google.maps.LatLng; + + heading: number; + + tilt: number; + + zoom: number; + } + /** + * A circle on the Earth's surface; also known as a "spherical cap". + * Access by calling `const {Circle} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Circle extends google.maps.MVCObject { /** - * Identifies the Routes API within the Directions API. + * Create a circle using the passed {@link google.maps.CircleOptions}, which specify the center, radius, and style. + * @param circleOrCircleOptions */ - DIRECTIONS_ROUTE = 'DIRECTIONS_ROUTE', + constructor(circleOrCircleOptions?: google.maps.Circle | google.maps.CircleLiteral | google.maps.CircleOptions | null); /** - * Identifies the DistanceMatrix API. + * Gets the LatLngBounds of this Circle. */ - DISTANCE_MATRIX = 'DISTANCE_MATRIX', + getBounds(): google.maps.LatLngBounds | null; /** - * Identifies the getElevationsAlongPath API within the Elevation API. + * Returns the center of this circle. */ - ELEVATION_ALONG_PATH = 'ELEVATION_ALONG_PATH', + getCenter(): google.maps.LatLng | null; /** - * Identifies the getElevationForLocations API within the Elevation API. + * Returns whether this circle can be dragged by the user. */ - ELEVATION_LOCATIONS = 'ELEVATION_LOCATIONS', + getDraggable(): boolean; /** - * Identifies the Get DeliveryVehicle API within Fleet Engine. + * Returns whether this circle can be edited by the user. */ - FLEET_ENGINE_GET_DELIVERY_VEHICLE = 'FLEET_ENGINE_GET_DELIVERY_VEHICLE', + getEditable(): boolean; /** - * Identifies the Get Trip API within Fleet Engine. + * Returns the map on which this circle is displayed. */ - FLEET_ENGINE_GET_TRIP = 'FLEET_ENGINE_GET_TRIP', + getMap(): google.maps.Map | null; /** - * Identifies the Get Vehicle API within Fleet Engine. + * Returns the radius of this circle (in meters). */ - FLEET_ENGINE_GET_VEHICLE = 'FLEET_ENGINE_GET_VEHICLE', + getRadius(): number; /** - * Identifies the List DeliveryVehicles API within Fleet Engine. + * Returns whether this circle is visible on the map. */ - FLEET_ENGINE_LIST_DELIVERY_VEHICLES = 'FLEET_ENGINE_LIST_DELIVERY_VEHICLES', + getVisible(): boolean; /** - * Identifies the List Tasks API within Fleet Engine. + * Sets the center of this circle. */ - FLEET_ENGINE_LIST_TASKS = 'FLEET_ENGINE_LIST_TASKS', + setCenter(center: google.maps.LatLng | google.maps.LatLngLiteral | null): void; /** - * Identifies the List Vehicles API within Fleet Engine. + * If set to true, the user can drag this circle over the map. */ - FLEET_ENGINE_LIST_VEHICLES = 'FLEET_ENGINE_LIST_VEHICLES', + setDraggable(draggable: boolean): void; /** - * Identifies the Search Tasks API within Fleet Engine. + * If set to true, the user can edit this circle by dragging the control points shown at the center and around the circumference of the circle. */ - FLEET_ENGINE_SEARCH_TASKS = 'FLEET_ENGINE_SEARCH_TASKS', + setEditable(editable: boolean): void; /** - * Identifies the geocode API within the Geocoder. + * Renders the circle on the specified map. If map is set to null, the circle will be removed. */ - GEOCODER_GEOCODE = 'GEOCODER_GEOCODE', + setMap(map: google.maps.Map | null): void; + + setOptions(options: google.maps.CircleOptions | null): void; /** - * Identifies the MaximumZoomImageryService API within the Maps API. + * Sets the radius of this circle (in meters). */ - MAPS_MAX_ZOOM = 'MAPS_MAX_ZOOM', + setRadius(radius: number): void; /** - * Identifies the Autocomplete API within the Places API. + * Hides this circle if set to false. */ - PLACES_AUTOCOMPLETE = 'PLACES_AUTOCOMPLETE', + setVisible(visible: boolean): void; + } + /** + * Object literal which represents a circle. + */ + export interface CircleLiteral extends google.maps.CircleOptions { /** - * Identifies the Details API within the Places API. + * The center of the Circle. */ - PLACES_DETAILS = 'PLACES_DETAILS', + center: google.maps.LatLng | google.maps.LatLngLiteral; /** - * Identifies the findPlaceFromPhoneNumber API within the Places API. + * The radius in meters on the Earth's surface. */ - PLACES_FIND_PLACE_FROM_PHONE_NUMBER = 'PLACES_FIND_PLACE_FROM_PHONE_NUMBER', + radius: number; + } + /** + * CircleOptions object used to define the properties that can be set on a Circle. + */ + export interface CircleOptions { /** - * Identifies the findPlaceFromQuery API within the Places API. + * The center of the Circle. */ - PLACES_FIND_PLACE_FROM_QUERY = 'PLACES_FIND_PLACE_FROM_QUERY', + center?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * Identifies the Gateway API within the Places API. + * Indicates whether this Circle handles mouse events. + * @defaultValue true */ - PLACES_GATEWAY = 'PLACES_GATEWAY', + clickable?: boolean | null; /** - * Identifies the Get Place API within the Places API. + * If set to true, the user can drag this circle over the map. + * @defaultValue false */ - PLACES_GET_PLACE = 'PLACES_GET_PLACE', + draggable?: boolean | null; /** - * Identifies the LocalContextSearch API within the Places API. + * If set to true, the user can edit this circle by dragging the control points shown at the center and around the circumference of the circle. + * @defaultValue false */ - PLACES_LOCAL_CONTEXT_SEARCH = 'PLACES_LOCAL_CONTEXT_SEARCH', + editable?: boolean | null; /** - * Identifies the NearbySearch API within the Places API. + * The fill color. All CSS3 colors are supported except for extended named colors. */ - PLACES_NEARBY_SEARCH = 'PLACES_NEARBY_SEARCH', + fillColor?: string | null; /** - * Identifies the Search Text API within the Places API. + * The fill opacity between 0.0 and 1.0. */ - PLACES_SEARCH_TEXT = 'PLACES_SEARCH_TEXT', + fillOpacity?: number | null; /** - * Identifies the getPanorama method within the Streetview service. + * Map on which to display the Circle. */ - STREETVIEW_GET_PANORAMA = 'STREETVIEW_GET_PANORAMA', + map?: google.maps.Map | null; + /** + * The radius in meters on the Earth's surface. + */ + radius?: number | null; + /** + * The stroke color. All CSS3 colors are supported except for extended named colors. + */ + strokeColor?: string | null; + /** + * The stroke opacity between 0.0 and 1.0. + */ + strokeOpacity?: number | null; + /** + * The stroke position. + * @defaultValue {@link google.maps.StrokePosition.CENTER} + */ + strokePosition?: google.maps.StrokePosition | null; + /** + * The stroke width in pixels. + */ + strokeWeight?: number | null; + /** + * Whether this circle is visible on the map. + * @defaultValue true + */ + visible?: boolean | null; + /** + * The zIndex compared to other polys. + */ + zIndex?: number | null; } - export type MapsNetworkErrorEndpointString = `${google.maps.MapsNetworkErrorEndpoint}`; /** - * An event with an associated Error. + * + * Access by calling `const {CollisionBehavior} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface ErrorEvent { + export enum CollisionBehavior { /** - * The Error related to the event. + * Display the marker only if it does not overlap with other markers. If two markers of this type would overlap, the one with the higher zIndex is shown. If they have the same zIndex, the one with the lower vertical screen position is shown. */ - error: Error; + OPTIONAL_AND_HIDES_LOWER_PRIORITY = 'OPTIONAL_AND_HIDES_LOWER_PRIORITY', + /** + * Always display the marker regardless of collision. This is the default behavior. + */ + REQUIRED = 'REQUIRED', + /** + * Always display the marker regardless of collision, and hide any OPTIONAL_AND_HIDES_LOWER_PRIORITY markers or labels that would overlap with the marker. + */ + REQUIRED_AND_HIDES_OPTIONAL = 'REQUIRED_AND_HIDES_OPTIONAL', } + export type CollisionBehaviorString = `${google.maps.CollisionBehavior}`; /** - * Describes a Firebase App Check token result. + * Identifiers for map color schemes. Specify these by value, or by using the constant's name. For example, 'FOLLOW_SYSTEM' or google.maps.ColorScheme.FOLLOW_SYSTEM. + * + * Access by calling `const {ColorScheme} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface MapsAppCheckTokenResult { + export enum ColorScheme { /** - * The Firebase App Check token. + * The dark color scheme for a map. */ - token: string; + DARK = 'DARK', + /** + * The color scheme is selected based on system preferences, which are checked once at method execution time. + */ + FOLLOW_SYSTEM = 'FOLLOW_SYSTEM', + /** + * The light color scheme for a map. Default value for legacy Maps JS. + */ + LIGHT = 'LIGHT', } + export type ColorSchemeString = `${google.maps.ColorScheme}`; /** - * Settings which control the behavior of the Maps JavaScript API as a whole. - * Access by calling `const {Settings} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * An enum representing the spatial relationship between the area and the target location. + * + * Access by calling `const {Containment} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Settings { + export enum Containment { /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A collection of unique experience IDs to which to attribute Maps JS API calls. The returned value is a copy of the internal value that is stored in the Settings class singleton instance. Operations on google.maps.Settings.getInstance().experienceIds will therefore only modify the copy and not the internal value.

To update the internal value, set the property equal to the new value on the singleton instance (ex: google.maps.Settings.getInstance().experienceIds = [experienceId];). + * The target location is outside the area region, but close by. */ - get experienceIds(): Iterable; + NEAR = 'NEAR', /** - * Set this property to a function that returns a promise which resolves to a Firebase App Check token result. + * The target location is within the area region, close to the edge. */ - fetchAppCheckToken: () => Promise; + OUTSKIRTS = 'OUTSKIRTS', /** - * Returns the singleton instance of google.maps.Settings. + * The target location is within the area region, close to the center. */ - static getInstance(): google.maps.Settings; + WITHIN = 'WITHIN', } + export type ContainmentString = `${google.maps.Containment}`; /** * Identifiers used to specify the placement of controls on the map. Controls are positioned relative to other controls in the same layout position. Controls that are added first are positioned closer to the edge of the map. Usage of "logical values" (see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values) is recommended in order to be able to automatically support both left-to-right (LTR) and right-to-left (RTL) layout contexts.

Logical values in LTR:
+----------------+ 
| BSIS BSIC BSIE |
| ISBS      IEBS |
|                |
| ISBC      IEBC |
|                |
| ISBE      IEBE |
| BEIS BEIC BEIE |
+----------------+

Logical values in RTL:
+----------------+ 
| BSIE BSIC BSIS |
| IEBS      ISBS |
|                |
| IEBC      ISBC |
|                |
| IEBE      ISBE |
| BEIE BEIC BEIS |
+----------------+

Legacy values:
+----------------+ 
| TL    TC    TR |
| LT          RT |
|                |
| LC          RC |
|                |
| LB          RB |
| BL    BC    BR |
+----------------+

Elements in the top or bottom row flow towards the middle of the row. Elements in the left or right column flow towards the middle of the column. * @@ -370,493 +464,475 @@ declare namespace google.maps { TOP_RIGHT = 3, } /** - * Identifiers for common MapTypesControls. - * - * Access by calling `const {MapTypeControlStyle} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This interface provides convenience methods for generating matrices to use for rendering WebGL scenes on top of the Google base map.

Note: A reference to this object should not be held outside of the scope of the encapsulating {@link google.maps.WebGLOverlayView.onDraw} call. */ - export enum MapTypeControlStyle { + export interface CoordinateTransformer { + + fromLatLngAltitude(latLngAltitude: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral, rotations?: Float32Array, scale?: Float32Array): Float64Array; + + getCameraParams(): google.maps.CameraParams; + } + + export interface CoreLibrary { + + ColorScheme: typeof google.maps.ColorScheme; + + ControlPosition: typeof google.maps.ControlPosition; + + event: typeof google.maps.event; + + LatLng: typeof google.maps.LatLng; + + LatLngAltitude: typeof google.maps.LatLngAltitude; + + LatLngBounds: typeof google.maps.LatLngBounds; + + MapsNetworkError: typeof google.maps.MapsNetworkError; + + MapsNetworkErrorEndpoint: typeof google.maps.MapsNetworkErrorEndpoint; + + MapsRequestError: typeof google.maps.MapsRequestError; + + MapsServerError: typeof google.maps.MapsServerError; + + MVCArray: typeof google.maps.MVCArray; + + MVCObject: typeof google.maps.MVCObject; + + Orientation3D: typeof google.maps.Orientation3D; + + Point: typeof google.maps.Point; + + RPCStatus: typeof google.maps.RPCStatus; + + Settings: typeof google.maps.Settings; + + Size: typeof google.maps.Size; + + SymbolPath: typeof google.maps.SymbolPath; + + UnitSystem: typeof google.maps.UnitSystem; + + Vector3D: typeof google.maps.Vector3D; + } + /** + * A layer for displaying geospatial data. Points, line-strings and polygons can be displayed.

Every Map has a Data object by default, so most of the time there is no need to construct one. For example:

 var myMap = new google.maps.Map(...);
myMap.data.addGeoJson(...);
myMap.data.setStyle(...);
The Data object is a collection of Features. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Data extends google.maps.MVCObject { /** - * Uses the default map type control. When the DEFAULT control is shown, it will vary according to window size and other factors. The DEFAULT control may change in future versions of the API. + * Creates an empty collection, with the given DataOptions. + * @param options */ - DEFAULT = 0, + constructor(options?: google.maps.Data.DataOptions | null); /** - * A dropdown menu for the screen realestate conscious. + * Adds a feature to the collection, and returns the added feature.

If the feature has an ID, it will replace any existing feature in the collection with the same ID. If no feature is given, a new feature will be created with null geometry and no properties. If FeatureOptions are given, a new feature will be created with the specified properties.

Note that the IDs 1234 and '1234' are equivalent. Adding a feature with ID 1234 will replace a feature with ID '1234', and vice versa. */ - DROPDOWN_MENU = 0, + add(feature?: google.maps.Data.Feature | google.maps.Data.FeatureOptions | null): google.maps.Data.Feature; /** - * The standard horizontal radio buttons bar. + * Adds GeoJSON features to the collection. Give this method a parsed JSON. The imported features are returned. Throws an exception if the GeoJSON could not be imported. */ - HORIZONTAL_BAR = 0, - } - /** - * Identifiers for scale control ids. - */ - export enum ScaleControlStyle { + addGeoJson(geoJson: object, options?: google.maps.Data.GeoJsonOptions | null): google.maps.Data.Feature[]; /** - * The standard scale control. + * Checks whether the given feature is in the collection. */ - DEFAULT = 0, - } - /** - * Object literals are accepted in place of LatLng objects, as a convenience, in many places. These are converted to LatLng objects when the Maps API encounters them.

Examples:

 map.setCenter({lat: -34, lng: 151});
new google.maps.Marker({position: {lat: -34, lng: 151}, map: map});

LatLng object literals are not supported in the Geometry library.

- */ - export interface LatLngLiteral { + contains(feature: google.maps.Data.Feature): boolean; /** - * Latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. + * Repeatedly invokes the given function, passing a feature in the collection to the function on each invocation. The order of iteration through the features is undefined. */ - lat: number; + forEach(callback: (arg0: google.maps.Data.Feature) => void): void; /** - * Longitude in degrees. Values outside the range [-180, 180] will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. + * Returns the position of the drawing controls on the map. */ - lng: number; - } - /** - * A LatLng is a point in geographical coordinates: latitude and longitude.
Although the default map projection associates longitude with the x-coordinate of the map, and latitude with the y-coordinate, the latitude coordinate is always written first, followed by the longitude.
Notice that you cannot modify the coordinates of a LatLng. If you want to compute another point, you have to create a new one.

Most methods that accept LatLng objects also accept a {@link google.maps.LatLngLiteral} object, so that the following are equivalent:

 map.setCenter(new google.maps.LatLng(-34, 151));
map.setCenter({lat: -34, lng: 151});

The constructor also accepts {@link google.maps.LatLngLiteral} and LatLng objects. If a LatLng instance is passed to the constructor, a copy is created.

The possible calls to the constructor are below:

 new google.maps.LatLng(-34, 151);
new google.maps.LatLng(-34, 151, true);
new google.maps.LatLng({lat: -34, lng: 151});
new google.maps.LatLng({lat: -34, lng: 151}, true);
new google.maps.LatLng(new google.maps.LatLng(-34, 151));
new google.maps.LatLng(new google.maps.LatLng(-34, 151), true);
- * Access by calling `const {LatLng} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class LatLng { + getControlPosition(): google.maps.ControlPosition | null; /** - * Creates a LatLng object representing a geographic point. Latitude is specified in degrees within the range [-90, 90]. Longitude is specified in degrees within the range [-180, 180). Set noClampNoWrap to true to enable values outside of this range. Note the ordering of latitude and longitude. - * @param latOrLatLngOrLatLngLiteral - * @param lngOrNoClampNoWrap - * @param noClampNoWrap + * Returns which drawing modes are available for the user to select, in the order they are displayed. This does not include the null drawing mode, which is added by default. Possible drawing modes are "Point", "LineString" or "Polygon". */ - constructor(latOrLatLngOrLatLngLiteral: number | google.maps.LatLngLiteral | google.maps.LatLng, lngOrNoClampNoWrap?: number | boolean | null, noClampNoWrap?: boolean); + getControls(): string[] | null; /** - * Comparison function for two LatLngs. Returns true if the coordinates are within 1e-9 of each other and false otherwise. + * Returns the current drawing mode of the given Data layer. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything. Possible drawing modes are null, "Point", "LineString" or "Polygon". */ - equals(other: google.maps.LatLng | google.maps.LatLngLiteral | null | undefined): boolean; + getDrawingMode(): string | null; /** - * Returns the latitude in degrees. + * Returns the feature with the given ID, if it exists in the collection. Otherwise returns undefined.

Note that the IDs 1234 and '1234' are equivalent. Either can be used to look up the same feature. */ - lat(): number; + getFeatureById(id: number | string): google.maps.Data.Feature | undefined; /** - * Returns the longitude in degrees. + * Returns the map on which the features are displayed. */ - lng(): number; + getMap(): google.maps.Map | null; /** - * Converts to JSON representation. This function is intended to be used via JSON.stringify. + * Gets the style for all features in the collection. */ - toJSON(): google.maps.LatLngLiteral; + getStyle(): google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null; /** - * Converts to string representation. + * Loads GeoJSON from a URL, and adds the features to the collection.

NOTE: The GeoJSON is fetched using XHR, and may not work cross-domain. If you have issues, we recommend you fetch the GeoJSON using your choice of AJAX library, and then call addGeoJson(). */ - toString(): string; + loadGeoJson(url: string, options?: google.maps.Data.GeoJsonOptions | null, callback?: ((arg0: google.maps.Data.Feature[]) => void)): void; /** - * Returns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default. + * Changes the style of a feature. These changes are applied on top of the style specified by setStyle(). Style properties set to null revert to the value specified via setStyle(). */ - toUrlValue(precision?: number): string; - } - /** - * Describes a symbol, which consists of a vector path with styling. A symbol can be used as the icon of a marker, or placed on a polyline. - */ - export interface Symbol { + overrideStyle(feature: google.maps.Data.Feature, style: google.maps.Data.StyleOptions): void; /** - * The position of the symbol relative to the marker or polyline. The coordinates of the symbol's path are translated left and up by the anchor's x and y coordinates respectively. The position is expressed in the same coordinate system as the symbol's path. - * @defaultValue google.maps.Point(0,0) + * Removes a feature from the collection. */ - anchor?: google.maps.Point | null; + remove(feature: google.maps.Data.Feature): void; /** - * The symbol's fill color. All CSS3 colors are supported except for extended named colors. For symbol markers, this defaults to 'black'. For symbols on polylines, this defaults to the stroke color of the corresponding polyline. + * Removes the effect of previous overrideStyle() calls. The style of the given feature reverts to the style specified by setStyle().

If no feature is given, all features have their style reverted.

*/ - fillColor?: string | null; + revertStyle(feature?: google.maps.Data.Feature | null): void; /** - * The symbol's fill opacity. - * @defaultValue 0 + * Sets the position of the drawing controls on the map. */ - fillOpacity?: number | null; + setControlPosition(controlPosition: google.maps.ControlPosition | null): void; /** - * The origin of the label relative to the origin of the path, if label is supplied by the marker. The origin is expressed in the same coordinate system as the symbol's path. This property is unused for symbols on polylines. - * @defaultValue google.maps.Point(0,0) + * Sets which drawing modes are available for the user to select, in the order they are displayed. This should not include the null drawing mode, which is added by default. If null, drawing controls are disabled and not displayed. Possible drawing modes are "Point", "LineString" or "Polygon". */ - labelOrigin?: google.maps.Point | null; + setControls(controls: string[] | null): void; /** - * The symbol's path, which is a built-in symbol path, or a custom path expressed using SVG path notation. Required. + * Sets the current drawing mode of the given Data layer. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything. Possible drawing modes are null, "Point", "LineString" or "Polygon". */ - path: google.maps.SymbolPath | string; + setDrawingMode(drawingMode: string | null): void; /** - * The angle by which to rotate the symbol, expressed clockwise in degrees. A symbol in an IconSequence where fixedRotation is false is rotated relative to the angle of the edge on which it lies. - * @defaultValue 0 + * Renders the features on the specified map. If map is set to null, the features will be removed from the map. */ - rotation?: number | null; + setMap(map: google.maps.Map | null): void; /** - * The amount by which the symbol is scaled in size. For symbol markers, this defaults to 1; after scaling, the symbol may be of any size. For symbols on a polyline, this defaults to the stroke weight of the polyline; after scaling, the symbol must lie inside a square 22 pixels in size centered at the symbol's anchor. + * Sets the style for all features in the collection. Styles specified on a per-feature basis via overrideStyle() continue to apply.

Pass either an object with the desired style options, or a function that computes the style for each feature. The function will be called every time a feature's properties are updated. */ - scale?: number | null; + setStyle(style: google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null): void; /** - * The symbol's stroke color. All CSS3 colors are supported except for extended named colors. For symbol markers, this defaults to 'black'. For symbols on a polyline, this defaults to the stroke color of the polyline. + * Exports the features in the collection to a GeoJSON object. */ - strokeColor?: string | null; + toGeoJson(callback: (arg0: object) => void): void; + } + /** + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * An interface representing a feature from a Dataset. The featureType of a DatasetFeature will always be FeatureType.DATASET. + */ + export interface DatasetFeature extends google.maps.Feature { /** - * The symbol's stroke opacity. For symbol markers, this defaults to 1. For symbols on a polyline, this defaults to the stroke opacity of the polyline. + * Key-value mapping of the feature's attributes. */ - strokeOpacity?: number | null; + datasetAttributes: { [key: string]: string }; /** - * The symbol's stroke weight. - * @defaultValue The {@link google.maps.Symbol.scale} of the symbol. + * Dataset id of the dataset that this feature belongs to. */ - strokeWeight?: number | null; + datasetId: string; } /** - * Base class implementing KVO.

The MVCObject constructor is guaranteed to be an empty function, and so you may inherit from MVCObject by writing MySubclass.prototype = new google.maps.MVCObject();. Unless otherwise noted, this is not true of other classes in the API, and inheriting from other classes in the API is not supported. - * Access by calling `const {MVCObject} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A single geocoded waypoint. */ - export class MVCObject { + export interface DirectionsGeocodedWaypoint { /** - * Creates an MVCObject. + * Whether the geocoder did not return an exact match for the original waypoint, though it was able to match part of the requested address. */ - constructor(); + partial_match?: boolean; /** - * Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with google.maps.event.removeListener. + * The place ID associated with the waypoint. Place IDs uniquely identify a place in the Google Places database and on Google Maps. Learn more about Place IDs in the Places API developer guide. */ - addListener(eventName: string, handler: Function): google.maps.MapsEventListener; + place_id?: string; /** - * Binds a View to a Model. + * An array of strings denoting the type of the returned geocoded element. For a list of possible strings, refer to the Address Component Types section of the Developer's Guide. */ - bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null, noNotify?: boolean): void; + types?: string[]; + } + /** + * A single leg consisting of a set of steps in a DirectionsResult. Some fields in the leg may not be returned for all requests. Note that though this result is "JSON-like," it is not strictly JSON, as it directly and indirectly includes LatLng objects. + */ + export interface DirectionsLeg { /** - * Gets a value. + * An estimated arrival time for this leg. Only applicable for TRANSIT requests. */ - get(key: string): any; + arrival_time?: google.maps.Time; /** - * Notify all observers of a change on this property. This notifies both objects that are bound to the object's property as well as the object that it is bound to. + * An estimated departure time for this leg. Only applicable for TRANSIT requests. */ - notify(key: string): void; + departure_time?: google.maps.Time; /** - * Sets a value. + * The total distance covered by this leg. This property may be undefined as the distance may be unknown. */ - set(key: string, value: unknown): void; + distance?: google.maps.Distance; /** - * Sets a collection of key-value pairs. + * The total duration of this leg. This property may be undefined as the duration may be unknown. */ - setValues(values?: object | null): void; + duration?: google.maps.Duration; /** - * Removes a binding. Unbinding will set the unbound property to the current value. The object will not be notified, as the value has not changed. + * The total duration of this leg, taking into account the traffic conditions indicated by the trafficModel property. This property may be undefined as the duration may be unknown. */ - unbind(key: string): void; + duration_in_traffic?: google.maps.Duration; /** - * Removes all bindings. + * The address of the destination of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address. */ - unbindAll(): void; + end_address: string; + /** + * The DirectionsService calculates directions between locations by using the nearest transportation option (usually a road) at the start and end locations. end_location indicates the actual geocoded destination, which may be different than the end_location of the last step if, for example, the road is not near the destination of this leg. + */ + end_location: google.maps.LatLng; + /** + * The address of the origin of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address. + */ + start_address: string; + /** + * The DirectionsService calculates directions between locations by using the nearest transportation option (usually a road) at the start and end locations. start_location indicates the actual geocoded origin, which may be different than the start_location of the first step if, for example, the road is not near the origin of this leg. + */ + start_location: google.maps.LatLng; + /** + * An array of DirectionsSteps, each of which contains information about the individual steps in this leg. + */ + steps: google.maps.DirectionsStep[]; + /** + * An array of non-stopover waypoints along this leg, which were specified in the original request.

Deprecated in alternative routes. Version 3.27 will be the last version of the API that adds extra via_waypoints in alternative routes.

When using the Directions Service to implement draggable directions, it is recommended to disable dragging of alternative routes. Only the main route should be draggable. Users can drag the main route until it matches an alternative route. + */ + via_waypoints: google.maps.LatLng[]; + /** + * Information about traffic speed along the leg. + * @deprecated This array will always be empty. + */ + traffic_speed_entry: unknown[]; } /** - * Projection interface. + * An object containing a points property to describe the polyline of a {@link google.maps.DirectionsStep}. */ - export interface Projection { - /** - * Translates from the LatLng cylinder to the Point plane. This interface specifies a function which implements translation from given LatLng values to world coordinates on the map projection. The Maps API calls this method when it needs to plot locations on screen. Projection objects must implement this method, but may return null if the projection cannot calculate the Point. - */ - fromLatLngToPoint(latLng: google.maps.LatLng | google.maps.LatLngLiteral, point?: google.maps.Point): google.maps.Point | null; + export interface DirectionsPolyline { /** - * This interface specifies a function which implements translation from world coordinates on a map projection to LatLng values. The Maps API calls this method when it needs to translate actions on screen to positions on the map. Projection objects must implement this method, but may return null if the projection cannot calculate the LatLng. + * An encoded polyline. */ - fromPointToLatLng(pixel: google.maps.Point, noClampNoWrap?: boolean): google.maps.LatLng | null; + points: string; } /** - * This interface defines the map type, and is typically used for custom map types. Immutable. + * Access by calling `const {DirectionsRenderer} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated google.maps.DirectionsRenderer is deprecated as of February 25th, 2026. At this time, google.maps.DirectionsRenderer is not scheduled to be discontinued and will continue to receive bug fixes for any major regressions. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details. */ - export interface MapType { + export class DirectionsRenderer extends google.maps.MVCObject { /** - * Alt text to display when this MapType's button is hovered over in the MapTypeControl. Optional. + * Creates the renderer with the given options. Directions can be rendered on a map (as visual overlays) or additionally on a <div> panel (as textual instructions). + * @param opts */ - alt: string | null; + constructor(opts?: google.maps.DirectionsRendererOptions | null); /** - * The maximum zoom level for the map when displaying this MapType. Required for base MapTypes, ignored for overlay MapTypes. + * Returns the renderer's current set of directions. */ - maxZoom: number; + getDirections(): google.maps.DirectionsResult | null; /** - * The minimum zoom level for the map when displaying this MapType. Optional; defaults to 0. + * Returns the map on which the DirectionsResult is rendered. */ - minZoom: number; + getMap(): google.maps.Map | null; /** - * Name to display in the MapTypeControl. Optional. + * Returns the panel <div> in which the DirectionsResult is rendered. */ - name: string | null; + getPanel(): HTMLElement | null; /** - * The Projection used to render this MapType. Optional; defaults to Mercator. + * Returns the current (zero-based) route index in use by this DirectionsRenderer object. */ - projection: google.maps.Projection | null; + getRouteIndex(): number; /** - * Radius of the planet for the map, in meters. Optional; defaults to Earth's equatorial radius of 6378137 meters. + * Set the renderer to use the result from the DirectionsService. Setting a valid set of directions in this manner will display the directions on the renderer's designated map and panel. */ - radius: number; + setDirections(directions: google.maps.DirectionsResult | null): void; /** - * The dimensions of each tile. Required. + * This method specifies the map on which directions will be rendered. Pass null to remove the directions from the map. */ - tileSize: google.maps.Size | null; + setMap(map: google.maps.Map | null): void; /** - * Returns a tile for the given tile coordinate (x, y) and zoom level. This tile will be appended to the given ownerDocument. Not available for base map types. + * Change the options settings of this DirectionsRenderer after initialization. */ - getTile(tileCoord: google.maps.Point, zoom: number, ownerDocument: Document): Element | null; + setOptions(options: google.maps.DirectionsRendererOptions | null): void; /** - * Releases the given tile, performing any necessary cleanup. The provided tile will have already been removed from the document. Optional. + * This method renders the directions in a <div>. Pass null to remove the content from the panel. */ - releaseTile(tile: Element | null): void; + setPanel(panel: HTMLElement | null): void; + /** + * Set the (zero-based) index of the route in the DirectionsResult object to render. By default, the first route in the array will be rendered. + */ + setRouteIndex(routeIndex: number): void; } /** - * A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian. - * Access by calling `const {LatLngBounds} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This object defines the properties that can be set on a DirectionsRenderer object. */ - export class LatLngBounds { + export interface DirectionsRendererOptions { /** - * Constructs a rectangle from the points at its south-west and north-east corners. - * @param swOrLatLngBounds - * @param ne + * The directions to display on the map and/or in a <div> panel, retrieved as a DirectionsResult object from DirectionsService. */ - constructor(swOrLatLngBounds?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null, ne?: google.maps.LatLng | google.maps.LatLngLiteral | null); + directions?: google.maps.DirectionsResult | null; /** - * Returns true if the given lat/lng is in this bounds. + * If true, allows the user to drag and modify the paths of routes rendered by this DirectionsRenderer. */ - contains(latLng: google.maps.LatLng | google.maps.LatLngLiteral): boolean; + draggable?: boolean | null; /** - * Returns true if this bounds approximately equals the given bounds. + * This property indicates whether the renderer should provide a user-selectable list of routes shown in the directions panel. + * @defaultValue false */ - equals(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): boolean; + hideRouteList?: boolean | null; /** - * Extends this bounds to contain the given point. + * The InfoWindow in which to render text information when a marker is clicked. Existing info window content will be overwritten and its position moved. If no info window is specified, the DirectionsRenderer will create and use its own info window. This property will be ignored if suppressInfoWindows is set to true. */ - extend(point: google.maps.LatLng | google.maps.LatLngLiteral): google.maps.LatLngBounds; + infoWindow?: google.maps.InfoWindow | null; /** - * Computes the center of this LatLngBounds + * Map on which to display the directions. */ - getCenter(): google.maps.LatLng; + map?: google.maps.Map | null; /** - * Returns the north-east corner of this bounds. + * Options for the markers. All markers rendered by the DirectionsRenderer will use these options. */ - getNorthEast(): google.maps.LatLng; + markerOptions?: google.maps.MarkerOptions | null; /** - * Returns the south-west corner of this bounds. + * The <div> in which to display the directions steps. */ - getSouthWest(): google.maps.LatLng; + panel?: HTMLElement | null; /** - * Returns true if this bounds shares any points with the other bounds. + * Options for the polylines. All polylines rendered by the DirectionsRenderer will use these options. */ - intersects(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): boolean; + polylineOptions?: google.maps.PolylineOptions | null; /** - * Returns if the bounds are empty. + * If this option is set to true or the map's center and zoom were never set, the input map is centered and zoomed to the bounding box of this set of directions. + * @defaultValue false */ - isEmpty(): boolean; + preserveViewport?: boolean | null; /** - * Converts to JSON representation. This function is intended to be used via JSON.stringify. + * The index of the route within the DirectionsResult object. The default value is 0. */ - toJSON(): google.maps.LatLngBoundsLiteral; + routeIndex?: number | null; /** - * Converts the given map bounds to a lat/lng span. + * Suppress the rendering of the BicyclingLayer when bicycling directions are requested. */ - toSpan(): google.maps.LatLng; + suppressBicyclingLayer?: boolean | null; /** - * Converts to string. + * Suppress the rendering of info windows. */ - toString(): string; + suppressInfoWindows?: boolean | null; /** - * Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box. + * Suppress the rendering of markers. */ - toUrlValue(precision?: number): string; + suppressMarkers?: boolean | null; /** - * Extends this bounds to contain the union of this and the given bounds. + * Suppress the rendering of polylines. */ - union(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): google.maps.LatLngBounds; - /** - * LatLngBounds for the max bounds of the Earth. These bounds will encompass the entire globe. - */ - static readonly MAX_BOUNDS: google.maps.LatLngBounds; + suppressPolylines?: boolean | null; } /** - * A layer for displaying geospatial data. Points, line-strings and polygons can be displayed.

Every Map has a Data object by default, so most of the time there is no need to construct one. For example:

 var myMap = new google.maps.Map(...);
myMap.data.addGeoJson(...);
myMap.data.setStyle(...);
The Data object is a collection of Features. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A directions query to be sent to the DirectionsService. */ - export class Data extends google.maps.MVCObject { - /** - * Creates an empty collection, with the given DataOptions. - * @param options - */ - constructor(options?: google.maps.Data.DataOptions | null); - /** - * Adds a feature to the collection, and returns the added feature.

If the feature has an ID, it will replace any existing feature in the collection with the same ID. If no feature is given, a new feature will be created with null geometry and no properties. If FeatureOptions are given, a new feature will be created with the specified properties.

Note that the IDs 1234 and '1234' are equivalent. Adding a feature with ID 1234 will replace a feature with ID '1234', and vice versa. - */ - add(feature?: google.maps.Data.Feature | google.maps.Data.FeatureOptions | null): google.maps.Data.Feature; - /** - * Adds GeoJSON features to the collection. Give this method a parsed JSON. The imported features are returned. Throws an exception if the GeoJSON could not be imported. - */ - addGeoJson(geoJson: object, options?: google.maps.Data.GeoJsonOptions | null): google.maps.Data.Feature[]; - /** - * Checks whether the given feature is in the collection. - */ - contains(feature: google.maps.Data.Feature): boolean; - /** - * Repeatedly invokes the given function, passing a feature in the collection to the function on each invocation. The order of iteration through the features is undefined. - */ - forEach(callback: (arg0: google.maps.Data.Feature) => void): void; - /** - * Returns the position of the drawing controls on the map. - */ - getControlPosition(): google.maps.ControlPosition | null; - /** - * Returns which drawing modes are available for the user to select, in the order they are displayed. This does not include the null drawing mode, which is added by default. Possible drawing modes are "Point", "LineString" or "Polygon". - */ - getControls(): string[] | null; - /** - * Returns the current drawing mode of the given Data layer. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything. Possible drawing modes are null, "Point", "LineString" or "Polygon". - */ - getDrawingMode(): string | null; - /** - * Returns the feature with the given ID, if it exists in the collection. Otherwise returns undefined.

Note that the IDs 1234 and '1234' are equivalent. Either can be used to look up the same feature. - */ - getFeatureById(id: number | string): google.maps.Data.Feature | undefined; + export interface DirectionsRequest { /** - * Returns the map on which the features are displayed. + * If true, instructs the Directions service to avoid ferries where possible. Optional. */ - getMap(): google.maps.Map | null; + avoidFerries?: boolean; /** - * Gets the style for all features in the collection. + * If true, instructs the Directions service to avoid highways where possible. Optional. */ - getStyle(): google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null; + avoidHighways?: boolean; /** - * Loads GeoJSON from a URL, and adds the features to the collection.

NOTE: The GeoJSON is fetched using XHR, and may not work cross-domain. If you have issues, we recommend you fetch the GeoJSON using your choice of AJAX library, and then call addGeoJson(). + * If true, instructs the Directions service to avoid toll roads where possible. Optional. */ - loadGeoJson(url: string, options?: google.maps.Data.GeoJsonOptions | null, callback?: ((arg0: google.maps.Data.Feature[]) => void)): void; + avoidTolls?: boolean; /** - * Changes the style of a feature. These changes are applied on top of the style specified by setStyle(). Style properties set to null revert to the value specified via setStyle(). + * Location of destination. This can be specified as either a string to be geocoded, or a LatLng, or a Place. Required. */ - overrideStyle(feature: google.maps.Data.Feature, style: google.maps.Data.StyleOptions): void; + destination: string | google.maps.LatLng | google.maps.Place | google.maps.LatLngLiteral; /** - * Removes a feature from the collection. + * Settings that apply only to requests where travelMode is DRIVING. This object will have no effect for other travel modes. */ - remove(feature: google.maps.Data.Feature): void; + drivingOptions?: google.maps.DrivingOptions; /** - * Removes the effect of previous overrideStyle() calls. The style of the given feature reverts to the style specified by setStyle().

If no feature is given, all features have their style reverted.

+ * A language identifier for the language in which results should be returned, when possible. See the list of supported languages. */ - revertStyle(feature?: google.maps.Data.Feature | null): void; + language?: string | null; /** - * Sets the position of the drawing controls on the map. + * If set to true, the DirectionsService will attempt to re-order the supplied intermediate waypoints to minimize overall cost of the route. If waypoints are optimized, inspect DirectionsRoute.waypoint_order in the response to determine the new ordering. */ - setControlPosition(controlPosition: google.maps.ControlPosition | null): void; + optimizeWaypoints?: boolean; /** - * Sets which drawing modes are available for the user to select, in the order they are displayed. This should not include the null drawing mode, which is added by default. If null, drawing controls are disabled and not displayed. Possible drawing modes are "Point", "LineString" or "Polygon". + * Location of origin. This can be specified as either a string to be geocoded, or a LatLng, or a Place. Required. */ - setControls(controls: string[] | null): void; + origin: string | google.maps.LatLng | google.maps.Place | google.maps.LatLngLiteral; /** - * Sets the current drawing mode of the given Data layer. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything. Possible drawing modes are null, "Point", "LineString" or "Polygon". + * Whether or not route alternatives should be provided. Optional. */ - setDrawingMode(drawingMode: string | null): void; + provideRouteAlternatives?: boolean; /** - * Renders the features on the specified map. If map is set to null, the features will be removed from the map. + * Region code used as a bias for geocoding requests. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - setMap(map: google.maps.Map | null): void; + region?: string | null; /** - * Sets the style for all features in the collection. Styles specified on a per-feature basis via overrideStyle() continue to apply.

Pass either an object with the desired style options, or a function that computes the style for each feature. The function will be called every time a feature's properties are updated. + * Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for other travel modes. */ - setStyle(style: google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null): void; + transitOptions?: google.maps.TransitOptions; /** - * Exports the features in the collection to a GeoJSON object. + * Type of routing requested. Required. */ - toGeoJson(callback: (arg0: object) => void): void; - } - /** - * The valid unit systems that can be specified in a DirectionsRequest. - * - * Access by calling `const {UnitSystem} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum UnitSystem { + travelMode: google.maps.TravelModeString; /** - * Specifies that distances in the DirectionsResult should be expressed in imperial units. + * Preferred unit system to use when displaying distance. + * @defaultValue The unit system used in the country of origin. */ - IMPERIAL = 1, + unitSystem?: google.maps.UnitSystem; /** - * Specifies that distances in the DirectionsResult should be expressed in metric units. + * Array of intermediate waypoints. Directions are calculated from the origin to the destination by way of each waypoint in this array. See the developer's guide for the maximum number of waypoints allowed. Waypoints are not supported for transit directions. Optional. */ - METRIC = 0, + waypoints?: google.maps.DirectionsWaypoint[]; } /** - * The valid travel modes that can be specified in a DirectionsRequest as well as the travel modes returned in a DirectionsStep. Specify these by value, or by using the constant's name. For example, 'BICYCLING' or google.maps.TravelMode.BICYCLING. - * - * Access by calling `const {TravelMode} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The directions response retrieved from the directions server. You can render these using a {@link google.maps.DirectionsRenderer} or parse this object and render it yourself. You must display the warnings and copyrights as noted in the Google Maps Platform Terms of Service. Note that though this result is "JSON-like," it is not strictly JSON, as it indirectly includes LatLng objects. */ - export enum TravelMode { - /** - * Specifies a bicycling directions request. - */ - BICYCLING = 'BICYCLING', + export interface DirectionsResult { /** - * Specifies a driving directions request. + * Contains an array of available travel modes. This field is returned when a request specifies a travel mode and gets no results. The array contains the available travel modes in the countries of the given set of waypoints. This field is not returned if one or more of the waypoints are 'via waypoints'. */ - DRIVING = 'DRIVING', + available_travel_modes?: google.maps.TravelModeString[]; /** - * Specifies a transit directions request. + * An array of DirectionsGeocodedWaypoints, each of which contains information about the geocoding of origin, destination and waypoints. */ - TRANSIT = 'TRANSIT', + geocoded_waypoints?: google.maps.DirectionsGeocodedWaypoint[]; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Specifies a two-wheeler directions request. + * The DirectionsRequest that yielded this result. */ - TWO_WHEELER = 'TWO_WHEELER', + request: google.maps.DirectionsRequest; /** - * Specifies a walking directions request. + * An array of DirectionsRoutes, each of which contains information about the legs and steps of which it is composed. There will only be one route unless the DirectionsRequest was made with provideRouteAlternatives set to true. */ - WALKING = 'WALKING', + routes: google.maps.DirectionsRoute[]; } - export type TravelModeString = `${google.maps.TravelMode}`; /** - * A directions query to be sent to the DirectionsService. + * A single route containing a set of legs in a DirectionsResult. Note that though this object is "JSON-like," it is not strictly JSON, as it directly and indirectly includes LatLng objects. */ - export interface DirectionsRequest { - /** - * If true, instructs the Directions service to avoid ferries where possible. Optional. - */ - avoidFerries?: boolean; - /** - * If true, instructs the Directions service to avoid highways where possible. Optional. - */ - avoidHighways?: boolean; - /** - * If true, instructs the Directions service to avoid toll roads where possible. Optional. - */ - avoidTolls?: boolean; - /** - * Location of destination. This can be specified as either a string to be geocoded, or a LatLng, or a Place. Required. - */ - destination: string | google.maps.LatLng | google.maps.Place | google.maps.LatLngLiteral; - /** - * Settings that apply only to requests where travelMode is DRIVING. This object will have no effect for other travel modes. - */ - drivingOptions?: google.maps.DrivingOptions; + export interface DirectionsRoute { /** - * A language identifier for the language in which results should be returned, when possible. See the list of supported languages. + * The bounds for this route. */ - language?: string | null; + bounds: google.maps.LatLngBounds; /** - * If set to true, the DirectionsService will attempt to re-order the supplied intermediate waypoints to minimize overall cost of the route. If waypoints are optimized, inspect DirectionsRoute.waypoint_order in the response to determine the new ordering. + * Copyrights text to be displayed for this route. */ - optimizeWaypoints?: boolean; + copyrights: string; /** - * Location of origin. This can be specified as either a string to be geocoded, or a LatLng, or a Place. Required. + * The total fare for the whole transit trip. Only applicable to transit requests. */ - origin: string | google.maps.LatLng | google.maps.Place | google.maps.LatLngLiteral; + fare?: google.maps.TransitFare; /** - * Whether or not route alternatives should be provided. Optional. + * An array of DirectionsLegs, each of which contains information about the steps of which it is composed. There will be one leg for each stopover waypoint or destination specified. So a route with no stopover waypoints will contain one DirectionsLeg and a route with one stopover waypoint will contain two. */ - provideRouteAlternatives?: boolean; + legs: google.maps.DirectionsLeg[]; /** - * Region code used as a bias for geocoding requests. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * An array of LatLngs representing the entire course of this route. The path is simplified in order to make it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs). */ - region?: string | null; + overview_path: google.maps.LatLng[]; /** - * Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for other travel modes. + * An encoded polyline representation of the route in overview_path. This polyline is an approximate (smoothed) path of the resulting directions. */ - transitOptions?: google.maps.TransitOptions; + overview_polyline: string; /** - * Type of routing requested. Required. + * Contains a short textual description for the route, suitable for naming and disambiguating the route from alternatives. */ - travelMode: google.maps.TravelModeString; + summary: string; /** - * Preferred unit system to use when displaying distance. - * @defaultValue The unit system used in the country of origin. + * Warnings to be displayed when showing these directions. */ - unitSystem?: google.maps.UnitSystem; + warnings: string[]; /** - * Array of intermediate waypoints. Directions are calculated from the origin to the destination by way of each waypoint in this array. See the developer's guide for the maximum number of waypoints allowed. Waypoints are not supported for transit directions. Optional. + * If optimizeWaypoints was set to true, this field will contain the re-ordered permutation of the input waypoints. For example, if the input was:
  Origin: Los Angeles
  Waypoints: Dallas, Bangor, Phoenix
  Destination: New York
and the optimized output was ordered as follows:
  Origin: Los Angeles
  Waypoints: Phoenix, Dallas, Bangor
  Destination: New York
then this field will be an Array containing the values [2, 0, 1]. Note that the numbering of waypoints is zero-based.
If any of the input waypoints has stopover set to false, this field will be empty, since route optimization is not available for such queries. */ - waypoints?: google.maps.DirectionsWaypoint[]; + waypoint_order: number[]; } /** * Access by calling `const {DirectionsService} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. @@ -913,295 +989,294 @@ declare namespace google.maps { } export type DirectionsStatusString = `${google.maps.DirectionsStatus}`; /** - * The assumptions to use when predicting duration in traffic. Specified as part of a DirectionsRequest or DistanceMatrixRequest. Specify these by value, or by using the constant's name. For example, 'bestguess' or google.maps.TrafficModel.BEST_GUESS. - * - * Access by calling `const {TrafficModel} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A single DirectionsStep in a DirectionsResult. Some fields may be undefined. Note that though this object is "JSON-like," it is not strictly JSON, as it directly includes LatLng objects. */ - export enum TrafficModel { + export interface DirectionsStep { /** - * Use historical traffic data to best estimate the time spent in traffic. + * The distance covered by this step. This property may be undefined as the distance may be unknown. */ - BEST_GUESS = 'bestguess', + distance?: google.maps.Distance; /** - * Use historical traffic data to make an optimistic estimate of what the duration in traffic will be. + * The typical time required to perform this step in seconds and in text form. This property may be undefined as the duration may be unknown. */ - OPTIMISTIC = 'optimistic', + duration?: google.maps.Duration; /** - * Use historical traffic data to make a pessimistic estimate of what the duration in traffic will be. + * An encoded polyline representation of the step. This is an approximate (smoothed) path of the step. */ - PESSIMISTIC = 'pessimistic', - } - export type TrafficModelString = `${google.maps.TrafficModel}`; - /** - * The valid transit mode e.g. bus that can be specified in a TransitOptions. Specify these by value, or by using the constant's name. For example, 'BUS' or google.maps.TransitMode.BUS. - * - * Access by calling `const {TransitMode} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum TransitMode { + encoded_lat_lngs: string; /** - * Specifies bus as a preferred mode of transit. + * The ending location of this step. */ - BUS = 'BUS', + end_location: google.maps.LatLng; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Specifies light rail as a preferred mode of transit. + * Instructions for this step. */ - LIGHT_RAIL = 'LIGHT_RAIL', + instructions: string; /** - * Specifies rail as a preferred mode of transit. + * Contains the action to take for the current step (turn-left, merge, straight, etc.). Values are subject to change, and new values may be introduced without prior notice. */ - RAIL = 'RAIL', + maneuver: string; /** - * Specifies subway as a preferred mode of transit. + * A sequence of LatLngs describing the course of this step. This is an approximate (smoothed) path of the step. */ - SUBWAY = 'SUBWAY', + path: google.maps.LatLng[]; /** - * Specifies train as a preferred mode of transit. + * The starting location of this step. */ - TRAIN = 'TRAIN', + start_location: google.maps.LatLng; /** - * Specifies tram as a preferred mode of transit. + * Sub-steps of this step. Specified for non-transit sections of transit routes. */ - TRAM = 'TRAM', - } - export type TransitModeString = `${google.maps.TransitMode}`; - /** - * The valid transit route type that can be specified in a TransitOptions. Specify these by value, or by using the constant's name. For example, 'LESS_WALKING' or google.maps.TransitRoutePreference.LESS_WALKING. - * - * Access by calling `const {TransitRoutePreference} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum TransitRoutePreference { - /** - * Specifies that the calculated route should prefer a limited number of transfers. - */ - FEWER_TRANSFERS = 'FEWER_TRANSFERS', + steps?: google.maps.DirectionsStep[]; /** - * Specifies that the calculated route should prefer limited amounts of walking. + * Transit-specific details about this step. This property will be undefined unless the travel mode of this step is TRANSIT. */ - LESS_WALKING = 'LESS_WALKING', - } - export type TransitRoutePreferenceString = `${google.maps.TransitRoutePreference}`; - /** - * Possible values for vehicle types. - * - * Access by calling `const {VehicleType} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum VehicleType { + transit?: google.maps.TransitDetails; /** - * Bus. + * Details pertaining to this step if the travel mode is TRANSIT. */ - BUS = 'BUS', + transit_details?: google.maps.TransitDetails; /** - * A vehicle that operates on a cable, usually on the ground. Aerial cable cars may be of the type GONDOLA_LIFT. + * The mode of travel used in this step. */ - CABLE_CAR = 'CABLE_CAR', + travel_mode: google.maps.TravelModeString; /** - * Commuter rail. + * The starting location of this step. + * @deprecated Please use {@link google.maps.DirectionsStep.start_location}. */ - COMMUTER_TRAIN = 'COMMUTER_TRAIN', + start_point: google.maps.LatLng; /** - * Ferry. + * The ending location of this step. + * @deprecated Please use {@link google.maps.DirectionsStep.end_location}. */ - FERRY = 'FERRY', + end_point: google.maps.LatLng; /** - * A vehicle that is pulled up a steep incline by a cable. + * A sequence of LatLngs describing the course of this step. This is an approximate (smoothed) path of the step. + * @deprecated Please use {@link google.maps.DirectionsStep.path}. */ - FUNICULAR = 'FUNICULAR', + lat_lngs: google.maps.LatLng[]; /** - * An aerial cable car. + * Contains an object with a single property, 'points', that holds an encoded polyline representation of the step. This polyline is an approximate (smoothed) path of the step. + * @deprecated Please use {@link google.maps.DirectionsStep.encoded_lat_lngs}. */ - GONDOLA_LIFT = 'GONDOLA_LIFT', + polyline?: google.maps.DirectionsPolyline; + } + /** + * A DirectionsWaypoint represents a location between origin and destination through which the trip should be routed. + */ + export interface DirectionsWaypoint { /** - * Heavy rail. + * Waypoint location. Can be an address string, a LatLng, or a Place. Optional. */ - HEAVY_RAIL = 'HEAVY_RAIL', + location?: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place; /** - * High speed train. + * If true, indicates that this waypoint is a stop between the origin and destination. This has the effect of splitting the route into two legs. If false, indicates that the route should be biased to go through this waypoint, but not split into two legs. This is useful if you want to create a route in response to the user dragging waypoints on a map. + * @defaultValue true */ - HIGH_SPEED_TRAIN = 'HIGH_SPEED_TRAIN', + stopover?: boolean; + } + /** + * A representation of distance as a numeric value and a display string. + */ + export interface Distance { /** - * Intercity bus. + * A string representation of the distance value, using the UnitSystem specified in the request. */ - INTERCITY_BUS = 'INTERCITY_BUS', + text: string; /** - * Light rail. + * The distance in meters. */ - METRO_RAIL = 'METRO_RAIL', + value: number; + } + /** + * The element-level status about a particular origin-destination pairing returned by the DistanceMatrixService upon completion of a distance matrix request. These values are specified as strings, for example, 'OK'. + * + * Access by calling `const {DistanceMatrixElementStatus} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum DistanceMatrixElementStatus { /** - * Monorail. + * The origin and/or destination of this pairing could not be geocoded. */ - MONORAIL = 'MONORAIL', + NOT_FOUND = 'NOT_FOUND', /** - * Other vehicles. + * The response contains a valid result. */ - OTHER = 'OTHER', + OK = 'OK', /** - * Rail. + * No route could be found between the origin and destination. */ - RAIL = 'RAIL', + ZERO_RESULTS = 'ZERO_RESULTS', + } + export type DistanceMatrixElementStatusString = `${google.maps.DistanceMatrixElementStatus}`; + /** + * A distance matrix query sent by the DistanceMatrixService containing arrays of origin and destination locations, and various options for computing metrics. + */ + export interface DistanceMatrixRequest { /** - * Share taxi is a sort of bus transport with ability to drop off and pick up passengers anywhere on its route. Generally share taxi uses minibus vehicles. + * If true, instructs the Distance Matrix service to avoid ferries where possible. Optional. */ - SHARE_TAXI = 'SHARE_TAXI', + avoidFerries?: boolean; /** - * Underground light rail. + * If true, instructs the Distance Matrix service to avoid highways where possible. Optional. */ - SUBWAY = 'SUBWAY', + avoidHighways?: boolean; /** - * Above ground light rail. + * If true, instructs the Distance Matrix service to avoid toll roads where possible. Optional. */ - TRAM = 'TRAM', + avoidTolls?: boolean; /** - * Trolleybus. + * An array containing destination address strings, or LatLng, or Place objects, to which to calculate distance and time. Required. */ - TROLLEYBUS = 'TROLLEYBUS', - } - export type VehicleTypeString = `${google.maps.VehicleType}`; - /** - * The directions response retrieved from the directions server. You can render these using a {@link google.maps.DirectionsRenderer} or parse this object and render it yourself. You must display the warnings and copyrights as noted in the Google Maps Platform Terms of Service. Note that though this result is "JSON-like," it is not strictly JSON, as it indirectly includes LatLng objects. - */ - export interface DirectionsResult { + destinations: (string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place)[]; /** - * Contains an array of available travel modes. This field is returned when a request specifies a travel mode and gets no results. The array contains the available travel modes in the countries of the given set of waypoints. This field is not returned if one or more of the waypoints are 'via waypoints'. + * Settings that apply only to requests where travelMode is DRIVING. This object will have no effect for other travel modes. */ - available_travel_modes?: google.maps.TravelModeString[]; + drivingOptions?: google.maps.DrivingOptions; /** - * An array of DirectionsGeocodedWaypoints, each of which contains information about the geocoding of origin, destination and waypoints. + * A language identifier for the language in which results should be returned, when possible. See the list of supported languages. */ - geocoded_waypoints?: google.maps.DirectionsGeocodedWaypoint[]; + language?: string | null; /** - * The DirectionsRequest that yielded this result. + * An array containing origin address strings, or LatLng, or Place objects, from which to calculate distance and time. Required. */ - request: google.maps.DirectionsRequest; + origins: (string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place)[]; /** - * An array of DirectionsRoutes, each of which contains information about the legs and steps of which it is composed. There will only be one route unless the DirectionsRequest was made with provideRouteAlternatives set to true. + * Region code used as a bias for geocoding requests. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - routes: google.maps.DirectionsRoute[]; - } - /** - * A single geocoded waypoint. - */ - export interface DirectionsGeocodedWaypoint { + region?: string | null; /** - * Whether the geocoder did not return an exact match for the original waypoint, though it was able to match part of the requested address. + * Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for other travel modes. */ - partial_match?: boolean; + transitOptions?: google.maps.TransitOptions; /** - * The place ID associated with the waypoint. Place IDs uniquely identify a place in the Google Places database and on Google Maps. Learn more about Place IDs in the Places API developer guide. + * Type of routing requested. Required. */ - place_id?: string; + travelMode: google.maps.TravelModeString; /** - * An array of strings denoting the type of the returned geocoded element. For a list of possible strings, refer to the Address Component Types section of the Developer's Guide. + * Preferred unit system to use when displaying distance. Optional; defaults to metric. */ - types?: string[]; + unitSystem?: google.maps.UnitSystem; } /** - * A single route containing a set of legs in a DirectionsResult. Note that though this object is "JSON-like," it is not strictly JSON, as it directly and indirectly includes LatLng objects. + * The response to a DistanceMatrixService request, consisting of the formatted origin and destination addresses, and a sequence of DistanceMatrixResponseRows, one for each corresponding origin address. */ - export interface DirectionsRoute { - /** - * The bounds for this route. - */ - bounds: google.maps.LatLngBounds; + export interface DistanceMatrixResponse { /** - * Copyrights text to be displayed for this route. + * The formatted destination addresses. */ - copyrights: string; + destinationAddresses: string[]; /** - * The total fare for the whole transit trip. Only applicable to transit requests. + * The formatted origin addresses. */ - fare?: google.maps.TransitFare; + originAddresses: string[]; /** - * An array of DirectionsLegs, each of which contains information about the steps of which it is composed. There will be one leg for each stopover waypoint or destination specified. So a route with no stopover waypoints will contain one DirectionsLeg and a route with one stopover waypoint will contain two. + * The rows of the matrix, corresponding to the origin addresses. */ - legs: google.maps.DirectionsLeg[]; + rows: google.maps.DistanceMatrixResponseRow[]; + } + /** + * A single element of a response to a DistanceMatrixService request, which contains the duration and distance from one origin to one destination. + */ + export interface DistanceMatrixResponseElement { /** - * An array of LatLngs representing the entire course of this route. The path is simplified in order to make it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs). + * The distance for this origin-destination pairing. This property may be undefined as the distance may be unknown. */ - overview_path: google.maps.LatLng[]; + distance: google.maps.Distance; /** - * An encoded polyline representation of the route in overview_path. This polyline is an approximate (smoothed) path of the resulting directions. + * The duration for this origin-destination pairing. This property may be undefined as the duration may be unknown. */ - overview_polyline: string; + duration: google.maps.Duration; /** - * Contains a short textual description for the route, suitable for naming and disambiguating the route from alternatives. + * The duration for this origin-destination pairing, taking into account the traffic conditions indicated by the trafficModel property. This property may be undefined as the duration may be unknown. Only available to Premium Plan customers when drivingOptions is defined when making the request. */ - summary: string; + duration_in_traffic: google.maps.Duration; /** - * Warnings to be displayed when showing these directions. + * The total fare for this origin-destination pairing. Only applicable to transit requests. */ - warnings: string[]; + fare: google.maps.TransitFare; /** - * If optimizeWaypoints was set to true, this field will contain the re-ordered permutation of the input waypoints. For example, if the input was:
  Origin: Los Angeles
  Waypoints: Dallas, Bangor, Phoenix
  Destination: New York
and the optimized output was ordered as follows:
  Origin: Los Angeles
  Waypoints: Phoenix, Dallas, Bangor
  Destination: New York
then this field will be an Array containing the values [2, 0, 1]. Note that the numbering of waypoints is zero-based.
If any of the input waypoints has stopover set to false, this field will be empty, since route optimization is not available for such queries. + * The status of this particular origin-destination pairing. */ - waypoint_order: number[]; + status: google.maps.DistanceMatrixElementStatusString; } /** - * A single leg consisting of a set of steps in a DirectionsResult. Some fields in the leg may not be returned for all requests. Note that though this result is "JSON-like," it is not strictly JSON, as it directly and indirectly includes LatLng objects. + * A row of the response to a DistanceMatrixService request, consisting of a sequence of DistanceMatrixResponseElements, one for each corresponding destination address. */ - export interface DirectionsLeg { - /** - * An estimated arrival time for this leg. Only applicable for TRANSIT requests. - */ - arrival_time?: google.maps.Time; + export interface DistanceMatrixResponseRow { /** - * An estimated departure time for this leg. Only applicable for TRANSIT requests. + * The row's elements, corresponding to the destination addresses. */ - departure_time?: google.maps.Time; + elements: google.maps.DistanceMatrixResponseElement[]; + } + /** + * Access by calling `const {DistanceMatrixService} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated google.maps.DistanceMatrixService is deprecated as of February 25th, 2026. At this time, google.maps.DistanceMatrixService is not scheduled to be discontinued and will continue to receive bug fixes for any major regressions. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details. + */ + export class DistanceMatrixService { /** - * The total distance covered by this leg. This property may be undefined as the distance may be unknown. + * Creates a new instance of a DistanceMatrixService that sends distance matrix queries to Google servers. */ - distance?: google.maps.Distance; + constructor(); /** - * The total duration of this leg. This property may be undefined as the duration may be unknown. + * Issues a distance matrix request. */ - duration?: google.maps.Duration; + getDistanceMatrix(request: google.maps.DistanceMatrixRequest, callback?: ((arg0: google.maps.DistanceMatrixResponse | null, arg1: google.maps.DistanceMatrixStatusString) => void)): Promise; + } + /** + * The top-level status about the request in general returned by the DistanceMatrixService upon completion of a distance matrix request. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.DistanceMatrixStatus.OK. + * + * Access by calling `const {DistanceMatrixStatus} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum DistanceMatrixStatus { /** - * The total duration of this leg, taking into account the traffic conditions indicated by the trafficModel property. This property may be undefined as the duration may be unknown. + * The provided request was invalid. */ - duration_in_traffic?: google.maps.Duration; + INVALID_REQUEST = 'INVALID_REQUEST', /** - * The address of the destination of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address. + * The request contains more than 25 origins, or more than 25 destinations. */ - end_address: string; + MAX_DIMENSIONS_EXCEEDED = 'MAX_DIMENSIONS_EXCEEDED', /** - * The DirectionsService calculates directions between locations by using the nearest transportation option (usually a road) at the start and end locations. end_location indicates the actual geocoded destination, which may be different than the end_location of the last step if, for example, the road is not near the destination of this leg. + * The product of origins and destinations exceeds the per-query limit. */ - end_location: google.maps.LatLng; + MAX_ELEMENTS_EXCEEDED = 'MAX_ELEMENTS_EXCEEDED', /** - * The address of the origin of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address. + * The response contains a valid result. */ - start_address: string; + OK = 'OK', /** - * The DirectionsService calculates directions between locations by using the nearest transportation option (usually a road) at the start and end locations. start_location indicates the actual geocoded origin, which may be different than the start_location of the first step if, for example, the road is not near the origin of this leg. + * Too many elements have been requested within the allowed time period. The request should succeed if you try again after some time. */ - start_location: google.maps.LatLng; + OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', /** - * An array of DirectionsSteps, each of which contains information about the individual steps in this leg. + * The service denied use of the Distance Matrix service by your web page. */ - steps: google.maps.DirectionsStep[]; + REQUEST_DENIED = 'REQUEST_DENIED', /** - * An array of non-stopover waypoints along this leg, which were specified in the original request.

Deprecated in alternative routes. Version 3.27 will be the last version of the API that adds extra via_waypoints in alternative routes.

When using the Directions Service to implement draggable directions, it is recommended to disable dragging of alternative routes. Only the main route should be draggable. Users can drag the main route until it matches an alternative route. + * A Distance Matrix request could not be processed due to a server error. The request may succeed if you try again. */ - via_waypoints: google.maps.LatLng[]; - /** - * Information about traffic speed along the leg. - * @deprecated This array will always be empty. - */ - traffic_speed_entry: unknown[]; + UNKNOWN_ERROR = 'UNKNOWN_ERROR', + } + export type DistanceMatrixStatusString = `${google.maps.DistanceMatrixStatus}`; + + export interface DrawingLibrary { + + DrawingManager: typeof google.maps.drawing.DrawingManager; + + OverlayType: typeof google.maps.drawing.OverlayType; } /** - * A representation of distance as a numeric value and a display string. + * Configures the DirectionsRequest when the travel mode is set to DRIVING. */ - export interface Distance { + export interface DrivingOptions { /** - * A string representation of the distance value, using the UnitSystem specified in the request. + * The desired departure time for the route, specified as a Date object. The Date object measures time in milliseconds since 1 January 1970. This must be specified for a DrivingOptions to be valid. The departure time must be set to the current time or some time in the future. It cannot be in the past. */ - text: string; + departureTime: Date; /** - * The distance in meters. + * The preferred assumption to use when predicting duration in traffic. The default is BEST_GUESS. */ - value: number; + trafficModel?: google.maps.TrafficModelString; } /** * A representation of duration as a numeric value and a display string. @@ -1216,1378 +1291,1461 @@ declare namespace google.maps { */ value: number; } + + export interface ElevationLibrary { + + ElevationService: typeof google.maps.ElevationService; + + ElevationStatus: typeof google.maps.ElevationStatus; + } /** - * A single DirectionsStep in a DirectionsResult. Some fields may be undefined. Note that though this object is "JSON-like," it is not strictly JSON, as it directly includes LatLng objects. + * The result of an ElevationService request, consisting of the set of elevation coordinates and their elevation values. Note that a single request may produce multiple ElevationResults. */ - export interface DirectionsStep { - /** - * The distance covered by this step. This property may be undefined as the distance may be unknown. - */ - distance?: google.maps.Distance; - /** - * The typical time required to perform this step in seconds and in text form. This property may be undefined as the duration may be unknown. - */ - duration?: google.maps.Duration; - /** - * An encoded polyline representation of the step. This is an approximate (smoothed) path of the step. - */ - encoded_lat_lngs: string; - /** - * The ending location of this step. - */ - end_location: google.maps.LatLng; + export interface ElevationResult { /** - * Instructions for this step. + * The elevation of this point on Earth, in meters above sea level. */ - instructions: string; + elevation: number; /** - * Contains the action to take for the current step (turn-left, merge, straight, etc.). Values are subject to change, and new values may be introduced without prior notice. + * The location of this elevation result. */ - maneuver: string; + location: google.maps.LatLng | null; /** - * A sequence of LatLngs describing the course of this step. This is an approximate (smoothed) path of the step. + * The distance, in meters, between sample points from which the elevation was interpolated. This property will be missing if the resolution is not known. Note that elevation data becomes more coarse (larger resolution values) when multiple points are passed. To obtain the most accurate elevation value for a point, it should be queried independently. */ - path: google.maps.LatLng[]; + resolution: number; + } + /** + * Defines a service class that talks directly to Google servers for requesting elevation data. + * Access by calling `const {ElevationService} = await google.maps.importLibrary("elevation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class ElevationService { /** - * The starting location of this step. + * Creates a new instance of a ElevationService that sends elevation queries to Google servers. */ - start_location: google.maps.LatLng; + constructor(); /** - * Sub-steps of this step. Specified for non-transit sections of transit routes. + * Makes an elevation request along a path, where the elevation data are returned as distance-based samples along that path. */ - steps?: google.maps.DirectionsStep[]; + getElevationAlongPath(request: google.maps.PathElevationRequest, callback?: ((arg0: google.maps.ElevationResult[] | null, arg1: google.maps.ElevationStatusString) => void)): Promise; /** - * Transit-specific details about this step. This property will be undefined unless the travel mode of this step is TRANSIT. + * Makes an elevation request for a list of discrete locations. */ - transit?: google.maps.TransitDetails; + getElevationForLocations(request: google.maps.LocationElevationRequest, callback?: ((arg0: google.maps.ElevationResult[] | null, arg1: google.maps.ElevationStatusString) => void)): Promise; + } + /** + * The status returned by the ElevationService upon completion of an elevation request. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.ElevationStatus.OK. + * + * Access by calling `const {ElevationStatus} = await google.maps.importLibrary("elevation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum ElevationStatus { /** - * Details pertaining to this step if the travel mode is TRANSIT. + * The request was invalid. */ - transit_details?: google.maps.TransitDetails; + INVALID_REQUEST = 'INVALID_REQUEST', /** - * The mode of travel used in this step. + * The request did not encounter any errors. */ - travel_mode: google.maps.TravelModeString; + OK = 'OK', /** - * The starting location of this step. - * @deprecated Please use {@link google.maps.DirectionsStep.start_location}. + * The webpage has gone over the requests limit in too short a period of time. */ - start_point: google.maps.LatLng; + OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', /** - * The ending location of this step. - * @deprecated Please use {@link google.maps.DirectionsStep.end_location}. + * The webpage is not allowed to use the elevation service. */ - end_point: google.maps.LatLng; + REQUEST_DENIED = 'REQUEST_DENIED', /** - * A sequence of LatLngs describing the course of this step. This is an approximate (smoothed) path of the step. - * @deprecated Please use {@link google.maps.DirectionsStep.path}. + * The elevation request could not be successfully processed, yet the exact reason for the failure is not known. */ - lat_lngs: google.maps.LatLng[]; + UNKNOWN_ERROR = 'UNKNOWN_ERROR', + } + export type ElevationStatusString = `${google.maps.ElevationStatus}`; + /** + * An event with an associated Error. + */ + export interface ErrorEvent { /** - * Contains an object with a single property, 'points', that holds an encoded polyline representation of the step. This polyline is an approximate (smoothed) path of the step. - * @deprecated Please use {@link google.maps.DirectionsStep.encoded_lat_lngs}. + * The Error related to the event. */ - polyline?: google.maps.DirectionsPolyline; + error: Error; } /** - * An object containing a points property to describe the polyline of a {@link google.maps.DirectionsStep}. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Extra computations to perform while completing a geocoding request. + * + * Access by calling `const {ExtraGeocodeComputation} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface DirectionsPolyline { + export enum ExtraGeocodeComputation { /** - * An encoded polyline. + * Generate an address descriptor. */ - points: string; + ADDRESS_DESCRIPTORS = 'ADDRESS_DESCRIPTORS', } + export type ExtraGeocodeComputationString = `${google.maps.ExtraGeocodeComputation}`; /** - * Access by calling `const {DirectionsRenderer} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated google.maps.DirectionsRenderer is deprecated as of February 25th, 2026. At this time, google.maps.DirectionsRenderer is not scheduled to be discontinued and will continue to receive bug fixes for any major regressions. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details. + * An interface representing a vector map tile feature. These are inputs to the FeatureStyleFunction. Do not save a reference to a particular Feature object because the reference will not be stable. */ - export class DirectionsRenderer extends google.maps.MVCObject { + export interface Feature { /** - * Creates the renderer with the given options. Directions can be rendered on a map (as visual overlays) or additionally on a <div> panel (as textual instructions). - * @param opts + * FeatureType of this Feature. */ - constructor(opts?: google.maps.DirectionsRendererOptions | null); + featureType: google.maps.FeatureTypeString; + } + /** + * An interface representing a map layer containing features of a specific {@link google.maps.FeatureType} whose style can be overridden client-side, or have events attached. + */ + export interface FeatureLayer { /** - * Returns the renderer's current set of directions. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * The Dataset ID for this FeatureLayer. Only present if the featureType is FeatureType.DATASET. */ - getDirections(): google.maps.DirectionsResult | null; + datasetId?: string; /** - * Returns the map on which the DirectionsResult is rendered. + * The FeatureType associated with this FeatureLayer. */ - getMap(): google.maps.Map | null; + featureType: google.maps.FeatureTypeString; /** - * Returns the panel <div> in which the DirectionsResult is rendered. + * Whether this FeatureLayer is available, meaning whether Data-driven styling is available for this map (there is a map ID using vector tiles with this FeatureLayer enabled in the Google Cloud Console map style.) If this is false (or becomes false), styling on this FeatureLayer returns to default and events are not triggered. */ - getPanel(): HTMLElement | null; + isAvailable: boolean; /** - * Returns the current (zero-based) route index in use by this DirectionsRenderer object. + * The style of Features in the FeatureLayer. The style is applied when style is set. If your style function updates, you must set the style property again. A FeatureStyleFunction must return consistent results when it is applied over the map tiles, and should be optimized for performance. Asynchronous functions are not supported. If you use a FeatureStyleOptions, all features of that layer will be styled with the same FeatureStyleOptions. Set the style to null to remove the previously set style. If this FeatureLayer is not available, setting style does nothing and logs an error. */ - getRouteIndex(): number; + style?: google.maps.FeatureStyleOptions | google.maps.FeatureStyleFunction | null; /** - * Set the renderer to use the result from the DirectionsService. Setting a valid set of directions in this manner will display the directions on the renderer's designated map and panel. + * Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with {@link google.maps.event.removeListener}. */ - setDirections(directions: google.maps.DirectionsResult | null): void; + addListener(eventName: string, handler: Function): google.maps.MapsEventListener; + } + /** + * This object is returned from a mouse event on a FeatureLayer. + */ + export interface FeatureMouseEvent extends google.maps.MapMouseEvent { /** - * This method specifies the map on which directions will be rendered. Pass null to remove the directions from the map. + * The Features at this mouse event. */ - setMap(map: google.maps.Map | null): void; + features: google.maps.Feature[]; + } + + export type FeatureStyleFunction = (arg0: google.maps.FeatureStyleFunctionOptions) => (google.maps.FeatureStyleOptions | null | undefined); + /** + * Options passed to a FeatureStyleFunction. + */ + export interface FeatureStyleFunctionOptions { /** - * Change the options settings of this DirectionsRenderer after initialization. + * Feature passed into the FeatureStyleFunction for styling. */ - setOptions(options: google.maps.DirectionsRendererOptions | null): void; + feature: google.maps.Feature; + } + /** + * These options specify the way the style of a Feature should be modified on a map. + */ + export interface FeatureStyleOptions { /** - * This method renders the directions in a <div>. Pass null to remove the content from the panel. + * Hex RGB string (like "#00FF00" for green). Only applies to polygon geometries. */ - setPanel(panel: HTMLElement | null): void; + fillColor?: string; /** - * Set the (zero-based) index of the route in the DirectionsResult object to render. By default, the first route in the array will be rendered. + * The fill opacity between 0.0 and 1.0. Only applies to polygon geometries. */ - setRouteIndex(routeIndex: number): void; - } - /** - * The element-level status about a particular origin-destination pairing returned by the DistanceMatrixService upon completion of a distance matrix request. These values are specified as strings, for example, 'OK'. - * - * Access by calling `const {DistanceMatrixElementStatus} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum DistanceMatrixElementStatus { + fillOpacity?: number; /** - * The origin and/or destination of this pairing could not be geocoded. + * Hex RGB string (like "#00FF00" for green). */ - NOT_FOUND = 'NOT_FOUND', + strokeColor?: string; /** - * The response contains a valid result. + * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon geometries. */ - OK = 'OK', + strokeOpacity?: number; /** - * No route could be found between the origin and destination. + * The stroke width in pixels. Only applies to line and polygon geometries. */ - ZERO_RESULTS = 'ZERO_RESULTS', + strokeWeight?: number; } - export type DistanceMatrixElementStatusString = `${google.maps.DistanceMatrixElementStatus}`; /** - * A distance matrix query sent by the DistanceMatrixService containing arrays of origin and destination locations, and various options for computing metrics. + * Identifiers for feature types. + * + * Access by calling `const {FeatureType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface DistanceMatrixRequest { + export enum FeatureType { /** - * If true, instructs the Distance Matrix service to avoid ferries where possible. Optional. + * Indicates a first-order civil entity below the country level. */ - avoidFerries?: boolean; + ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1', /** - * If true, instructs the Distance Matrix service to avoid highways where possible. Optional. + * Indicates a second-order civil entity below the country level. */ - avoidHighways?: boolean; + ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2', /** - * If true, instructs the Distance Matrix service to avoid toll roads where possible. Optional. + * Indicates the national political entity. */ - avoidTolls?: boolean; + COUNTRY = 'COUNTRY', /** - * An array containing destination address strings, or LatLng, or Place objects, to which to calculate distance and time. Required. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Indicates a third-party dataset. */ - destinations: (string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place)[]; + DATASET = 'DATASET', /** - * Settings that apply only to requests where travelMode is DRIVING. This object will have no effect for other travel modes. + * Indicates an incorporated city or town political entity. */ - drivingOptions?: google.maps.DrivingOptions; + LOCALITY = 'LOCALITY', /** - * A language identifier for the language in which results should be returned, when possible. See the list of supported languages. + * Indicates a postal code as used to address postal mail within the country. Includes zip codes. */ - language?: string | null; - /** - * An array containing origin address strings, or LatLng, or Place objects, from which to calculate distance and time. Required. - */ - origins: (string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place)[]; + POSTAL_CODE = 'POSTAL_CODE', /** - * Region code used as a bias for geocoding requests. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * Indicates a school district. */ - region?: string | null; + SCHOOL_DISTRICT = 'SCHOOL_DISTRICT', + } + export type FeatureTypeString = `${google.maps.FeatureType}`; + /** + * Options for the rendering of the fullscreen control. + */ + export interface FullscreenControlOptions { /** - * Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for other travel modes. + * Position id. Used to specify the position of the control on the map. + * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_START} */ - transitOptions?: google.maps.TransitOptions; + position?: google.maps.ControlPosition | null; + } + /** + * A service for converting between an address and a LatLng. + * Access by calling `const {Geocoder} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Geocoder { /** - * Type of routing requested. Required. + * Creates a new instance of a Geocoder that sends geocode requests to Google servers. */ - travelMode: google.maps.TravelModeString; + constructor(); /** - * Preferred unit system to use when displaying distance. Optional; defaults to metric. + * Geocode a request. */ - unitSystem?: google.maps.UnitSystem; + geocode(request: google.maps.GeocoderRequest, callback?: ((arg0: google.maps.GeocoderResult[] | null, arg1: google.maps.GeocoderStatusString) => void) | null): Promise; } /** - * The response to a DistanceMatrixService request, consisting of the formatted origin and destination addresses, and a sequence of DistanceMatrixResponseRows, one for each corresponding origin address. + * A single address component within a GeocoderResult. A full address may consist of multiple address components. */ - export interface DistanceMatrixResponse { - /** - * The formatted destination addresses. - */ - destinationAddresses: string[]; + export interface GeocoderAddressComponent { /** - * The formatted origin addresses. + * The full text of the address component */ - originAddresses: string[]; + long_name: string; /** - * The rows of the matrix, corresponding to the origin addresses. + * The abbreviated, short text of the given address component */ - rows: google.maps.DistanceMatrixResponseRow[]; - } - /** - * A row of the response to a DistanceMatrixService request, consisting of a sequence of DistanceMatrixResponseElements, one for each corresponding destination address. - */ - export interface DistanceMatrixResponseRow { + short_name: string; /** - * The row's elements, corresponding to the destination addresses. + * An array of strings denoting the type of this address component. A list of valid types can be found here */ - elements: google.maps.DistanceMatrixResponseElement[]; + types: string[]; } /** - * A single element of a response to a DistanceMatrixService request, which contains the duration and distance from one origin to one destination. + * GeocoderComponentRestrictions represents a set of filters that resolve to a specific area. For details on how this works, see Geocoding Component Filtering. */ - export interface DistanceMatrixResponseElement { + export interface GeocoderComponentRestrictions { /** - * The distance for this origin-destination pairing. This property may be undefined as the distance may be unknown. + * Matches all the administrative_area levels. Optional. */ - distance: google.maps.Distance; + administrativeArea?: string; /** - * The duration for this origin-destination pairing. This property may be undefined as the duration may be unknown. + * Matches a country name or a two letter ISO 3166-1 country code. Optional. */ - duration: google.maps.Duration; + country?: string; /** - * The duration for this origin-destination pairing, taking into account the traffic conditions indicated by the trafficModel property. This property may be undefined as the duration may be unknown. Only available to Premium Plan customers when drivingOptions is defined when making the request. + * Matches against both locality and sublocality types. Optional. */ - duration_in_traffic: google.maps.Duration; + locality?: string; /** - * The total fare for this origin-destination pairing. Only applicable to transit requests. + * Matches postal_code and postal_code_prefix. Optional. */ - fare: google.maps.TransitFare; + postalCode?: string; /** - * The status of this particular origin-destination pairing. + * Matches the long or short name of a route. Optional. */ - status: google.maps.DistanceMatrixElementStatusString; + route?: string; } /** - * Access by calling `const {DistanceMatrixService} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated google.maps.DistanceMatrixService is deprecated as of February 25th, 2026. At this time, google.maps.DistanceMatrixService is not scheduled to be discontinued and will continue to receive bug fixes for any major regressions. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details. + * Geometry information about this GeocoderResult */ - export class DistanceMatrixService { - /** - * Creates a new instance of a DistanceMatrixService that sends distance matrix queries to Google servers. - */ - constructor(); + export interface GeocoderGeometry { /** - * Issues a distance matrix request. + * The precise bounds of this GeocoderResult, if applicable */ - getDistanceMatrix(request: google.maps.DistanceMatrixRequest, callback?: ((arg0: google.maps.DistanceMatrixResponse | null, arg1: google.maps.DistanceMatrixStatusString) => void)): Promise; - } - /** - * The top-level status about the request in general returned by the DistanceMatrixService upon completion of a distance matrix request. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.DistanceMatrixStatus.OK. - * - * Access by calling `const {DistanceMatrixStatus} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum DistanceMatrixStatus { + bounds?: google.maps.LatLngBounds; /** - * The provided request was invalid. + * The latitude/longitude coordinates of this result */ - INVALID_REQUEST = 'INVALID_REQUEST', + location: google.maps.LatLng; /** - * The request contains more than 25 origins, or more than 25 destinations. + * The type of location returned in location */ - MAX_DIMENSIONS_EXCEEDED = 'MAX_DIMENSIONS_EXCEEDED', + location_type: google.maps.GeocoderLocationTypeString; /** - * The product of origins and destinations exceeds the per-query limit. + * The bounds of the recommended viewport for displaying this GeocoderResult */ - MAX_ELEMENTS_EXCEEDED = 'MAX_ELEMENTS_EXCEEDED', + viewport: google.maps.LatLngBounds; + } + /** + * Describes the type of location returned from a geocode. Specify these by value, or by using the constant's name. For example, 'ROOFTOP' or google.maps.GeocoderLocationType.ROOFTOP. + * + * Access by calling `const {GeocoderLocationType} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum GeocoderLocationType { /** - * The response contains a valid result. + * The returned result is approximate. */ - OK = 'OK', + APPROXIMATE = 'APPROXIMATE', /** - * Too many elements have been requested within the allowed time period. The request should succeed if you try again after some time. + * The returned result is the geometric center of a result such a line (e.g. street) or polygon (region). */ - OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', + GEOMETRIC_CENTER = 'GEOMETRIC_CENTER', /** - * The service denied use of the Distance Matrix service by your web page. + * The returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address. */ - REQUEST_DENIED = 'REQUEST_DENIED', + RANGE_INTERPOLATED = 'RANGE_INTERPOLATED', /** - * A Distance Matrix request could not be processed due to a server error. The request may succeed if you try again. + * The returned result reflects a precise geocode. */ - UNKNOWN_ERROR = 'UNKNOWN_ERROR', + ROOFTOP = 'ROOFTOP', } - export type DistanceMatrixStatusString = `${google.maps.DistanceMatrixStatus}`; + export type GeocoderLocationTypeString = `${google.maps.GeocoderLocationType}`; /** - * Defines a service class that talks directly to Google servers for requesting elevation data. - * Access by calling `const {ElevationService} = await google.maps.importLibrary("elevation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The specification for a geocoding request to be sent to the Geocoder. */ - export class ElevationService { + export interface GeocoderRequest { /** - * Creates a new instance of a ElevationService that sends elevation queries to Google servers. + * Address to geocode. One, and only one, of address, location and placeId must be supplied. */ - constructor(); + address?: string | null; /** - * Makes an elevation request along a path, where the elevation data are returned as distance-based samples along that path. + * LatLngBounds within which to search. Optional. */ - getElevationAlongPath(request: google.maps.PathElevationRequest, callback?: ((arg0: google.maps.ElevationResult[] | null, arg1: google.maps.ElevationStatusString) => void)): Promise; + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * Makes an elevation request for a list of discrete locations. + * Components are used to restrict results to a specific area. A filter consists of one or more of: route, locality, administrativeArea, postalCode, country. Only the results that match all the filters will be returned. Filter values support the same methods of spelling correction and partial matching as other geocoding requests. Optional. */ - getElevationForLocations(request: google.maps.LocationElevationRequest, callback?: ((arg0: google.maps.ElevationResult[] | null, arg1: google.maps.ElevationStatusString) => void)): Promise; - } - /** - * The status returned by the ElevationService upon completion of an elevation request. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.ElevationStatus.OK. - * - * Access by calling `const {ElevationStatus} = await google.maps.importLibrary("elevation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum ElevationStatus { + componentRestrictions?: google.maps.GeocoderComponentRestrictions | null; /** - * The request was invalid. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A list of extra computations which may be used to complete the request. Note: These extra computations may return extra fields on the response. */ - INVALID_REQUEST = 'INVALID_REQUEST', + extraComputations?: google.maps.ExtraGeocodeComputationString[]; /** - * The request did not encounter any errors. + * Fulfill the promise on a ZERO_RESULT status in the response. This may be desired because even with zero geocoding results there may still be additional response level fields returned. */ - OK = 'OK', + fulfillOnZeroResults?: boolean | null; /** - * The webpage has gone over the requests limit in too short a period of time. + * A language identifier for the language in which results should be returned, when possible. See the list of supported languages. */ - OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', + language?: string | null; /** - * The webpage is not allowed to use the elevation service. + * LatLng (or LatLngLiteral) for which to search. The geocoder performs a reverse geocode. See Reverse Geocoding for more information. One, and only one, of address, location and placeId must be supplied. */ - REQUEST_DENIED = 'REQUEST_DENIED', + location?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * The elevation request could not be successfully processed, yet the exact reason for the failure is not known. + * The place ID associated with the location. Place IDs uniquely identify a place in the Google Places database and on Google Maps. Learn more about place IDs in the Places API developer guide. The geocoder performs a reverse geocode. See Reverse Geocoding for more information. One, and only one, of address, location and placeId must be supplied. */ - UNKNOWN_ERROR = 'UNKNOWN_ERROR', + placeId?: string | null; + /** + * Country code used to bias the search, specified as a two-character (non-numeric) Unicode region subtag / CLDR identifier. Optional. See Google Maps Platform Coverage Details for supported regions. + */ + region?: string | null; } - export type ElevationStatusString = `${google.maps.ElevationStatus}`; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A relational description of a location. Includes a ranked set of nearby landmarks and the areas containing the target location. + * A Geocoder response returned by the {@link google.maps.Geocoder} containing the list of {@link google.maps.GeocoderResult}s. */ - export interface AddressDescriptor { + export interface GeocoderResponse { /** - * A ranked list of containing or adjacent areas. The most useful (recognizable and precise) areas are ranked first. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A relational description of a location. Includes a ranked set of nearby landmarks and the areas containing the target location. It is only populated for reverse geocoding requests and only when {@link google.maps.ExtraGeocodeComputation.ADDRESS_DESCRIPTORS} is enabled. */ - areas: google.maps.Area[]; + address_descriptor?: google.maps.AddressDescriptor | null; /** - * A ranked list of nearby landmarks. The most useful (recognizable and nearby) landmarks are ranked first. + * The plus code associated with the location. */ - landmarks: google.maps.Landmark[]; + plus_code?: google.maps.places.PlacePlusCode | null; + /** + * The list of {@link google.maps.GeocoderResult}s. + */ + results: google.maps.GeocoderResult[]; } /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A place that represents a point of reference for the address. + * A single geocoder result retrieved from the geocode server. A geocode request may return multiple result objects. Note that though this result is "JSON-like," it is not strictly JSON, as it indirectly includes a LatLng object. */ - export interface Landmark { + export interface GeocoderResult { /** - * The name for the landmark. + * An array of GeocoderAddressComponents */ - display_name: string; + address_components: google.maps.GeocoderAddressComponent[]; /** - * The language of the name for the landmark. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A relational description of the location associated with this geocode. Includes a ranked set of nearby landmarks and the areas containing the target location. This will only be populated for forward geocoding and place ID lookup requests, only when {@link google.maps.ExtraGeocodeComputation.ADDRESS_DESCRIPTORS} is enabled, and only for certain localized places. */ - display_name_language_code: string; + address_descriptor?: google.maps.AddressDescriptor; /** - * The Place ID of the underlying establishment serving as the landmark. Can be used to resolve more information about the landmark through Place Details or Place Id Lookup. + * A string containing the human-readable address of this location. */ - place_id: string; + formatted_address: string; /** - * Defines the spatial relationship between the target location and the landmark. + * A GeocoderGeometry object */ - spatial_relationship: google.maps.SpatialRelationshipString; + geometry: google.maps.GeocoderGeometry; /** - * The straight line distance between the target location and the landmark. + * Whether the geocoder did not return an exact match for the original request, though it was able to match part of the requested address. If an exact match, the value will be undefined. */ - straight_line_distance_meters: number; + partial_match?: boolean; /** - * The travel distance along the road network between the target location and the landmark. This can be unpopulated if the landmark is disconnected from the part of the road network the target is closest to OR if the target location was not actually considered to be on the road network. + * The place ID associated with the location. Place IDs uniquely identify a place in the Google Places database and on Google Maps. Learn more about Place IDs in the Places API developer guide. */ - travel_distance_meters?: number; + place_id: string; /** - * One or more values indicating the type of the returned result. Please see Types for more detail. + * The plus code associated with the location. + */ + plus_code?: google.maps.places.PlacePlusCode; + /** + * An array of strings denoting all the localities contained in a postal code. This is only present when the result is a postal code that contains multiple localities. + */ + postcode_localities?: string[]; + /** + * An array of strings denoting the type of the returned geocoded element. For a list of possible strings, refer to the Address Component Types section of the Developer's Guide. */ types: string[]; } /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * An enum representing the relationship in space between the landmark and the target. + * The status returned by the Geocoder on the completion of a call to geocode(). Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.GeocoderStatus.OK. * - * Access by calling `const {SpatialRelationship} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {GeocoderStatus} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum SpatialRelationship { + export enum GeocoderStatus { /** - * The target is directly opposite the landmark on the other side of the road. + * There was a problem contacting the Google servers. */ - ACROSS_THE_ROAD = 'ACROSS_THE_ROAD', + ERROR = 'ERROR', /** - * Not on the same route as the landmark but a single turn away. + * This GeocoderRequest was invalid. */ - AROUND_THE_CORNER = 'AROUND_THE_CORNER', + INVALID_REQUEST = 'INVALID_REQUEST', /** - * Close to the landmark's structure but further away from its access point. + * The response contains a valid GeocoderResponse. */ - BEHIND = 'BEHIND', + OK = 'OK', /** - * The target is directly adjacent to the landmark. + * The webpage has gone over the requests limit in too short a period of time. */ - BESIDE = 'BESIDE', + OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', /** - * On the same route as the landmark but not besides or across. + * The webpage is not allowed to use the geocoder. */ - DOWN_THE_ROAD = 'DOWN_THE_ROAD', + REQUEST_DENIED = 'REQUEST_DENIED', /** - * This is the default relationship when nothing more specific below applies. + * A geocoding request could not be processed due to a server error. The request may succeed if you try again. */ - NEAR = 'NEAR', + UNKNOWN_ERROR = 'UNKNOWN_ERROR', /** - * The landmark has a spatial geometry and the target is within its bounds. + * No result was found for this GeocoderRequest. */ - WITHIN = 'WITHIN', + ZERO_RESULTS = 'ZERO_RESULTS', + } + export type GeocoderStatusString = `${google.maps.GeocoderStatus}`; + + export interface GeocodingLibrary { + + Containment: typeof google.maps.Containment; + + ExtraGeocodeComputation: typeof google.maps.ExtraGeocodeComputation; + + Geocoder: typeof google.maps.Geocoder; + + GeocoderLocationType: typeof google.maps.GeocoderLocationType; + + GeocoderStatus: typeof google.maps.GeocoderStatus; + + SpatialRelationship: typeof google.maps.SpatialRelationship; + } + + export interface GeometryLibrary { + + encoding: typeof google.maps.geometry.encoding; + + poly: typeof google.maps.geometry.poly; + + spherical: typeof google.maps.geometry.spherical; } - export type SpatialRelationshipString = `${google.maps.SpatialRelationship}`; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A place that is a small region, such as a neighborhood, sublocality, or large complex that contains the target location. + * A rectangular image overlay on the map. + * Access by calling `const {GroundOverlay} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface Area { + export class GroundOverlay extends google.maps.MVCObject { /** - * Defines the spatial relationship between the target location and the area. + * Creates a ground overlay from the provided image URL and its LatLngBounds. The image is scaled to fit the current bounds, and projected using the current map projection. + * @param url + * @param bounds + * @param opts */ - containment: google.maps.ContainmentString; + constructor(url: string, bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null, opts?: google.maps.GroundOverlayOptions | null); /** - * The name for the area. + * Gets the LatLngBounds of this overlay. */ - display_name: string; + getBounds(): google.maps.LatLngBounds | null; /** - * The language of the name for the area. + * Returns the map on which this ground overlay is displayed. */ - display_name_language_code: string; + getMap(): google.maps.Map | null; /** - * The Place ID of the underlying area. Can be used to resolve more information about the area through Place Details or Place ID Lookup. + * Returns the opacity of this ground overlay. */ - place_id: string; - } - /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * An enum representing the spatial relationship between the area and the target location. - * - * Access by calling `const {Containment} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum Containment { + getOpacity(): number; /** - * The target location is outside the area region, but close by. + * Gets the url of the projected image. */ - NEAR = 'NEAR', + getUrl(): string; /** - * The target location is within the area region, close to the edge. + * Renders the ground overlay on the specified map. If map is set to null, the overlay is removed. */ - OUTSKIRTS = 'OUTSKIRTS', + setMap(map: google.maps.Map | null): void; /** - * The target location is within the area region, close to the center. + * Sets the opacity of this ground overlay. */ - WITHIN = 'WITHIN', + setOpacity(opacity: number): void; } - export type ContainmentString = `${google.maps.Containment}`; /** - * A service for converting between an address and a LatLng. - * Access by calling `const {Geocoder} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This object defines the properties that can be set on a GroundOverlay object. */ - export class Geocoder { + export interface GroundOverlayOptions { /** - * Creates a new instance of a Geocoder that sends geocode requests to Google servers. + * If true, the ground overlay can receive mouse events. */ - constructor(); + clickable?: boolean | null; /** - * Geocode a request. + * The map on which to display the overlay. */ - geocode(request: google.maps.GeocoderRequest, callback?: ((arg0: google.maps.GeocoderResult[] | null, arg1: google.maps.GeocoderStatusString) => void) | null): Promise; + map?: google.maps.Map | null; + /** + * The opacity of the overlay, expressed as a number between 0 and 1. Optional. + * @defaultValue 1.0 + */ + opacity?: number | null; } /** - * Describes the type of location returned from a geocode. Specify these by value, or by using the constant's name. For example, 'ROOFTOP' or google.maps.GeocoderLocationType.ROOFTOP. - * - * Access by calling `const {GeocoderLocationType} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A structure representing a Marker icon image. */ - export enum GeocoderLocationType { + export interface Icon { /** - * The returned result is approximate. + * The position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image. */ - APPROXIMATE = 'APPROXIMATE', + anchor?: google.maps.Point | null; /** - * The returned result is the geometric center of a result such a line (e.g. street) or polygon (region). + * The origin of the label relative to the top-left corner of the icon image, if a label is supplied by the marker. By default, the origin is located in the center point of the image. */ - GEOMETRIC_CENTER = 'GEOMETRIC_CENTER', + labelOrigin?: google.maps.Point | null; /** - * The returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address. + * The position of the image within a sprite, if any. By default, the origin is located at the top left corner of the image (0, 0). */ - RANGE_INTERPOLATED = 'RANGE_INTERPOLATED', + origin?: google.maps.Point | null; /** - * The returned result reflects a precise geocode. + * The size of the entire image after scaling, if any. Use this property to stretch/shrink an image or a sprite. */ - ROOFTOP = 'ROOFTOP', + scaledSize?: google.maps.Size | null; + /** + * The display size of the sprite or image. When using sprites, you must specify the sprite size. If the size is not provided, it will be set when the image loads. + */ + size?: google.maps.Size | null; + /** + * The URL of the image or sprite sheet. + */ + url: string; } - export type GeocoderLocationTypeString = `${google.maps.GeocoderLocationType}`; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Extra computations to perform while completing a geocoding request. - * - * Access by calling `const {ExtraGeocodeComputation} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This object is sent in an event when a user clicks on an icon on the map. The place ID of this place is stored in the placeId member. To prevent the default info window from showing up, call the stop() method on this event to prevent it being propagated. Learn more about place IDs in the Places API developer guide. */ - export enum ExtraGeocodeComputation { + export interface IconMouseEvent extends google.maps.MapMouseEvent { /** - * Generate an address descriptor. + * The place ID of the place that was clicked. This place ID can be used to query more information about the feature that was clicked.

Learn more about place IDs in the Places API developer guide. */ - ADDRESS_DESCRIPTORS = 'ADDRESS_DESCRIPTORS', + placeId: string | null; } - export type ExtraGeocodeComputationString = `${google.maps.ExtraGeocodeComputation}`; /** - * The specification for a geocoding request to be sent to the Geocoder. + * Describes how icons are to be rendered on a line.

If your polyline is geodesic, then the distances specified for both offset and repeat are calculated in meters by default. Setting either offset or repeat to a pixel value will cause the distances to be calculated in pixels on the screen. */ - export interface GeocoderRequest { - /** - * Address to geocode. One, and only one, of address, location and placeId must be supplied. - */ - address?: string | null; - /** - * LatLngBounds within which to search. Optional. - */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + export interface IconSequence { /** - * Components are used to restrict results to a specific area. A filter consists of one or more of: route, locality, administrativeArea, postalCode, country. Only the results that match all the filters will be returned. Filter values support the same methods of spelling correction and partial matching as other geocoding requests. Optional. + * If true, each icon in the sequence has the same fixed rotation regardless of the angle of the edge on which it lies. If false, case each icon in the sequence is rotated to align with its edge. + * @defaultValue false */ - componentRestrictions?: google.maps.GeocoderComponentRestrictions | null; + fixedRotation?: boolean; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A list of extra computations which may be used to complete the request. Note: These extra computations may return extra fields on the response. + * The icon to render on the line. */ - extraComputations?: google.maps.ExtraGeocodeComputationString[]; + icon?: google.maps.Symbol | null; /** - * Fulfill the promise on a ZERO_RESULT status in the response. This may be desired because even with zero geocoding results there may still be additional response level fields returned. + * The distance from the start of the line at which an icon is to be rendered. This distance may be expressed as a percentage of line's length (e.g. '50%') or in pixels (e.g. '50px'). + * @defaultValue '100%' */ - fulfillOnZeroResults?: boolean | null; + offset?: string; /** - * A language identifier for the language in which results should be returned, when possible. See the list of supported languages. + * The distance between consecutive icons on the line. This distance may be expressed as a percentage of the line's length (e.g. '50%') or in pixels (e.g. '50px'). To disable repeating of the icon, specify '0'. + * @defaultValue 0 */ - language?: string | null; + repeat?: string; + } + /** + * This class implements the MapType interface and is provided for rendering image tiles. + * Access by calling `const {ImageMapType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class ImageMapType extends google.maps.MVCObject implements google.maps.MapType { /** - * LatLng (or LatLngLiteral) for which to search. The geocoder performs a reverse geocode. See Reverse Geocoding for more information. One, and only one, of address, location and placeId must be supplied. + * Constructs an ImageMapType using the provided ImageMapTypeOptions + * @param opts */ - location?: google.maps.LatLng | google.maps.LatLngLiteral | null; + constructor(opts: google.maps.ImageMapTypeOptions | null); + + alt: string | null; + + maxZoom: number; + + minZoom: number; + + name: string | null; + + projection: google.maps.Projection | null; + + radius: number; + + tileSize: google.maps.Size | null; /** - * The place ID associated with the location. Place IDs uniquely identify a place in the Google Places database and on Google Maps. Learn more about place IDs in the Places API developer guide. The geocoder performs a reverse geocode. See Reverse Geocoding for more information. One, and only one, of address, location and placeId must be supplied. + * Returns the opacity level (0 (transparent) to 1.0) of the ImageMapType tiles. */ - placeId?: string | null; + getOpacity(): number; + + getTile(tileCoord: google.maps.Point | null, zoom: number, ownerDocument: Document | null): Element | null; + + releaseTile(tileDiv: Element | null): void; /** - * Country code used to bias the search, specified as a two-character (non-numeric) Unicode region subtag / CLDR identifier. Optional. See Google Maps Platform Coverage Details for supported regions. + * Sets the opacity level (0 (transparent) to 1.0) of the ImageMapType tiles. */ - region?: string | null; + setOpacity(opacity: number): void; } /** - * The status returned by the Geocoder on the completion of a call to geocode(). Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.GeocoderStatus.OK. - * - * Access by calling `const {GeocoderStatus} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This class is used to create a MapType that renders image tiles. */ - export enum GeocoderStatus { + export interface ImageMapTypeOptions { /** - * There was a problem contacting the Google servers. + * Alt text to display when this MapType's button is hovered over in the MapTypeControl. */ - ERROR = 'ERROR', + alt?: string | null; /** - * This GeocoderRequest was invalid. + * Returns a string (URL) for given tile coordinate (x, y) and zoom level. */ - INVALID_REQUEST = 'INVALID_REQUEST', + getTileUrl?: ((arg0: google.maps.Point, arg1: number) => (string | null)) | null; /** - * The response contains a valid GeocoderResponse. + * The maximum zoom level for the map when displaying this MapType. */ - OK = 'OK', + maxZoom?: number | null; /** - * The webpage has gone over the requests limit in too short a period of time. + * The minimum zoom level for the map when displaying this MapType. Optional. */ - OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', + minZoom?: number | null; /** - * The webpage is not allowed to use the geocoder. + * Name to display in the MapTypeControl. */ - REQUEST_DENIED = 'REQUEST_DENIED', + name?: string | null; /** - * A geocoding request could not be processed due to a server error. The request may succeed if you try again. + * The opacity to apply to the tiles. The opacity should be specified as a float value between 0 and 1.0, where 0 is fully transparent and 1 is fully opaque. */ - UNKNOWN_ERROR = 'UNKNOWN_ERROR', + opacity?: number | null; /** - * No result was found for this GeocoderRequest. + * The tile size. */ - ZERO_RESULTS = 'ZERO_RESULTS', + tileSize?: google.maps.Size | null; } - export type GeocoderStatusString = `${google.maps.GeocoderStatus}`; /** - * A LatLngAltitude is a 3D point in geographical coordinates: latitude, longitude, and altitude.

- * Access by calling `const {LatLngAltitude} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * An overlay that looks like a bubble and is often connected to a marker. + * Access by calling `const {InfoWindow} = await google.maps.importLibrary("maps");` or `const {InfoWindow} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class LatLngAltitude implements google.maps.LatLngAltitudeLiteral, google.maps.LatLngLiteral { - /** - * - * @param value The initializing value. - * @param noClampNoWrap Whether to preserve the initialization values, even if they may not necessarily be valid latitude values in the range of [-90, 90] or valid longitude values in the range of [-180, 180]. The default is false which enables latitude clamping and longitude wrapping. - */ - constructor(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLng | google.maps.LatLngLiteral, noClampNoWrap?: boolean); + export class InfoWindow extends google.maps.MVCObject { /** - * Returns the altitude. + * Creates an info window with the given options. An InfoWindow can be placed on a map at a particular position or above a marker, depending on what is specified in the options. Unless auto-pan is disabled, an InfoWindow will pan the map to make itself visible when it is opened. After constructing an InfoWindow, you must call open to display it on the map. The user can click the close button on the InfoWindow to remove it from the map, or the developer can call close() for the same effect. + * @param opts */ - get altitude(): number; + constructor(opts?: google.maps.InfoWindowOptions | null); /** - * Returns the latitude. + * Checks if the InfoWindow is open. */ - get lat(): number; + get isOpen(): boolean; /** - * Returns the longitude. + * Closes this InfoWindow by removing it from the DOM structure. */ - get lng(): number; + close(): void; /** - * Comparison function for two LatLngAltitudes. Returns true if the coordinates are within 1e-9 of each other and false otherwise. + * Sets focus on this InfoWindow. You may wish to consider using this method along with a visible event to make sure that InfoWindow is visible before setting focus on it. An InfoWindow that is not visible cannot be focused. */ - equals(other: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null): boolean; + focus(): void; + + getContent(): string | Element | Text | null | undefined; + + getHeaderContent(): string | Element | Text | null | undefined; + + getHeaderDisabled(): boolean | undefined; + + getPosition(): google.maps.LatLng | null | undefined; + + getZIndex(): number; /** - * Converts to a plain object. + * Opens this InfoWindow on the given map. Optionally, an InfoWindow can be associated with an anchor. In the core API, the only anchor is the Marker class. However, an anchor can be any MVCObject that exposes a LatLng position property and optionally a Point anchorPoint property for calculating the pixelOffset (see InfoWindowOptions). The anchorPoint is the offset from the anchor's position to the tip of the InfoWindow. It is recommended to use the {@link google.maps.InfoWindowOpenOptions} interface as the single argument for this method. To prevent changing browser focus on open, set {@link google.maps.InfoWindowOpenOptions.shouldFocus} to false. */ - toJSON(key?: string): google.maps.LatLngAltitudeLiteral; + open(options?: google.maps.InfoWindowOpenOptions | google.maps.Map | google.maps.StreetViewPanorama | null, anchor?: google.maps.MVCObject | google.maps.marker.AdvancedMarkerElement | null): void; + + setContent(content?: string | Element | Text | null): void; + + setHeaderContent(headerContent?: string | Element | Text | null): void; + + setHeaderDisabled(headerDisabled?: boolean | null): void; + + setOptions(options?: google.maps.InfoWindowOptions | null): void; + + setPosition(position?: google.maps.LatLng | google.maps.LatLngLiteral | null): void; + + setZIndex(zIndex: number): void; } /** - * Object literals are accepted in place of Orientation3D objects, as a convenience, in many places. These are converted to Orientation3D objects when the Maps API encounters them. + * Options for opening an InfoWindow */ - export interface Orientation3DLiteral { + export interface InfoWindowOpenOptions { /** - * Rotation about the z-axis (normal to the Earth's surface). A value of 0 (the default) equals North. A positive rotation is clockwise around the z-axis and specified in degrees from 0 to 360. + * The anchor to which this InfoWindow will be positioned. If the anchor is non-null, the InfoWindow will be positioned at the top-center of the anchor. The InfoWindow will be rendered on the same map or panorama as the anchor (when available). */ - heading?: number | null; + anchor?: google.maps.MVCObject | google.maps.marker.AdvancedMarkerElement | null; /** - * Rotation about the y-axis. A positive rotation is clockwise around the y-axis and specified in degrees from 0 to 360. + * The map or panorama on which to render this InfoWindow. */ - roll?: number | null; + map?: google.maps.Map | google.maps.StreetViewPanorama | null; /** - * Rotation about the x-axis. A positive rotation is clockwise around the x-axis and specified in degrees from 0 to 360. + * Whether or not focus should be moved inside the InfoWindow when it is opened. When this property is unset or when it is set to null or undefined, a heuristic is used to decide whether or not focus should be moved. It is recommended to explicitly set this property to fit your needs as the heuristic is subject to change and may not work well for all use cases. */ - tilt?: number | null; + shouldFocus?: boolean | null; } /** - * A Orientation3D is a three-dimensional vector used for standard mathematical rotation transformations along heading, tilt, and roll.
- * Access by calling `const {Orientation3D} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * InfoWindowOptions object used to define the properties that can be set on a InfoWindow. */ - export class Orientation3D implements google.maps.Orientation3DLiteral { - /** - * - * @param value The initializing value. - */ - constructor(value: google.maps.Orientation3D | google.maps.Orientation3DLiteral); + export interface InfoWindowOptions { /** - * Rotation about the z-axis (normal to the Earth's surface). A value of 0 (the default) equals North. A positive rotation is clockwise around the z-axis and specified in degrees from 0 to 360. Values above or below this range will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 530 will be converted to 170 as well. - * @defaultValue 0 + * AriaLabel to assign to the InfoWindow. */ - get heading(): number; + ariaLabel?: string | null; /** - * Rotation about the y-axis. A positive rotation is clockwise around the y-axis and specified in degrees from 0 to 360. Values above or below this range will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 530 will be converted to 170 as well. - * @defaultValue 0 + * Content to display in the InfoWindow. This can be an HTML element, a plain-text string, or a string containing HTML. The InfoWindow will be sized according to the content. To set an explicit size for the content, set content to be a HTML element with that size. */ - get roll(): number; + content?: string | Element | Text | null; /** - * Rotation about the x-axis. A positive rotation is clockwise around the x-axis and specified in degrees from 0 to 360. Values above or below this range will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 530 will be converted to 170 as well. - * @defaultValue 0 + * Disable panning the map to make the InfoWindow fully visible when it opens. + * @defaultValue false */ - get tilt(): number; + disableAutoPan?: boolean | null; /** - * Comparison function. + * The content to display in the InfoWindow header row. This can be an HTML element, or a string of plain text. The InfoWindow will be sized according to the content. To set an explicit size for the header content, set headerContent to be a HTML element with that size. */ - equals(other: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null): boolean; + headerContent?: string | Element | Text | null; /** - * Converts to a plain object. + * Disables the whole header row in the InfoWindow. When set to true, the header will be removed so that the header content and the close button will be hidden. */ - toJSON(key?: string): google.maps.Orientation3DLiteral; - } - /** - * Access by calling `const {Point} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Point { + headerDisabled?: boolean | null; /** - * A point on a two-dimensional plane. - * @param x - * @param y + * Maximum width of the InfoWindow, regardless of content's width. This value is only considered if it is set before a call to open(). To change the maximum width when changing content, call close(), setOptions(), and then open(). */ - constructor(x: number, y: number); + maxWidth?: number | null; /** - * The X coordinate + * Minimum width of the InfoWindow, regardless of the content's width. When using this property, it is strongly recommended to set the minWidth to a value less than the width of the map (in pixels). This value is only considered if it is set before a call to open(). To change the minimum width when changing content, call close(), setOptions(), and then open(). */ - x: number; + minWidth?: number | null; /** - * The Y coordinate + * The offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored. If an InfoWindow is opened with an anchor, the pixelOffset will be calculated from the anchor's anchorPoint property. */ - y: number; + pixelOffset?: google.maps.Size | null; /** - * Compares two Points + * The LatLng at which to display this InfoWindow. If the InfoWindow is opened with an anchor, the anchor's position will be used instead. */ - equals(other: google.maps.Point | null): boolean; + position?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * Returns a string representation of this Point. + * All InfoWindows are displayed on the map in order of their zIndex, with higher values displaying in front of InfoWindows with lower values. By default, InfoWindows are displayed according to their latitude, with InfoWindows of lower latitudes appearing in front of InfoWindows at higher latitudes. InfoWindows are always displayed in front of markers. */ - toString(): string; + zIndex?: number | null; + } + + export interface JourneySharingLibrary { + + AutomaticViewportMode: typeof google.maps.journeySharing.AutomaticViewportMode; + + DeliveryVehicleStopState: typeof google.maps.journeySharing.DeliveryVehicleStopState; + + FleetEngineDeliveryFleetLocationProvider: typeof google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider; + + FleetEngineDeliveryVehicleLocationProvider: typeof google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider; + + FleetEngineFleetLocationProvider: typeof google.maps.journeySharing.FleetEngineFleetLocationProvider; + + FleetEngineServiceType: typeof google.maps.journeySharing.FleetEngineServiceType; + + FleetEngineShipmentLocationProvider: typeof google.maps.journeySharing.FleetEngineShipmentLocationProvider; + + FleetEngineTripLocationProvider: typeof google.maps.journeySharing.FleetEngineTripLocationProvider; + + FleetEngineVehicleLocationProvider: typeof google.maps.journeySharing.FleetEngineVehicleLocationProvider; + + JourneySharingMapView: typeof google.maps.journeySharing.JourneySharingMapView; + + Speed: typeof google.maps.journeySharing.Speed; + + TripType: typeof google.maps.journeySharing.TripType; + + VehicleNavigationStatus: typeof google.maps.journeySharing.VehicleNavigationStatus; + + VehicleState: typeof google.maps.journeySharing.VehicleState; + + VehicleType: typeof google.maps.journeySharing.VehicleType; + + WaypointType: typeof google.maps.journeySharing.WaypointType; } /** - * Access by calling `const {Size} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Contains details of the author of a KML document or feature. */ - export class Size { + export interface KmlAuthor { /** - * Two-dimensional size, where width is the distance on the x-axis, and height is the distance on the y-axis. - * @param width - * @param height - * @param widthUnit - * @param heightUnit + * The author's e-mail address, or an empty string if not specified. */ - constructor(width: number, height: number, widthUnit?: string, heightUnit?: string); + email: string; /** - * The height along the y-axis, in pixels. + * The author's name, or an empty string if not specified. */ - height: number; + name: string; /** - * The width along the x-axis, in pixels. + * The author's home page, or an empty string if not specified. */ - width: number; + uri: string; + } + /** + * Data for a single KML feature in JSON format, returned when a KML feature is clicked. The data contained in this object mirrors that associated with the feature in the KML or GeoRSS markup in which it is declared. + */ + export interface KmlFeatureData { /** - * Compares two Sizes. + * The feature's <atom:author>, extracted from the layer markup (if specified). */ - equals(other: google.maps.Size | null): boolean; + author: google.maps.KmlAuthor; /** - * Returns a string representation of this Size. + * The feature's <description>, extracted from the layer markup. */ - toString(): string; - } - /** - * Object literals are accepted in place of Vector3D objects, as a convenience, in many places. These are converted to Vector3D objects when the Maps API encounters them. - */ - export interface Vector3DLiteral { + description: string; /** - * X-component of the three-dimensional vector. + * The feature's <id>, extracted from the layer markup. If no <id> has been specified, a unique ID will be generated for this feature. */ - x: number; + id: string; /** - * Y-component of the three-dimensional vector. + * The feature's balloon styled text, if set. */ - y: number; + infoWindowHtml: string; /** - * Z-component of the three-dimensional vector. + * The feature's <name>, extracted from the layer markup. */ - z: number; + name: string; + /** + * The feature's <Snippet>, extracted from the layer markup. + */ + snippet: string; } /** - * A Vector3D is a three-dimensional vector used for standard mathematical operations such as scaling the bounds of three-dimensional object along local x-, y-, and z-axes.
- * Access by calling `const {Vector3D} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {KmlLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated As of version 3.65, google.maps.KmlLayer is deprecated. For alternative methods of displaying KML data on the map, see https://developers.devsite.corp.google.com/maps/deprecations#kml_layer_deprecated_as_of_april_30_2026 */ - export class Vector3D implements google.maps.Vector3DLiteral { + export class KmlLayer extends google.maps.MVCObject { /** - * - * @param value The initializing value. + * Creates a KmlLayer which renders the contents of the specified KML/KMZ file (https://developers.google.com/kml/documentation/kmlreference) or GeoRSS file (http://www.georss.org). + * @param opts Options for this layer. */ - constructor(value: google.maps.Vector3D | google.maps.Vector3DLiteral); + constructor(opts?: google.maps.KmlLayerOptions | null); /** - * X-component of the three-dimensional vector. + * Get the default viewport for the layer being displayed. */ - get x(): number; + getDefaultViewport(): google.maps.LatLngBounds | null; /** - * Y-component of the three-dimensional vector. + * Get the map on which the KML Layer is being rendered. */ - get y(): number; + getMap(): google.maps.Map | null; /** - * Z-component of the three-dimensional vector. + * Get the metadata associated with this layer, as specified in the layer markup. */ - get z(): number; + getMetadata(): google.maps.KmlLayerMetadata | null; /** - * Comparison function. + * Get the status of the layer, set once the requested document has loaded. */ - equals(other: google.maps.Vector3D | google.maps.Vector3DLiteral | null): boolean; + getStatus(): google.maps.KmlLayerStatusString | null; /** - * Converts to a plain object. + * Gets the URL of the KML file being displayed. */ - toJSON(key?: string): google.maps.Vector3DLiteral; - } - /** - * - * Access by calling `const {CollisionBehavior} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum CollisionBehavior { + getUrl(): string; /** - * Display the marker only if it does not overlap with other markers. If two markers of this type would overlap, the one with the higher zIndex is shown. If they have the same zIndex, the one with the lower vertical screen position is shown. + * Gets the z-index of the KML Layer. */ - OPTIONAL_AND_HIDES_LOWER_PRIORITY = 'OPTIONAL_AND_HIDES_LOWER_PRIORITY', + getZIndex(): number; /** - * Always display the marker regardless of collision. This is the default behavior. + * Renders the KML Layer on the specified map. If map is set to null, the layer is removed. */ - REQUIRED = 'REQUIRED', + setMap(map: google.maps.Map | null): void; + + setOptions(options: google.maps.KmlLayerOptions | null): void; /** - * Always display the marker regardless of collision, and hide any OPTIONAL_AND_HIDES_LOWER_PRIORITY markers or labels that would overlap with the marker. + * Sets the URL of the KML file to display. */ - REQUIRED_AND_HIDES_OPTIONAL = 'REQUIRED_AND_HIDES_OPTIONAL', + setUrl(url: string): void; + /** + * Sets the z-index of the KML Layer. + */ + setZIndex(zIndex: number): void; } - export type CollisionBehaviorString = `${google.maps.CollisionBehavior}`; /** - * Built-in symbol paths. - * - * Access by calling `const {SymbolPath} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Metadata for a single KML layer, in JSON format. */ - export enum SymbolPath { + export interface KmlLayerMetadata { /** - * A backward-pointing closed arrow. + * The layer's <atom:author>, extracted from the layer markup. */ - BACKWARD_CLOSED_ARROW = 3, + author: google.maps.KmlAuthor | null; /** - * A backward-pointing open arrow. + * The layer's <description>, extracted from the layer markup. */ - BACKWARD_OPEN_ARROW = 4, + description: string; /** - * A circle. + * Whether the layer has any screen overlays. */ - CIRCLE = 0, + hasScreenOverlays: boolean; /** - * A forward-pointing closed arrow. + * The layer's <name>, extracted from the layer markup. */ - FORWARD_CLOSED_ARROW = 1, + name: string; /** - * A forward-pointing open arrow. + * The layer's <Snippet>, extracted from the layer markup */ - FORWARD_OPEN_ARROW = 2, + snippet: string; } /** - * Access by calling `const {Marker} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated As of February 21st, 2024, google.maps.Marker is deprecated. Please use {@link google.maps.marker.AdvancedMarkerElement} instead. At this time, google.maps.Marker is not scheduled to be discontinued, but {@link google.maps.marker.AdvancedMarkerElement} is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide. + * This object defines the properties that can be set on a KmlLayer object. */ - export class Marker extends google.maps.MVCObject { + export interface KmlLayerOptions { /** - * Creates a marker with the options specified. If a map is specified, the marker is added to the map upon construction. Note that the position must be set for the marker to display. - * @param opts + * If true, the layer receives mouse events. + * @defaultValue true */ - constructor(opts?: google.maps.MarkerOptions); + clickable?: boolean | null; /** - * Get the currently running animation. + * The map on which to display the layer. */ - getAnimation(): google.maps.Animation | null | undefined; + map?: google.maps.Map | null; /** - * Get the clickable status of the {@link google.maps.Marker}. + * If this option is set to true or if the map's center and zoom were never set, the input map is centered and zoomed to the bounding box of the contents of the layer. + * @defaultValue false */ - getClickable(): boolean; + preserveViewport?: boolean | null; /** - * Get the mouse cursor type shown on hover. + * Whether to render the screen overlays. + * @defaultValue true */ - getCursor(): string | null | undefined; + screenOverlays?: boolean | null; /** - * Get the draggable status of the {@link google.maps.Marker}. + * Suppress the rendering of info windows when layer features are clicked. */ - getDraggable(): boolean; + suppressInfoWindows?: boolean | null; /** - * Get the icon of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.icon}. + * The URL of the KML document to display. */ - getIcon(): string | google.maps.Icon | google.maps.Symbol | null | undefined; + url?: string | null; /** - * Get the label of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.label}. + * The z-index of the layer. */ - getLabel(): google.maps.MarkerLabel | string | null | undefined; + zIndex?: number | null; + } + /** + * The status returned by KmlLayer on the completion of loading a document. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.KmlLayerStatus.OK. + * + * Access by calling `const {KmlLayerStatus} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum KmlLayerStatus { /** - * Get the map or panaroama the {@link google.maps.Marker} is rendered on. + * The document could not be found. Most likely it is an invalid URL, or the document is not publicly available. */ - getMap(): google.maps.Map | google.maps.StreetViewPanorama | null; + DOCUMENT_NOT_FOUND = 'DOCUMENT_NOT_FOUND', /** - * Get the opacity of the {@link google.maps.Marker}. + * The document exceeds the file size limits of KmlLayer. */ - getOpacity(): number | null | undefined; + DOCUMENT_TOO_LARGE = 'DOCUMENT_TOO_LARGE', /** - * Get the position of the {@link google.maps.Marker}. + * The document could not be fetched. */ - getPosition(): google.maps.LatLng | null | undefined; + FETCH_ERROR = 'FETCH_ERROR', /** - * Get the shape of the {@link google.maps.Marker} used for interaction. See {@link google.maps.MarkerOptions.shape} and {@link google.maps.MarkerShape}. + * The document is not a valid KML, KMZ or GeoRSS document. */ - getShape(): google.maps.MarkerShape | null | undefined; + INVALID_DOCUMENT = 'INVALID_DOCUMENT', /** - * Get the title of the {@link google.maps.Marker} tooltip. See {@link google.maps.MarkerOptions.title}. + * The KmlLayer is invalid. */ - getTitle(): string | null | undefined; + INVALID_REQUEST = 'INVALID_REQUEST', /** - * Get the visibility of the {@link google.maps.Marker}. + * The document exceeds the feature limits of KmlLayer. */ - getVisible(): boolean; + LIMITS_EXCEEDED = 'LIMITS_EXCEEDED', /** - * Get the zIndex of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.zIndex}. + * The layer loaded successfully. */ - getZIndex(): number | null | undefined; + OK = 'OK', /** - * Start an animation. Any ongoing animation will be cancelled. Currently supported animations are: {@link google.maps.Animation.BOUNCE}, {@link google.maps.Animation.DROP}. Passing in null will cause any animation to stop. + * The document could not be loaded within a reasonable amount of time. */ - setAnimation(animation?: google.maps.Animation | null): void; + TIMED_OUT = 'TIMED_OUT', /** - * Set if the {@link google.maps.Marker} is clickable. + * The document failed to load for an unknown reason. */ - setClickable(flag: boolean): void; + UNKNOWN = 'UNKNOWN', + } + export type KmlLayerStatusString = `${google.maps.KmlLayerStatus}`; + /** + * The properties of a click event on a KML/KMZ or GeoRSS document. + */ + export interface KmlMouseEvent { /** - * Set the mouse cursor type shown on hover. + * A KmlFeatureData object, containing information about the clicked feature. */ - setCursor(cursor?: string | null): void; + featureData: google.maps.KmlFeatureData; /** - * Set if the {@link google.maps.Marker} is draggable. + * The position at which to anchor an infowindow on the clicked feature. */ - setDraggable(flag: boolean | null): void; + latLng: google.maps.LatLng; /** - * Set the icon for the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.icon}. + * The offset to apply to an infowindow anchored on the clicked feature. */ - setIcon(icon?: string | google.maps.Icon | google.maps.Symbol | null): void; + pixelOffset: google.maps.Size; + } + /** + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A place that represents a point of reference for the address. + */ + export interface Landmark { /** - * Set the label for the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.label}. + * The name for the landmark. */ - setLabel(label?: string | google.maps.MarkerLabel | null): void; + display_name: string; /** - * Renders the {@link google.maps.Marker} on the specified map or panorama. If map is set to null, the marker will be removed. + * The language of the name for the landmark. */ - setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void; + display_name_language_code: string; /** - * Set the opacity of the {@link google.maps.Marker}. + * The Place ID of the underlying establishment serving as the landmark. Can be used to resolve more information about the landmark through Place Details or Place Id Lookup. */ - setOpacity(opacity?: number | null): void; + place_id: string; /** - * Set the options for the {@link google.maps.Marker}. + * Defines the spatial relationship between the target location and the landmark. */ - setOptions(options: google.maps.MarkerOptions | null): void; + spatial_relationship: google.maps.SpatialRelationshipString; /** - * Set the postition for the {@link google.maps.Marker}. + * The straight line distance between the target location and the landmark. */ - setPosition(latlng?: google.maps.LatLng | google.maps.LatLngLiteral | null): void; + straight_line_distance_meters: number; /** - * Set the shape of the {@link google.maps.Marker} used for interaction. See {@link google.maps.MarkerOptions.shape} and {@link google.maps.MarkerShape}. + * The travel distance along the road network between the target location and the landmark. This can be unpopulated if the landmark is disconnected from the part of the road network the target is closest to OR if the target location was not actually considered to be on the road network. */ - setShape(shape?: google.maps.MarkerShape | null): void; + travel_distance_meters?: number; /** - * Set the title of the {@link google.maps.Marker} tooltip. See {@link google.maps.MarkerOptions.title}. + * One or more values indicating the type of the returned result. Please see Types for more detail. */ - setTitle(title?: string | null): void; + types: string[]; + } + /** + * A LatLng is a point in geographical coordinates: latitude and longitude.
Although the default map projection associates longitude with the x-coordinate of the map, and latitude with the y-coordinate, the latitude coordinate is always written first, followed by the longitude.
Notice that you cannot modify the coordinates of a LatLng. If you want to compute another point, you have to create a new one.

Most methods that accept LatLng objects also accept a {@link google.maps.LatLngLiteral} object, so that the following are equivalent:

 map.setCenter(new google.maps.LatLng(-34, 151));
map.setCenter({lat: -34, lng: 151});

The constructor also accepts {@link google.maps.LatLngLiteral} and LatLng objects. If a LatLng instance is passed to the constructor, a copy is created.

The possible calls to the constructor are below:

 new google.maps.LatLng(-34, 151);
new google.maps.LatLng(-34, 151, true);
new google.maps.LatLng({lat: -34, lng: 151});
new google.maps.LatLng({lat: -34, lng: 151}, true);
new google.maps.LatLng(new google.maps.LatLng(-34, 151));
new google.maps.LatLng(new google.maps.LatLng(-34, 151), true);
+ * Access by calling `const {LatLng} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class LatLng { /** - * Set if the {@link google.maps.Marker} is visible. + * Creates a LatLng object representing a geographic point. Latitude is specified in degrees within the range [-90, 90]. Longitude is specified in degrees within the range [-180, 180). Set noClampNoWrap to true to enable values outside of this range. Note the ordering of latitude and longitude. + * @param latOrLatLngOrLatLngLiteral + * @param lngOrNoClampNoWrap + * @param noClampNoWrap */ - setVisible(visible: boolean): void; + constructor(latOrLatLngOrLatLngLiteral: number | google.maps.LatLngLiteral | google.maps.LatLng, lngOrNoClampNoWrap?: number | boolean | null, noClampNoWrap?: boolean); /** - * Set the zIndex of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.zIndex}. + * Comparison function for two LatLngs. Returns true if the coordinates are within 1e-9 of each other and false otherwise. */ - setZIndex(zIndex?: number | null): void; + equals(other: google.maps.LatLng | google.maps.LatLngLiteral | null | undefined): boolean; /** - * The maximum default z-index that the API will assign to a marker. You may set a higher z-index to bring a marker to the front. + * Returns the latitude in degrees. */ - static readonly MAX_ZINDEX: number; + lat(): number; + /** + * Returns the longitude in degrees. + */ + lng(): number; + /** + * Converts to JSON representation. This function is intended to be used via JSON.stringify. + */ + toJSON(): google.maps.LatLngLiteral; + /** + * Converts to string representation. + */ + toString(): string; + /** + * Returns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default. + */ + toUrlValue(precision?: number): string; } /** - * An overlay that looks like a bubble and is often connected to a marker. - * Access by calling `const {InfoWindow} = await google.maps.importLibrary("maps");` or `const {InfoWindow} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A LatLngAltitude is a 3D point in geographical coordinates: latitude, longitude, and altitude.
+ * Access by calling `const {LatLngAltitude} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class InfoWindow extends google.maps.MVCObject { + export class LatLngAltitude implements google.maps.LatLngAltitudeLiteral, google.maps.LatLngLiteral { /** - * Creates an info window with the given options. An InfoWindow can be placed on a map at a particular position or above a marker, depending on what is specified in the options. Unless auto-pan is disabled, an InfoWindow will pan the map to make itself visible when it is opened. After constructing an InfoWindow, you must call open to display it on the map. The user can click the close button on the InfoWindow to remove it from the map, or the developer can call close() for the same effect. - * @param opts + * + * @param value The initializing value. + * @param noClampNoWrap Whether to preserve the initialization values, even if they may not necessarily be valid latitude values in the range of [-90, 90] or valid longitude values in the range of [-180, 180]. The default is false which enables latitude clamping and longitude wrapping. */ - constructor(opts?: google.maps.InfoWindowOptions | null); + constructor(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLng | google.maps.LatLngLiteral, noClampNoWrap?: boolean); /** - * Checks if the InfoWindow is open. + * Returns the altitude. */ - get isOpen(): boolean; + get altitude(): number; /** - * Closes this InfoWindow by removing it from the DOM structure. + * Returns the latitude. */ - close(): void; + get lat(): number; /** - * Sets focus on this InfoWindow. You may wish to consider using this method along with a visible event to make sure that InfoWindow is visible before setting focus on it. An InfoWindow that is not visible cannot be focused. + * Returns the longitude. */ - focus(): void; - - getContent(): string | Element | Text | null | undefined; - - getHeaderContent(): string | Element | Text | null | undefined; - - getHeaderDisabled(): boolean | undefined; - - getPosition(): google.maps.LatLng | null | undefined; - - getZIndex(): number; + get lng(): number; /** - * Opens this InfoWindow on the given map. Optionally, an InfoWindow can be associated with an anchor. In the core API, the only anchor is the Marker class. However, an anchor can be any MVCObject that exposes a LatLng position property and optionally a Point anchorPoint property for calculating the pixelOffset (see InfoWindowOptions). The anchorPoint is the offset from the anchor's position to the tip of the InfoWindow. It is recommended to use the {@link google.maps.InfoWindowOpenOptions} interface as the single argument for this method. To prevent changing browser focus on open, set {@link google.maps.InfoWindowOpenOptions.shouldFocus} to false. + * Comparison function for two LatLngAltitudes. Returns true if the coordinates are within 1e-9 of each other and false otherwise. */ - open(options?: google.maps.InfoWindowOpenOptions | google.maps.Map | google.maps.StreetViewPanorama | null, anchor?: google.maps.MVCObject | google.maps.marker.AdvancedMarkerElement | null): void; - - setContent(content?: string | Element | Text | null): void; - - setHeaderContent(headerContent?: string | Element | Text | null): void; - - setHeaderDisabled(headerDisabled?: boolean | null): void; - - setOptions(options?: google.maps.InfoWindowOptions | null): void; - - setPosition(position?: google.maps.LatLng | google.maps.LatLngLiteral | null): void; - - setZIndex(zIndex: number): void; + equals(other: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null): boolean; + /** + * Converts to a plain object. + */ + toJSON(key?: string): google.maps.LatLngAltitudeLiteral; } /** - * Options for opening an InfoWindow + * Object literals are accepted in place of LatLngAltitude objects, as a convenience, in many places. These are converted to LatLngAltitude objects when the Maps API encounters them. */ - export interface InfoWindowOpenOptions { + export interface LatLngAltitudeLiteral extends google.maps.LatLngLiteral { /** - * The anchor to which this InfoWindow will be positioned. If the anchor is non-null, the InfoWindow will be positioned at the top-center of the anchor. The InfoWindow will be rendered on the same map or panorama as the anchor (when available). + * Distance (in meters) above the ground surface. Negative value means underneath the ground surface. */ - anchor?: google.maps.MVCObject | google.maps.marker.AdvancedMarkerElement | null; + altitude: number; /** - * The map or panorama on which to render this InfoWindow. + * Latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. */ - map?: google.maps.Map | google.maps.StreetViewPanorama | null; + lat: number; /** - * Whether or not focus should be moved inside the InfoWindow when it is opened. When this property is unset or when it is set to null or undefined, a heuristic is used to decide whether or not focus should be moved. It is recommended to explicitly set this property to fit your needs as the heuristic is subject to change and may not work well for all use cases. + * Longitude in degrees. Values outside the range [-180, 180] will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. */ - shouldFocus?: boolean | null; + lng: number; } /** - * A rectangular image overlay on the map. - * Access by calling `const {GroundOverlay} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian. + * Access by calling `const {LatLngBounds} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class GroundOverlay extends google.maps.MVCObject { - /** - * Creates a ground overlay from the provided image URL and its LatLngBounds. The image is scaled to fit the current bounds, and projected using the current map projection. - * @param url - * @param bounds - * @param opts - */ - constructor(url: string, bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null, opts?: google.maps.GroundOverlayOptions | null); - /** - * Gets the LatLngBounds of this overlay. - */ - getBounds(): google.maps.LatLngBounds | null; + export class LatLngBounds { /** - * Returns the map on which this ground overlay is displayed. + * Constructs a rectangle from the points at its south-west and north-east corners. + * @param swOrLatLngBounds + * @param ne */ - getMap(): google.maps.Map | null; + constructor(swOrLatLngBounds?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null, ne?: google.maps.LatLng | google.maps.LatLngLiteral | null); /** - * Returns the opacity of this ground overlay. + * Returns true if the given lat/lng is in this bounds. */ - getOpacity(): number; + contains(latLng: google.maps.LatLng | google.maps.LatLngLiteral): boolean; /** - * Gets the url of the projected image. + * Returns true if this bounds approximately equals the given bounds. */ - getUrl(): string; + equals(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): boolean; /** - * Renders the ground overlay on the specified map. If map is set to null, the overlay is removed. + * Extends this bounds to contain the given point. */ - setMap(map: google.maps.Map | null): void; + extend(point: google.maps.LatLng | google.maps.LatLngLiteral): google.maps.LatLngBounds; /** - * Sets the opacity of this ground overlay. + * Computes the center of this LatLngBounds */ - setOpacity(opacity: number): void; - } - /** - * Access by calling `const {KmlLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated As of version 3.65, google.maps.KmlLayer is deprecated. For alternative methods of displaying KML data on the map, see https://developers.devsite.corp.google.com/maps/deprecations#kml_layer_deprecated_as_of_april_30_2026 - */ - export class KmlLayer extends google.maps.MVCObject { + getCenter(): google.maps.LatLng; /** - * Creates a KmlLayer which renders the contents of the specified KML/KMZ file (https://developers.google.com/kml/documentation/kmlreference) or GeoRSS file (http://www.georss.org). - * @param opts Options for this layer. + * Returns the north-east corner of this bounds. */ - constructor(opts?: google.maps.KmlLayerOptions | null); + getNorthEast(): google.maps.LatLng; /** - * Get the default viewport for the layer being displayed. + * Returns the south-west corner of this bounds. */ - getDefaultViewport(): google.maps.LatLngBounds | null; + getSouthWest(): google.maps.LatLng; /** - * Get the map on which the KML Layer is being rendered. + * Returns true if this bounds shares any points with the other bounds. */ - getMap(): google.maps.Map | null; + intersects(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): boolean; /** - * Get the metadata associated with this layer, as specified in the layer markup. + * Returns if the bounds are empty. */ - getMetadata(): google.maps.KmlLayerMetadata | null; + isEmpty(): boolean; /** - * Get the status of the layer, set once the requested document has loaded. + * Converts to JSON representation. This function is intended to be used via JSON.stringify. */ - getStatus(): google.maps.KmlLayerStatusString | null; + toJSON(): google.maps.LatLngBoundsLiteral; /** - * Gets the URL of the KML file being displayed. + * Converts the given map bounds to a lat/lng span. */ - getUrl(): string; + toSpan(): google.maps.LatLng; /** - * Gets the z-index of the KML Layer. + * Converts to string. */ - getZIndex(): number; + toString(): string; /** - * Renders the KML Layer on the specified map. If map is set to null, the layer is removed. + * Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box. */ - setMap(map: google.maps.Map | null): void; - - setOptions(options: google.maps.KmlLayerOptions | null): void; + toUrlValue(precision?: number): string; /** - * Sets the URL of the KML file to display. + * Extends this bounds to contain the union of this and the given bounds. */ - setUrl(url: string): void; + union(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): google.maps.LatLngBounds; /** - * Sets the z-index of the KML Layer. + * LatLngBounds for the max bounds of the Earth. These bounds will encompass the entire globe. */ - setZIndex(zIndex: number): void; + static readonly MAX_BOUNDS: google.maps.LatLngBounds; } /** - * The status returned by KmlLayer on the completion of loading a document. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.KmlLayerStatus.OK. - * - * Access by calling `const {KmlLayerStatus} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Object literals are accepted in place of LatLngBounds objects throughout the API. These are automatically converted to LatLngBounds objects. All south, west, north and east must be set, otherwise an exception is thrown. */ - export enum KmlLayerStatus { - /** - * The document could not be found. Most likely it is an invalid URL, or the document is not publicly available. - */ - DOCUMENT_NOT_FOUND = 'DOCUMENT_NOT_FOUND', - /** - * The document exceeds the file size limits of KmlLayer. - */ - DOCUMENT_TOO_LARGE = 'DOCUMENT_TOO_LARGE', - /** - * The document could not be fetched. - */ - FETCH_ERROR = 'FETCH_ERROR', - /** - * The document is not a valid KML, KMZ or GeoRSS document. - */ - INVALID_DOCUMENT = 'INVALID_DOCUMENT', - /** - * The KmlLayer is invalid. - */ - INVALID_REQUEST = 'INVALID_REQUEST', + export interface LatLngBoundsLiteral { /** - * The document exceeds the feature limits of KmlLayer. + * East longitude in degrees. Values outside the range [-180, 180] will be wrapped to the range [-180, 180). For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. */ - LIMITS_EXCEEDED = 'LIMITS_EXCEEDED', + east: number; /** - * The layer loaded successfully. + * North latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. */ - OK = 'OK', + north: number; /** - * The document could not be loaded within a reasonable amount of time. + * South latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. */ - TIMED_OUT = 'TIMED_OUT', + south: number; /** - * The document failed to load for an unknown reason. + * West longitude in degrees. Values outside the range [-180, 180] will be wrapped to the range [-180, 180). For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. */ - UNKNOWN = 'UNKNOWN', + west: number; } - export type KmlLayerStatusString = `${google.maps.KmlLayerStatus}`; /** - * A layer showing bike lanes and paths. - * Access by calling `const {BicyclingLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Object literals are accepted in place of LatLng objects, as a convenience, in many places. These are converted to LatLng objects when the Maps API encounters them.

Examples:

 map.setCenter({lat: -34, lng: 151});
new google.maps.Marker({position: {lat: -34, lng: 151}, map: map});

LatLng object literals are not supported in the Geometry library.

*/ - export class BicyclingLayer extends google.maps.MVCObject { - /** - * A layer that displays bike lanes and paths and demotes large roads. - */ - constructor(); + export interface LatLngLiteral { /** - * Returns the map on which this layer is displayed. + * Latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. */ - getMap(): google.maps.Map | null; + lat: number; /** - * Renders the layer on the specified map. If map is set to null, the layer will be removed. + * Longitude in degrees. Values outside the range [-180, 180] will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. */ - setMap(map: google.maps.Map | null): void; + lng: number; } /** - * A traffic layer. - * Access by calling `const {TrafficLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * An elevation request sent by the ElevationService containing the list of discrete coordinates (LatLngs) for which to return elevation data. */ - export class TrafficLayer extends google.maps.MVCObject { - /** - * A layer that displays current road traffic. - * @param opts - */ - constructor(opts?: google.maps.TrafficLayerOptions); - /** - * Returns the map on which this layer is displayed. - */ - getMap(): google.maps.Map | null; + export interface LocationElevationRequest { /** - * Renders the layer on the specified map. If map is set to null, the layer will be removed. + * The discrete locations for which to retrieve elevations. */ - setMap(map: google.maps.Map | null): void; - - setOptions(options: google.maps.TrafficLayerOptions | null): void; + locations?: (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; } /** - * A transit layer. - * Access by calling `const {TransitLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * An elevation response returned by the {@link google.maps.ElevationService} containing the list of {@link google.maps.ElevationResult}s matching the locations of the {@link google.maps.LocationElevationRequest}. */ - export class TransitLayer extends google.maps.MVCObject { - /** - * A layer that displays transit lines. - */ - constructor(); - /** - * Returns the map on which this layer is displayed. - */ - getMap(): google.maps.Map | null; + export interface LocationElevationResponse { /** - * Renders the layer on the specified map. If map is set to null, the layer will be removed. + * The list of {@link google.maps.ElevationResult}s matching the locations of the {@link google.maps.LocationElevationRequest}. */ - setMap(map: google.maps.Map | null): void; + results: google.maps.ElevationResult[]; } /** - * Access by calling `const {MVCArray} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {Map} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class MVCArray< T = any > extends google.maps.MVCObject { + export class Map extends google.maps.MVCObject { /** - * A mutable MVC Array. - * @param array + * Creates a new map inside of the given HTML container, which is typically a DIV element. + * @param mapDiv The map will render to fill this element. + * @param opts Options */ - constructor(array?: T[] | null); + constructor(mapDiv: HTMLElement, opts?: google.maps.MapOptions); /** - * Removes all elements from the array. + * Additional controls to attach to the map. To add a control to the map, add the control's <div> to the MVCArray corresponding to the ControlPosition where it should be rendered. */ - clear(): void; + controls: google.maps.MVCArray[]; /** - * Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index). + * An instance of Data, bound to the map. Add features to this Data object to conveniently display them on this map. */ - forEach(callback: (arg0: T, arg1: number) => void): void; + data: google.maps.Data; /** - * Returns a reference to the underlying Array. Warning: if the Array is mutated, no events will be fired by this object. + * A registry of MapType instances by string ID. */ - getArray(): T[]; + mapTypes: google.maps.MapTypeRegistry; /** - * Returns the element at the specified index. + * Additional map types to overlay. Overlay map types will display on top of the base map they are attached to, in the order in which they appear in the overlayMapTypes array (overlays with higher index values are displayed in front of overlays with lower index values). */ - getAt(i: number): T; + overlayMapTypes: google.maps.MVCArray; /** - * Returns the number of elements in this array. + * Sets the viewport to contain the given bounds.
Note: When the map is set to display: none, the fitBounds function reads the map's size as 0x0, and therefore does not do anything. To change the viewport while the map is hidden, set the map to visibility: hidden, thereby ensuring the map div has an actual size. For vector maps, this method sets the map's tilt and heading to their default zero values. Calling this method may cause a smooth animation as the map pans and zooms to fit the bounds. Whether or not this method animates depends on an internal heuristic. */ - getLength(): number; + fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void; /** - * Inserts an element at the specified index. + * Returns the lat/lng bounds of the current viewport. If more than one copy of the world is visible, the bounds range in longitude from -180 to 180 degrees inclusive. If the map is not yet initialized or center and zoom have not been set then the result is undefined. For vector maps with non-zero tilt or heading, the returned lat/lng bounds represents the smallest bounding box that includes the visible region of the map's viewport. See {@link google.maps.MapCanvasProjection.getVisibleRegion} for getting the exact visible region of the map's viewport. */ - insertAt(i: number, elem: T): void; + getBounds(): google.maps.LatLngBounds | undefined; /** - * Removes the last element of the array and returns that element. + * Returns the position displayed at the center of the map. Note that this {@link google.maps.LatLng} object is not wrapped. See LatLng for more information. If the center or bounds have not been set then the result is undefined. */ - pop(): T; + getCenter(): google.maps.LatLng | undefined; /** - * Adds one element to the end of the array and returns the new length of the array. + * Returns the clickability of the map icons. A map icon represents a point of interest, also known as a POI. If the returned value is true, then the icons are clickable on the map. */ - push(elem: T): number; + getClickableIcons(): boolean | undefined; /** - * Removes an element from the specified index. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Returns the FeatureLayer for the specified datasetId. Dataset IDs must be configured in the Google Cloud Console. If the dataset ID is not associated with the map's map style, or if Data-driven styling is not available (no map ID, no vector tiles, no Data-Driven Styling feature layers or Datasets configured in the Map Style), this logs an error, and the resulting FeatureLayer.isAvailable will be false. */ - removeAt(i: number): T; + getDatasetFeatureLayer(datasetId: string): google.maps.FeatureLayer; + + getDiv(): HTMLElement; /** - * Sets an element at the specified index. + * Returns the FeatureLayer of the specific FeatureType. A FeatureLayer must be enabled in the Google Cloud Console. If a FeatureLayer of the specified FeatureType does not exist on this map, or if Data-driven styling is not available (no map ID, no vector tiles, and no FeatureLayer enabled in the map style), this logs an error, and the resulting FeatureLayer.isAvailable will be false. */ - setAt(i: number, elem: T): void; - } - /** - * A circle on the Earth's surface; also known as a "spherical cap". - * Access by calling `const {Circle} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Circle extends google.maps.MVCObject { + getFeatureLayer(featureType: google.maps.FeatureTypeString): google.maps.FeatureLayer; /** - * Create a circle using the passed {@link google.maps.CircleOptions}, which specify the center, radius, and style. - * @param circleOrCircleOptions + * Returns the compass heading of the map. The heading value is measured in degrees (clockwise) from cardinal direction North. If the map is not yet initialized then the result is undefined. */ - constructor(circleOrCircleOptions?: google.maps.Circle | google.maps.CircleLiteral | google.maps.CircleOptions | null); + getHeading(): number | undefined; /** - * Gets the LatLngBounds of this Circle. + * Returns whether heading interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). */ - getBounds(): google.maps.LatLngBounds | null; + getHeadingInteractionEnabled(): boolean | null; /** - * Returns the center of this circle. + * Returns the list of usage attribution IDs, which help Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. */ - getCenter(): google.maps.LatLng | null; + getInternalUsageAttributionIds(): Iterable | null; /** - * Returns whether this circle can be dragged by the user. + * Informs the caller of the current capabilities available to the map based on the map ID that was provided. */ - getDraggable(): boolean; + getMapCapabilities(): google.maps.MapCapabilities; + + getMapTypeId(): google.maps.MapTypeIdString | string | undefined; /** - * Returns whether this circle can be edited by the user. + * Returns the current Projection. If the map is not yet initialized then the result is undefined. Listen to the projection_changed event and check its value to ensure it is not undefined. */ - getEditable(): boolean; + getProjection(): google.maps.Projection | undefined; /** - * Returns the map on which this circle is displayed. + * Returns the current RenderingType of the map. */ - getMap(): google.maps.Map | null; + getRenderingType(): google.maps.RenderingTypeString; /** - * Returns the radius of this circle (in meters). + * Returns the default StreetViewPanorama bound to the map, which may be a default panorama embedded within the map, or the panorama set using setStreetView(). Changes to the map's streetViewControl will be reflected in the display of such a bound panorama. */ - getRadius(): number; + getStreetView(): google.maps.StreetViewPanorama; /** - * Returns whether this circle is visible on the map. + * Returns the current angle of incidence of the map, in degrees from the viewport plane to the map plane. For raster maps, the result will be 0 for imagery taken directly overhead or 45 for 45° imagery. This method does not return the value set by setTilt. See setTilt for details. */ - getVisible(): boolean; + getTilt(): number | undefined; /** - * Sets the center of this circle. + * Returns whether tilt interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). */ - setCenter(center: google.maps.LatLng | google.maps.LatLngLiteral | null): void; + getTiltInteractionEnabled(): boolean | null; /** - * If set to true, the user can drag this circle over the map. + * Returns the zoom of the map. If the zoom has not been set then the result is undefined. */ - setDraggable(draggable: boolean): void; + getZoom(): number | undefined; /** - * If set to true, the user can edit this circle by dragging the control points shown at the center and around the circumference of the circle. + * Immediately sets the map's camera to the target camera options, without animation. */ - setEditable(editable: boolean): void; + moveCamera(cameraOptions: google.maps.CameraOptions): void; /** - * Renders the circle on the specified map. If map is set to null, the circle will be removed. + * Changes the center of the map by the given distance in pixels. If the distance is less than both the width and height of the map, the transition will be smoothly animated. Note that the map coordinate system increases from west to east (for x values) and north to south (for y values). */ - setMap(map: google.maps.Map | null): void; + panBy(x: number, y: number): void; + /** + * Changes the center of the map to the given LatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated. + */ + panTo(latLng: google.maps.LatLng | google.maps.LatLngLiteral): void; + /** + * Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that the map will be panned to show as much of the bounds as possible inside {currentMapSizeInPx} - {padding}. For both raster and vector maps, the map's zoom, tilt, and heading will not be changed. + */ + panToBounds(latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void; - setOptions(options: google.maps.CircleOptions | null): void; + setCenter(latlng: google.maps.LatLng | google.maps.LatLngLiteral): void; /** - * Sets the radius of this circle (in meters). + * Controls whether the map icons are clickable or not. A map icon represents a point of interest, also known as a POI. To disable the clickability of map icons, pass a value of false to this method. */ - setRadius(radius: number): void; + setClickableIcons(value: boolean): void; /** - * Hides this circle if set to false. + * Sets the compass heading for map measured in degrees from cardinal direction North. For raster maps, this method only applies to aerial imagery. */ - setVisible(visible: boolean): void; - } - /** - * MapElementOptions object used to define the properties that can be set on a MapElement. - */ - export interface MapElementOptions { + setHeading(heading: number): void; /** - * See {@link google.maps.MapElement.center}. + * Sets whether heading interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). */ - center?: google.maps.LatLng | google.maps.LatLngLiteral | null; + setHeadingInteractionEnabled(headingInteractionEnabled: boolean): void; + + setMapTypeId(mapTypeId: google.maps.MapTypeIdString | string): void; + + setOptions(options: google.maps.MapOptions | null): void; /** - * See {@link google.maps.MapElement.headingInteractionDisabled}. + * Sets the current RenderingType of the map. */ - headingInteractionDisabled?: boolean | null; + setRenderingType(renderingType: google.maps.RenderingTypeString): void; /** - * See {@link google.maps.MapElement.internalUsageAttributionIds}. + * Binds a StreetViewPanorama to the map. This panorama overrides the default StreetViewPanorama, allowing the map to bind to an external panorama outside of the map. Setting the panorama to null binds the default embedded panorama back to the map. */ - internalUsageAttributionIds?: Iterable | null; + setStreetView(panorama: google.maps.StreetViewPanorama | null): void; /** - * See {@link google.maps.MapElement.mapId}. + * For vector maps, sets the angle of incidence of the map. The allowed values are restricted depending on the zoom level of the map.

For raster maps, controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. setTilt(0) causes the map to always use a 0° overhead view regardless of the zoom level and viewport. setTilt(45) causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value set by setTilt. Because getTilt and setTilt refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects. */ - mapId?: string | null; + setTilt(tilt: number): void; /** - * See {@link google.maps.MapElement.renderingType}. + * Sets whether tilt interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). */ - renderingType?: google.maps.RenderingTypeString | null; + setTiltInteractionEnabled(tiltInteractionEnabled: boolean): void; /** - * See {@link google.maps.MapElement.tiltInteractionDisabled}. + * Sets the zoom of the map. */ - tiltInteractionDisabled?: boolean | null; + setZoom(zoom: number): void; /** - * See {@link google.maps.MapElement.zoom}. + * Map ID which can be used for code samples which require a map ID. This map ID is not intended for use in production applications and cannot be used for features which require cloud configuration (such as Cloud Styling). */ - zoom?: number | null; + static readonly DEMO_MAP_ID: string; } /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Used for setting the map's camera options. + * This object is made available to the OverlayView from within the draw method. It is not guaranteed to be initialized until draw is called. */ - export interface CameraOptions { - - center?: google.maps.LatLngLiteral | google.maps.LatLng; - - heading?: number; - - tilt?: number; - - zoom?: number; + export interface MapCanvasProjection { + /** + * Computes the geographical coordinates from pixel coordinates in the map's container. + */ + fromContainerPixelToLatLng(pixel: google.maps.Point | null, noClampNoWrap?: boolean): google.maps.LatLng | null; + /** + * Computes the geographical coordinates from pixel coordinates in the div that holds the draggable map. + */ + fromDivPixelToLatLng(pixel: google.maps.Point | null, noClampNoWrap?: boolean): google.maps.LatLng | null; + /** + * Computes the pixel coordinates of the given geographical location in the map's container element. + */ + fromLatLngToContainerPixel(latLng: google.maps.LatLng | google.maps.LatLngLiteral): google.maps.Point | null; + /** + * Computes the pixel coordinates of the given geographical location in the DOM element that holds the draggable map. + */ + fromLatLngToDivPixel(latLng: google.maps.LatLng | google.maps.LatLngLiteral | null): google.maps.Point | null; + /** + * The visible region of the map. Returns null if the map has no size. Returns null if the OverlayView is on a StreetViewPanorama. + */ + getVisibleRegion(): google.maps.VisibleRegion | null; + /** + * The width of the world in pixels in the current zoom level. For projections with a heading angle of either 90 or 270 degrees, this corresponds to the pixel span in the Y-axis. + */ + getWorldWidth(): number; } /** * Object containing a snapshot of what capabilities are currently available for the Map. Note that this does not necessarily mean that relevant modules are loaded or initialized, but rather that the current map has permission to use these APIs. See the properties for a list of possible capabilities. @@ -2607,579 +2765,695 @@ declare namespace google.maps { isWebGLOverlayViewAvailable?: boolean; } /** - * Identifiers for feature types. - * - * Access by calling `const {FeatureType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * MapElement is an HTMLElement subclass for rendering maps. After loading the maps library, a map can be created in HTML. For example:
<gmp-map center="37.4220656,-122.0840897" zoom="10" map-id="DEMO_MAP_ID">
  <button slot="control-block-start-inline-end">Custom Control</button>
</gmp-map>

Internally, it uses {@link google.maps.Map}, which can be accessed with the {@link google.maps.MapElement.innerMap} property. + * Access by calling `const {MapElement} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum FeatureType { + export class MapElement extends HTMLElement implements google.maps.MapElementOptions { /** - * Indicates a first-order civil entity below the country level. + * + * @param options */ - ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1', + constructor(options?: google.maps.MapElementOptions); /** - * Indicates a second-order civil entity below the country level. + * The center latitude/longitude of the map. */ - ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2', + center: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * Indicates the national political entity. + * Whether the map should allow user control of the camera heading (rotation). This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * @defaultValue false */ - COUNTRY = 'COUNTRY', + headingInteractionDisabled: boolean | null; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Indicates a third-party dataset. + * A reference to the {@link google.maps.Map} that the MapElement uses internally. */ - DATASET = 'DATASET', + innerMap: google.maps.Map; /** - * Indicates an incorporated city or town political entity. + * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property or replace the value with an empty string. Only unique values will be sent. Changes to this value after instantiation may be ignored. + * @defaultValue null */ - LOCALITY = 'LOCALITY', + get internalUsageAttributionIds(): string[] | null; /** - * Indicates a postal code as used to address postal mail within the country. Includes zip codes. + * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property or replace the value with an empty string. Only unique values will be sent. Changes to this value after instantiation may be ignored. + * @defaultValue null */ - POSTAL_CODE = 'POSTAL_CODE', + set internalUsageAttributionIds(value: Iterable | null | undefined); /** - * Indicates a school district. + * The map ID of the map. This parameter cannot be set or changed after a map is instantiated. {@link google.maps.Map.DEMO_MAP_ID} can be used to try out features that require a map ID but which do not require cloud enablement. */ - SCHOOL_DISTRICT = 'SCHOOL_DISTRICT', - } - export type FeatureTypeString = `${google.maps.FeatureType}`; - /** - * An interface representing a vector map tile feature. These are inputs to the FeatureStyleFunction. Do not save a reference to a particular Feature object because the reference will not be stable. - */ - export interface Feature { + mapId: string | null; /** - * FeatureType of this Feature. + * Whether the map should be a raster or vector map. This parameter cannot be set or changed after a map is instantiated. If not set, then the cloud configuration for the map ID will determine the rendering type (if available). Please note that vector maps may not be available for all devices and browsers and the map will fall back to a raster map as needed. + * @defaultValue {@link google.maps.RenderingType.VECTOR} */ - featureType: google.maps.FeatureTypeString; - } - /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * An interface representing a feature from a Dataset. The featureType of a DatasetFeature will always be FeatureType.DATASET. - */ - export interface DatasetFeature extends google.maps.Feature { + renderingType: google.maps.RenderingTypeString | null; /** - * Key-value mapping of the feature's attributes. + * Whether the map should allow user control of the camera tilt. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * @defaultValue false */ - datasetAttributes: { [key: string]: string }; + tiltInteractionDisabled: boolean | null; /** - * Dataset id of the dataset that this feature belongs to. + * The zoom level of the map. Valid zoom values are numbers from zero up to the supported maximum zoom level. Larger zoom values correspond to a higher resolution. */ - datasetId: string; + zoom: number | null; + addEventListener(type: K, listener: (this: MapElement, ev: MapElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface MapElementEventMap extends HTMLElementEventMap { + "gmp-zoomchange": google.maps.ZoomChangeEvent; } /** - * An interface representing a map layer containing features of a specific {@link google.maps.FeatureType} whose style can be overridden client-side, or have events attached. + * MapElementOptions object used to define the properties that can be set on a MapElement. */ - export interface FeatureLayer { + export interface MapElementOptions { /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * The Dataset ID for this FeatureLayer. Only present if the featureType is FeatureType.DATASET. + * See {@link google.maps.MapElement.center}. */ - datasetId?: string; + center?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * The FeatureType associated with this FeatureLayer. + * See {@link google.maps.MapElement.headingInteractionDisabled}. */ - featureType: google.maps.FeatureTypeString; + headingInteractionDisabled?: boolean | null; /** - * Whether this FeatureLayer is available, meaning whether Data-driven styling is available for this map (there is a map ID using vector tiles with this FeatureLayer enabled in the Google Cloud Console map style.) If this is false (or becomes false), styling on this FeatureLayer returns to default and events are not triggered. + * See {@link google.maps.MapElement.internalUsageAttributionIds}. */ - isAvailable: boolean; + internalUsageAttributionIds?: Iterable | null; /** - * The style of Features in the FeatureLayer. The style is applied when style is set. If your style function updates, you must set the style property again. A FeatureStyleFunction must return consistent results when it is applied over the map tiles, and should be optimized for performance. Asynchronous functions are not supported. If you use a FeatureStyleOptions, all features of that layer will be styled with the same FeatureStyleOptions. Set the style to null to remove the previously set style. If this FeatureLayer is not available, setting style does nothing and logs an error. + * See {@link google.maps.MapElement.mapId}. */ - style?: google.maps.FeatureStyleOptions | google.maps.FeatureStyleFunction | null; + mapId?: string | null; /** - * Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with {@link google.maps.event.removeListener}. + * See {@link google.maps.MapElement.renderingType}. */ - addListener(eventName: string, handler: Function): google.maps.MapsEventListener; - } - /** - * Options passed to a FeatureStyleFunction. - */ - export interface FeatureStyleFunctionOptions { + renderingType?: google.maps.RenderingTypeString | null; /** - * Feature passed into the FeatureStyleFunction for styling. + * See {@link google.maps.MapElement.tiltInteractionDisabled}. */ - feature: google.maps.Feature; + tiltInteractionDisabled?: boolean | null; + /** + * See {@link google.maps.MapElement.zoom}. + */ + zoom?: number | null; } - - export type FeatureStyleFunction = (arg0: google.maps.FeatureStyleFunctionOptions) => (google.maps.FeatureStyleOptions | null | undefined); /** - * The WebGL Overlay View provides direct access to the same WebGL rendering context Google Maps Platform uses to render the vector basemap. This use of a shared rendering context provides benefits such as depth occlusion with 3D building geometry, and the ability to sync 2D/3D content with basemap rendering.

With WebGL Overlay View you can add content to your maps using WebGL directly, or popular Graphics libraries like Three.js or deck.gl. To use the overlay, you can extend google.maps.WebGLOverlayView and provide an implementation for each of the following lifecycle hooks: {@link google.maps.WebGLOverlayView.onAdd}, {@link google.maps.WebGLOverlayView.onContextRestored}, {@link google.maps.WebGLOverlayView.onDraw}, {@link google.maps.WebGLOverlayView.onContextLost} and {@link google.maps.WebGLOverlayView.onRemove}.

You must call {@link google.maps.WebGLOverlayView.setMap} with a valid {@link google.maps.Map} object to trigger the call to the onAdd() method and setMap(null) in order to trigger the onRemove() method. The setMap() method can be called at the time of construction or at any point afterward when the overlay should be re-shown after removing. The onDraw() method will then be called whenever a map property changes that could change the position of the element, such as zoom, center, or map type. WebGLOverlayView may only be added to a vector map having a {@link google.maps.MapOptions.mapId} (including maps set to the {@link google.maps.RenderingType.VECTOR} {@link google.maps.MapOptions.renderingType} and using {@link google.maps.Map.DEMO_MAP_ID} as the {@link google.maps.MapOptions.mapId}). - * Access by calling `const {WebGLOverlayView} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This object is returned from various mouse events on the map and overlays, and contains all the fields shown below. */ - export class WebGLOverlayView extends google.maps.MVCObject { + export interface MapMouseEvent { /** - * Creates a WebGLOverlayView. + * The corresponding native DOM event. Developers should not rely on target, currentTarget, relatedTarget and path properties being defined and consistent. Developers should not also rely on the DOM structure of the internal implementation of the Maps API. Due to internal event mapping, the domEvent may have different semantics from the {@link google.maps.MapMouseEvent} (e.g. a {@link google.maps.MapMouseEvent} "click" may have a domEvent of type KeyboardEvent). */ - constructor(); - - getMap(): google.maps.Map | null | undefined; + domEvent: MouseEvent | TouchEvent | PointerEvent | KeyboardEvent | Event; /** - * Implement this method to fetch or create intermediate data structures before the overlay is drawn that don’t require immediate access to the WebGL rendering context. This method must be implemented to render. + * The latitude/longitude that was below the cursor when the event occurred. */ - onAdd(): void; + latLng: google.maps.LatLng | null; /** - * This method is called when the rendering context is lost for any reason, and is where you should clean up any pre-existing GL state, since it is no longer needed. + * Prevents this event from propagating further. */ - onContextLost(): void; + stop(): void; + } + /** + * MapOptions object used to define the properties that can be set on a Map. + */ + export interface MapOptions { /** - * This method is called once the rendering context is available. Use it to initialize or bind any WebGL state such as shaders or buffer objects. + * Color used for the background of the Map div. This color will be visible when tiles have not yet loaded as the user pans. This option can only be set when the map is initialized. */ - onContextRestored(options: google.maps.WebGLStateOptions): void; + backgroundColor?: string | null; /** - * Implement this method to draw WebGL content directly on the map. Note that if the overlay needs a new frame drawn then call {@link google.maps.WebGLOverlayView.requestRedraw}. + * The enabled/disabled state of the Camera control. */ - onDraw(options: google.maps.WebGLDrawOptions): void; + cameraControl?: boolean | null; /** - * This method is called when the overlay is removed from the map with WebGLOverlayView.setMap(null), and is where you should remove all intermediate objects. This method must be implemented to render. + * The display options for the Camera control. */ - onRemove(): void; + cameraControlOptions?: google.maps.CameraControlOptions | null; /** - * Implement this method to handle any GL state updates outside of the render animation frame. + * The initial Map center. */ - onStateUpdate(options: google.maps.WebGLStateOptions): void; + center?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * Triggers the map to redraw a frame. + * When false, map icons are not clickable. A map icon represents a point of interest, also known as a POI. + * @defaultValue true */ - requestRedraw(): void; + clickableIcons?: boolean | null; /** - * Triggers the map to update GL state. + * The initial Map color scheme. This option can only be set when the map is initialized. + * @defaultValue {@link google.maps.ColorScheme.LIGHT} */ - requestStateUpdate(): void; + colorScheme?: google.maps.ColorSchemeString | string | null; /** - * Adds the overlay to the map. + * Size in pixels of the controls appearing on the map. This value must be supplied directly when creating the Map, updating this value later may bring the controls into an undefined state. Only governs the controls made by the Maps API itself. Does not scale developer created custom controls. */ - setMap(map?: google.maps.Map | null): void; - } - /** - * GL state options. - */ - export interface WebGLStateOptions { + controlSize?: number | null; /** - * The WebGLRenderingContext on which to render this WebGLOverlayView. + * Enables/disables all default UI buttons. May be overridden individually. Does not disable the keyboard controls, which are separately controlled by the {@link google.maps.MapOptions.keyboardShortcuts} option. Does not disable gesture controls, which are separately controlled by the {@link google.maps.MapOptions.gestureHandling} option. */ - gl: WebGLRenderingContext; - } - /** - * Drawing options. - */ - export interface WebGLDrawOptions { + disableDefaultUI?: boolean | null; /** - * The WebGLRenderingContext on which to render this WebGLOverlayView. + * Enables/disables zoom and center on double click. Enabled by default.

Note: This property is not recommended. To disable zooming on double click, you can use the gestureHandling property, and set it to "none". */ - gl: WebGLRenderingContext; + disableDoubleClickZoom?: boolean | null; /** - * The matrix transformation from camera space to latitude/longitude coordinates. + * The name or url of the cursor to display when mousing over a draggable map. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggableCursor: 'url(http://www.example.com/icon.png), auto;'. */ - transformer: google.maps.CoordinateTransformer; - } - /** - * A point of view object which specifies the camera's orientation at the Street View panorama's position. The point of view is defined as heading and pitch. - */ - export interface StreetViewPov { + draggableCursor?: string | null; /** - * The camera heading in degrees relative to true north. True north is 0°, east is 90°, south is 180°, west is 270°. + * The name or url of the cursor to display when the map is being dragged. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggingCursor: 'url(http://www.example.com/icon.png), auto;'. */ - heading: number; + draggingCursor?: string | null; /** - * The camera pitch in degrees, relative to the street view vehicle. Ranges from 90° (directly upwards) to -90° (directly downwards). + * The enabled/disabled state of the Fullscreen control. */ - pitch: number; - } - /** - * Displays the panorama for a given LatLng or panorama ID. A StreetViewPanorama object provides a Street View "viewer" which can be stand-alone within a separate <div> or bound to a Map. - * Access by calling `const {StreetViewPanorama} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class StreetViewPanorama extends google.maps.MVCObject { + fullscreenControl?: boolean | null; /** - * Creates a panorama with the passed StreetViewPanoramaOptions. - * @param container - * @param opts + * The display options for the Fullscreen control. */ - constructor(container: HTMLElement, opts?: google.maps.StreetViewPanoramaOptions | null); + fullscreenControlOptions?: google.maps.FullscreenControlOptions | null; /** - * Additional controls to attach to the panorama. To add a control to the panorama, add the control's <div> to the MVCArray corresponding to the {@link google.maps.ControlPosition} where it should be rendered. + * This setting controls how the API handles gestures on the map. Allowed values:

  • "cooperative": Scroll events and one-finger touch gestures scroll the page, and do not zoom or pan the map. Two-finger touch gestures pan and zoom the map. Scroll events with a ctrl key or ⌘ key pressed zoom the map.
    In this mode the map cooperates with the page.
  • "greedy": All touch gestures and scroll events pan or zoom the map.
  • "none": The map cannot be panned or zoomed by user gestures.
  • "auto": (default) Gesture handling is either cooperative or greedy, depending on whether the page is scrollable or in an iframe.
*/ - controls: google.maps.MVCArray[]; + gestureHandling?: string | null; /** - * Sets focus on this StreetViewPanorama. You may wish to consider using this method along with a visible_changed event to make sure that StreetViewPanorama is visible before setting focus on it. A StreetViewPanorama that is not visible cannot be focused. + * The heading for aerial imagery in degrees measured clockwise from cardinal direction North. Headings are snapped to the nearest available angle for which imagery is available. */ - focus(): void; + heading?: number | null; /** - * Returns the set of navigation links for the Street View panorama. + * Whether the map should allow user control of the camera heading (rotation). This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * @defaultValue false */ - getLinks(): (google.maps.StreetViewLink | null)[] | null; + headingInteractionEnabled?: boolean | null; /** - * Returns the StreetViewLocation of the current panorama. + * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property or replace the value with an empty string. Only unique values will be sent. Changes to this value after instantiation may be ignored. + * @defaultValue null */ - getLocation(): google.maps.StreetViewLocation; + internalUsageAttributionIds?: Iterable | null; /** - * Returns the state of motion tracker. If true when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements. + * Whether the map should allow fractional zoom levels. Listen to isfractionalzoomenabled_changed to know when the default has been set. + * @defaultValue true for vector maps and false for raster maps */ - getMotionTracking(): boolean; + isFractionalZoomEnabled?: boolean | null; /** - * Returns the current panorama ID for the Street View panorama. This id is stable within the browser's current session only. + * If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are enabled by default. */ - getPano(): string; + keyboardShortcuts?: boolean | null; /** - * Returns the heading and pitch of the photographer when this panorama was taken. For Street View panoramas on the road, this also reveals in which direction the car was travelling. This data is available after the pano_changed event. + * The map ID of the map. This parameter cannot be set or changed after a map is instantiated. {@link google.maps.Map.DEMO_MAP_ID} can be used to try out features that require a map ID but which do not require cloud enablement. */ - getPhotographerPov(): google.maps.StreetViewPov; + mapId?: string | null; /** - * Returns the current LatLng position for the Street View panorama. + * The initial enabled/disabled state of the Map type control. */ - getPosition(): google.maps.LatLng | null; + mapTypeControl?: boolean | null; /** - * Returns the current point of view for the Street View panorama. + * The initial display options for the Map type control. */ - getPov(): google.maps.StreetViewPov; + mapTypeControlOptions?: google.maps.MapTypeControlOptions | null; /** - * Returns the status of the panorama on completion of the setPosition() or setPano() request. + * The initial Map mapTypeId. Defaults to ROADMAP. */ - getStatus(): google.maps.StreetViewStatusString; + mapTypeId?: google.maps.MapTypeIdString | string | null; /** - * Returns true if the panorama is visible. It does not specify whether Street View imagery is available at the specified position. + * The maximum zoom level which will be displayed on the map. If omitted, or set to null, the maximum zoom from the current map type is used instead. Valid zoom values are numbers from zero up to the supported maximum zoom level. */ - getVisible(): boolean; + maxZoom?: number | null; /** - * Returns the zoom level of the panorama. Fully zoomed-out is level 0, where the field of view is 180 degrees. Zooming in increases the zoom level. + * The minimum zoom level which will be displayed on the map. If omitted, or set to null, the minimum zoom from the current map type is used instead. Valid zoom values are numbers from zero up to the supported maximum zoom level. */ - getZoom(): number; + minZoom?: number | null; /** - * Set the custom panorama provider called on pano change to load custom panoramas. + * If true, do not clear the contents of the Map div. */ - registerPanoProvider(provider: (arg0: string) => (google.maps.StreetViewPanoramaData | null), opt_options?: google.maps.PanoProviderOptions): void; + noClear?: boolean | null; /** - * Sets the set of navigation links for the Street View panorama. + * Whether the map should be a raster or vector map. This parameter cannot be set or changed after a map is instantiated. If not set, then the cloud configuration for the map ID will determine the rendering type (if available). Please note that vector maps may not be available for all devices and browsers and the map will fall back to a raster map as needed. + * @defaultValue {@link google.maps.RenderingType.RASTER} */ - setLinks(links: google.maps.StreetViewLink[]): void; + renderingType?: google.maps.RenderingTypeString | null; /** - * Sets the state of motion tracker. If true when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements. + * Defines a boundary that restricts the area of the map accessible to users. When set, a user can only pan and zoom while the camera view stays inside the limits of the boundary. */ - setMotionTracking(motionTracking: boolean): void; + restriction?: google.maps.MapRestriction | null; /** - * Sets a collection of key-value pairs. + * The enabled/disabled state of the Rotate control. */ - setOptions(options: google.maps.StreetViewPanoramaOptions | null): void; + rotateControl?: boolean | null; /** - * Sets the current panorama ID for the Street View panorama. + * The display options for the Rotate control. */ - setPano(pano: string): void; + rotateControlOptions?: google.maps.RotateControlOptions | null; /** - * Sets the current LatLng position for the Street View panorama. + * The initial enabled/disabled state of the Scale control. */ - setPosition(latLng: google.maps.LatLng | google.maps.LatLngLiteral | null): void; + scaleControl?: boolean | null; /** - * Sets the point of view for the Street View panorama. + * The initial display options for the Scale control. */ - setPov(pov: google.maps.StreetViewPov): void; + scaleControlOptions?: google.maps.ScaleControlOptions | null; /** - * Sets to true to make the panorama visible. If set to false, the panorama will be hidden whether it is embedded in the map or in its own <div>. + * If false, disables zooming on the map using a mouse scroll wheel. The scrollwheel is enabled by default.

Note: This property is not recommended. To disable zooming using scrollwheel, you can use the gestureHandling property, and set it to either "cooperative" or "none". */ - setVisible(flag: boolean): void; + scrollwheel?: boolean | null; /** - * Sets the zoom level of the panorama. Fully zoomed-out is level 0, where the field of view is 180 degrees. Zooming in increases the zoom level. + * A StreetViewPanorama to display when the Street View pegman is dropped on the map. If no panorama is specified, a default StreetViewPanorama will be displayed in the map's div when the pegman is dropped. */ - setZoom(zoom: number): void; - } - /** - * The display options for the Camera control. - */ - export interface CameraControlOptions { + streetView?: google.maps.StreetViewPanorama | null; /** - * Position id. Used to specify the position of the control on the map. - * @defaultValue {@link google.maps.ControlPosition.INLINE_START_BLOCK_END} + * The initial enabled/disabled state of the Street View Pegman control. This control is part of the default UI, and should be set to false when displaying a map type on which the Street View road overlay should not appear (e.g. a non-Earth map type). */ - position?: google.maps.ControlPosition | null; - } - /** - * Options for the rendering of the fullscreen control. - */ - export interface FullscreenControlOptions { + streetViewControl?: boolean | null; /** - * Position id. Used to specify the position of the control on the map. - * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_START} + * The initial display options for the Street View Pegman control. */ - position?: google.maps.ControlPosition | null; - } - /** - * Options for the rendering of the rotate control. - */ - export interface RotateControlOptions { + streetViewControlOptions?: google.maps.StreetViewControlOptions | null; /** - * Position id. Used to specify the position of the control on the map. - * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} + * Styles to apply to each of the default map types. Note that for satellite/hybrid and terrain modes, these styles will only apply to labels and geometry. This feature is not available when using a map ID, or when using vector maps (use cloud-based maps styling instead). */ - position?: google.maps.ControlPosition | null; - } - /** - * A restriction that can be applied to the Map. The map's viewport will not exceed these restrictions. - */ - export interface MapRestriction { + styles?: google.maps.MapTypeStyle[] | null; /** - * When set, a user can only pan and zoom inside the given bounds. Bounds can restrict both longitude and latitude, or can restrict latitude only. For latitude-only bounds use west and east longitudes of -180 and 180, respectively, for example, latLngBounds: {north: northLat, south: southLat, west: -180, east: 180}. + * For vector maps, sets the angle of incidence of the map. The allowed values are restricted depending on the zoom level of the map. For raster maps, controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. The value 0 causes the map to always use a 0° overhead view regardless of the zoom level and viewport. The value 45 causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value specified by this option. Because getTilt and this option refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects. */ - latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; + tilt?: number | null; /** - * Bounds can be made more restrictive by setting the strictBounds flag to true. This reduces how far a user can zoom out, ensuring that everything outside of the restricted bounds stays hidden. The default is false, meaning that a user can zoom out until the entire bounded area is in view, possibly including areas outside the bounded area. + * Whether the map should allow user control of the camera tilt. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * @defaultValue false */ - strictBounds?: boolean; + tiltInteractionEnabled?: boolean | null; + /** + * The initial Map zoom level. Valid zoom values are numbers from zero up to the supported maximum zoom level. Larger zoom values correspond to a higher resolution. + */ + zoom?: number | null; + /** + * The enabled/disabled state of the Zoom control. + */ + zoomControl?: boolean | null; + /** + * The display options for the Zoom control. + */ + zoomControlOptions?: google.maps.ZoomControlOptions | null; + /** + * If false, prevents the map from being dragged and zoomed by mouse and touch gestures. Dragging is enabled by default. + * @deprecated Deprecated in 2017. To disable dragging on the map, you can use the gestureHandling property, and set it to "none". + */ + draggable?: boolean | null; + /** + * The enabled/disabled state of the Pan control.

+ * @deprecated The Pan control is deprecated as of September 2015. + */ + panControl?: boolean | null; + /** + * The display options for the Pan control.

+ * @deprecated The Pan control is deprecated as of September 2015. + */ + panControlOptions?: google.maps.PanControlOptions | null; } - /** - * Options for the rendering of the map type control. - */ - export interface MapTypeControlOptions { + + export interface MapPanes { /** - * IDs of map types to show in the control. + * This pane contains the info window. It is above all map overlays. (Pane 4). */ - mapTypeIds?: (google.maps.MapTypeIdString | string)[] | null; + floatPane: Element; /** - * Position id. Used to specify the position of the control on the map. - * @defaultValue {@link google.maps.ControlPosition.BLOCK_START_INLINE_START} + * This pane is the lowest pane and is above the tiles. It does not receive DOM events. (Pane 0). */ - position?: google.maps.ControlPosition | null; + mapPane: Element; /** - * Style id. Used to select what style of map type control to display. + * This pane contains markers. It does not receive DOM events. (Pane 2). */ - style?: google.maps.MapTypeControlStyle | null; + markerLayer: Element; + /** + * This pane contains polylines, polygons, ground overlays and tile layer overlays. It does not receive DOM events. (Pane 1). + */ + overlayLayer: Element; + /** + * This pane contains elements that receive DOM events. (Pane 3). + */ + overlayMouseTarget: Element; } /** - * - * Access by calling `const {RenderingType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A restriction that can be applied to the Map. The map's viewport will not exceed these restrictions. */ - export enum RenderingType { + export interface MapRestriction { /** - * Indicates that the map is a raster map. + * When set, a user can only pan and zoom inside the given bounds. Bounds can restrict both longitude and latitude, or can restrict latitude only. For latitude-only bounds use west and east longitudes of -180 and 180, respectively, for example, latLngBounds: {north: northLat, south: southLat, west: -180, east: 180}. */ - RASTER = 'RASTER', + latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * Indicates that it is unknown yet whether the map is vector or raster, because the map has not finished initializing yet. + * Bounds can be made more restrictive by setting the strictBounds flag to true. This reduces how far a user can zoom out, ensuring that everything outside of the restricted bounds stays hidden. The default is false, meaning that a user can zoom out until the entire bounded area is in view, possibly including areas outside the bounded area. */ - UNINITIALIZED = 'UNINITIALIZED', + strictBounds?: boolean; + } + + export interface Maps3DLibrary { + + AltitudeMode: typeof google.maps.maps3d.AltitudeMode; /** - * Indicates that the map is a vector map. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. */ - VECTOR = 'VECTOR', + AutofitsCameraAnimation: typeof google.maps.maps3d.AutofitsCameraAnimation; + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + */ + CirclePathElement: typeof google.maps.maps3d.CirclePathElement; + + FlattenerElement: typeof google.maps.maps3d.FlattenerElement; + + GestureHandling: typeof google.maps.maps3d.GestureHandling; + + LocationClickEvent: typeof google.maps.maps3d.LocationClickEvent; + + Map3DElement: typeof google.maps.maps3d.Map3DElement; + + MapMode: typeof google.maps.maps3d.MapMode; + + Marker3DElement: typeof google.maps.maps3d.Marker3DElement; + + Marker3DInteractiveElement: typeof google.maps.maps3d.Marker3DInteractiveElement; + + MarkerElement: typeof google.maps.maps3d.MarkerElement; + + MarkerInteractiveElement: typeof google.maps.maps3d.MarkerInteractiveElement; + + Model3DElement: typeof google.maps.maps3d.Model3DElement; + + Model3DInteractiveElement: typeof google.maps.maps3d.Model3DInteractiveElement; + + PlaceClickEvent: typeof google.maps.maps3d.PlaceClickEvent; + + Polygon3DElement: typeof google.maps.maps3d.Polygon3DElement; + + Polygon3DInteractiveElement: typeof google.maps.maps3d.Polygon3DInteractiveElement; + + Polyline3DElement: typeof google.maps.maps3d.Polyline3DElement; + + Polyline3DInteractiveElement: typeof google.maps.maps3d.Polyline3DInteractiveElement; + + PopoverElement: typeof google.maps.maps3d.PopoverElement; + + SteadyChangeEvent: typeof google.maps.maps3d.SteadyChangeEvent; } - export type RenderingTypeString = `${google.maps.RenderingType}`; /** - * Options for the rendering of the scale control. + * Describes a Firebase App Check token result. */ - export interface ScaleControlOptions { + export interface MapsAppCheckTokenResult { /** - * Style id. Used to select what style of scale control to display. + * The Firebase App Check token. */ - style?: google.maps.ScaleControlStyle | null; + token: string; } /** - * Options for the rendering of the Street View pegman control on the map. + * An event listener, created by google.maps.event.addListener() and friends. */ - export interface StreetViewControlOptions { - /** - * Position id. Used to specify the position of the control on the map. The default position is embedded within the navigation (zoom and pan) controls. If this position is empty or the same as that specified in the zoomControlOptions or panControlOptions, the Street View control will be displayed as part of the navigation controls. Otherwise, it will be displayed separately. - */ - position?: google.maps.ControlPosition | null; + export interface MapsEventListener { /** - * Specifies the sources of panoramas to search. This allows a restriction to search for just official Google panoramas for example. Setting multiple sources will be evaluated as the intersection of those sources. Note: the {@link google.maps.StreetViewSource.OUTDOOR} source is not supported at this time. - * @defaultValue [{@link google.maps.StreetViewSource.DEFAULT}] + * Removes the listener.

Calling listener.remove() is equivalent to google.maps.event.removeListener(listener). */ - sources?: Iterable | null; + remove(): void; + } + + export interface MapsLibrary { + + BicyclingLayer: typeof google.maps.BicyclingLayer; + + Circle: typeof google.maps.Circle; + + Data: typeof google.maps.Data; + + FeatureType: typeof google.maps.FeatureType; + + GroundOverlay: typeof google.maps.GroundOverlay; + + ImageMapType: typeof google.maps.ImageMapType; + + InfoWindow: typeof google.maps.InfoWindow; + + KmlLayer: typeof google.maps.KmlLayer; + + KmlLayerStatus: typeof google.maps.KmlLayerStatus; + + Map: typeof google.maps.Map; + + MapElement: typeof google.maps.MapElement; + + MapTypeControlStyle: typeof google.maps.MapTypeControlStyle; + + MapTypeId: typeof google.maps.MapTypeId; + + MapTypeRegistry: typeof google.maps.MapTypeRegistry; + + MaxZoomService: typeof google.maps.MaxZoomService; + + MaxZoomStatus: typeof google.maps.MaxZoomStatus; + + OverlayView: typeof google.maps.OverlayView; + + Polygon: typeof google.maps.Polygon; + + Polyline: typeof google.maps.Polyline; + + Rectangle: typeof google.maps.Rectangle; + + RenderingType: typeof google.maps.RenderingType; + + StrokePosition: typeof google.maps.StrokePosition; + + StyledMapType: typeof google.maps.StyledMapType; + + TrafficLayer: typeof google.maps.TrafficLayer; + + TransitLayer: typeof google.maps.TransitLayer; + + WebGLOverlayView: typeof google.maps.WebGLOverlayView; + + ZoomChangeEvent: typeof google.maps.ZoomChangeEvent; } /** - * MapOptions object used to define the properties that can be set on a Map. + * Base class for managing network errors in Maps. + * Access by calling `const {MapsNetworkError} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface MapOptions { + export class MapsNetworkError extends Error { /** - * Color used for the background of the Map div. This color will be visible when tiles have not yet loaded as the user pans. This option can only be set when the map is initialized. + * Identifies the type of error produced by the API. */ - backgroundColor?: string | null; + code: google.maps.DirectionsStatusString | google.maps.DistanceMatrixStatusString | google.maps.ElevationStatusString | google.maps.GeocoderStatusString | google.maps.MaxZoomStatusString | google.maps.places.PlacesServiceStatusString | google.maps.RPCStatusString | google.maps.StreetViewStatusString; /** - * The enabled/disabled state of the Camera control. + * Represents the network service that responded with the error. */ - cameraControl?: boolean | null; + endpoint: google.maps.MapsNetworkErrorEndpointString; + } + /** + * Identifiers for API endpoints used by {@link google.maps.MapsNetworkError} instances. + * + * Access by calling `const {MapsNetworkErrorEndpoint} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum MapsNetworkErrorEndpoint { /** - * The display options for the Camera control. + * Identifies the Routes API within the Directions API. */ - cameraControlOptions?: google.maps.CameraControlOptions | null; + DIRECTIONS_ROUTE = 'DIRECTIONS_ROUTE', /** - * The initial Map center. + * Identifies the DistanceMatrix API. */ - center?: google.maps.LatLng | google.maps.LatLngLiteral | null; + DISTANCE_MATRIX = 'DISTANCE_MATRIX', /** - * When false, map icons are not clickable. A map icon represents a point of interest, also known as a POI. - * @defaultValue true + * Identifies the getElevationsAlongPath API within the Elevation API. */ - clickableIcons?: boolean | null; + ELEVATION_ALONG_PATH = 'ELEVATION_ALONG_PATH', /** - * The initial Map color scheme. This option can only be set when the map is initialized. - * @defaultValue {@link google.maps.ColorScheme.LIGHT} + * Identifies the getElevationForLocations API within the Elevation API. */ - colorScheme?: google.maps.ColorSchemeString | string | null; + ELEVATION_LOCATIONS = 'ELEVATION_LOCATIONS', /** - * Size in pixels of the controls appearing on the map. This value must be supplied directly when creating the Map, updating this value later may bring the controls into an undefined state. Only governs the controls made by the Maps API itself. Does not scale developer created custom controls. + * Identifies the Get DeliveryVehicle API within Fleet Engine. */ - controlSize?: number | null; + FLEET_ENGINE_GET_DELIVERY_VEHICLE = 'FLEET_ENGINE_GET_DELIVERY_VEHICLE', /** - * Enables/disables all default UI buttons. May be overridden individually. Does not disable the keyboard controls, which are separately controlled by the {@link google.maps.MapOptions.keyboardShortcuts} option. Does not disable gesture controls, which are separately controlled by the {@link google.maps.MapOptions.gestureHandling} option. + * Identifies the Get Trip API within Fleet Engine. */ - disableDefaultUI?: boolean | null; + FLEET_ENGINE_GET_TRIP = 'FLEET_ENGINE_GET_TRIP', /** - * Enables/disables zoom and center on double click. Enabled by default.

Note: This property is not recommended. To disable zooming on double click, you can use the gestureHandling property, and set it to "none". + * Identifies the Get Vehicle API within Fleet Engine. */ - disableDoubleClickZoom?: boolean | null; + FLEET_ENGINE_GET_VEHICLE = 'FLEET_ENGINE_GET_VEHICLE', /** - * The name or url of the cursor to display when mousing over a draggable map. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggableCursor: 'url(http://www.example.com/icon.png), auto;'. + * Identifies the List DeliveryVehicles API within Fleet Engine. */ - draggableCursor?: string | null; + FLEET_ENGINE_LIST_DELIVERY_VEHICLES = 'FLEET_ENGINE_LIST_DELIVERY_VEHICLES', /** - * The name or url of the cursor to display when the map is being dragged. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggingCursor: 'url(http://www.example.com/icon.png), auto;'. + * Identifies the List Tasks API within Fleet Engine. */ - draggingCursor?: string | null; - /** - * The enabled/disabled state of the Fullscreen control. - */ - fullscreenControl?: boolean | null; + FLEET_ENGINE_LIST_TASKS = 'FLEET_ENGINE_LIST_TASKS', /** - * The display options for the Fullscreen control. + * Identifies the List Vehicles API within Fleet Engine. */ - fullscreenControlOptions?: google.maps.FullscreenControlOptions | null; + FLEET_ENGINE_LIST_VEHICLES = 'FLEET_ENGINE_LIST_VEHICLES', /** - * This setting controls how the API handles gestures on the map. Allowed values:

  • "cooperative": Scroll events and one-finger touch gestures scroll the page, and do not zoom or pan the map. Two-finger touch gestures pan and zoom the map. Scroll events with a ctrl key or ⌘ key pressed zoom the map.
    In this mode the map cooperates with the page.
  • "greedy": All touch gestures and scroll events pan or zoom the map.
  • "none": The map cannot be panned or zoomed by user gestures.
  • "auto": (default) Gesture handling is either cooperative or greedy, depending on whether the page is scrollable or in an iframe.
+ * Identifies the Search Tasks API within Fleet Engine. */ - gestureHandling?: string | null; + FLEET_ENGINE_SEARCH_TASKS = 'FLEET_ENGINE_SEARCH_TASKS', /** - * The heading for aerial imagery in degrees measured clockwise from cardinal direction North. Headings are snapped to the nearest available angle for which imagery is available. + * Identifies the geocode API within the Geocoder. */ - heading?: number | null; + GEOCODER_GEOCODE = 'GEOCODER_GEOCODE', /** - * Whether the map should allow user control of the camera heading (rotation). This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). - * @defaultValue false + * Identifies the MaximumZoomImageryService API within the Maps API. */ - headingInteractionEnabled?: boolean | null; + MAPS_MAX_ZOOM = 'MAPS_MAX_ZOOM', /** - * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property or replace the value with an empty string. Only unique values will be sent. Changes to this value after instantiation may be ignored. - * @defaultValue null + * Identifies the Autocomplete API within the Places API. */ - internalUsageAttributionIds?: Iterable | null; + PLACES_AUTOCOMPLETE = 'PLACES_AUTOCOMPLETE', /** - * Whether the map should allow fractional zoom levels. Listen to isfractionalzoomenabled_changed to know when the default has been set. - * @defaultValue true for vector maps and false for raster maps + * Identifies the Details API within the Places API. */ - isFractionalZoomEnabled?: boolean | null; + PLACES_DETAILS = 'PLACES_DETAILS', /** - * If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are enabled by default. + * Identifies the findPlaceFromPhoneNumber API within the Places API. */ - keyboardShortcuts?: boolean | null; + PLACES_FIND_PLACE_FROM_PHONE_NUMBER = 'PLACES_FIND_PLACE_FROM_PHONE_NUMBER', /** - * The map ID of the map. This parameter cannot be set or changed after a map is instantiated. {@link google.maps.Map.DEMO_MAP_ID} can be used to try out features that require a map ID but which do not require cloud enablement. + * Identifies the findPlaceFromQuery API within the Places API. */ - mapId?: string | null; + PLACES_FIND_PLACE_FROM_QUERY = 'PLACES_FIND_PLACE_FROM_QUERY', /** - * The initial enabled/disabled state of the Map type control. + * Identifies the Gateway API within the Places API. */ - mapTypeControl?: boolean | null; + PLACES_GATEWAY = 'PLACES_GATEWAY', /** - * The initial display options for the Map type control. + * Identifies the Get Place API within the Places API. */ - mapTypeControlOptions?: google.maps.MapTypeControlOptions | null; + PLACES_GET_PLACE = 'PLACES_GET_PLACE', /** - * The initial Map mapTypeId. Defaults to ROADMAP. + * Identifies the LocalContextSearch API within the Places API. */ - mapTypeId?: google.maps.MapTypeIdString | string | null; + PLACES_LOCAL_CONTEXT_SEARCH = 'PLACES_LOCAL_CONTEXT_SEARCH', /** - * The maximum zoom level which will be displayed on the map. If omitted, or set to null, the maximum zoom from the current map type is used instead. Valid zoom values are numbers from zero up to the supported maximum zoom level. + * Identifies the NearbySearch API within the Places API. */ - maxZoom?: number | null; + PLACES_NEARBY_SEARCH = 'PLACES_NEARBY_SEARCH', /** - * The minimum zoom level which will be displayed on the map. If omitted, or set to null, the minimum zoom from the current map type is used instead. Valid zoom values are numbers from zero up to the supported maximum zoom level. + * Identifies the Search Text API within the Places API. */ - minZoom?: number | null; + PLACES_SEARCH_TEXT = 'PLACES_SEARCH_TEXT', /** - * If true, do not clear the contents of the Map div. + * Identifies the getPanorama method within the Streetview service. */ - noClear?: boolean | null; + STREETVIEW_GET_PANORAMA = 'STREETVIEW_GET_PANORAMA', + } + export type MapsNetworkErrorEndpointString = `${google.maps.MapsNetworkErrorEndpoint}`; + /** + * Represents a request error from a web service (i.e. the equivalent of a 4xx code in HTTP). + * Access by calling `const {MapsRequestError} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class MapsRequestError extends google.maps.MapsNetworkError { + } + /** + * Represents a server-side error from a web service (i.e. the equivalent of a 5xx code in HTTP). + * Access by calling `const {MapsServerError} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class MapsServerError extends google.maps.MapsNetworkError { + } + /** + * This interface defines the map type, and is typically used for custom map types. Immutable. + */ + export interface MapType { /** - * Whether the map should be a raster or vector map. This parameter cannot be set or changed after a map is instantiated. If not set, then the cloud configuration for the map ID will determine the rendering type (if available). Please note that vector maps may not be available for all devices and browsers and the map will fall back to a raster map as needed. - * @defaultValue {@link google.maps.RenderingType.RASTER} + * Alt text to display when this MapType's button is hovered over in the MapTypeControl. Optional. */ - renderingType?: google.maps.RenderingTypeString | null; + alt: string | null; /** - * Defines a boundary that restricts the area of the map accessible to users. When set, a user can only pan and zoom while the camera view stays inside the limits of the boundary. + * The maximum zoom level for the map when displaying this MapType. Required for base MapTypes, ignored for overlay MapTypes. */ - restriction?: google.maps.MapRestriction | null; + maxZoom: number; /** - * The enabled/disabled state of the Rotate control. + * The minimum zoom level for the map when displaying this MapType. Optional; defaults to 0. */ - rotateControl?: boolean | null; + minZoom: number; /** - * The display options for the Rotate control. + * Name to display in the MapTypeControl. Optional. */ - rotateControlOptions?: google.maps.RotateControlOptions | null; + name: string | null; /** - * The initial enabled/disabled state of the Scale control. + * The Projection used to render this MapType. Optional; defaults to Mercator. */ - scaleControl?: boolean | null; + projection: google.maps.Projection | null; /** - * The initial display options for the Scale control. + * Radius of the planet for the map, in meters. Optional; defaults to Earth's equatorial radius of 6378137 meters. */ - scaleControlOptions?: google.maps.ScaleControlOptions | null; + radius: number; /** - * If false, disables zooming on the map using a mouse scroll wheel. The scrollwheel is enabled by default.

Note: This property is not recommended. To disable zooming using scrollwheel, you can use the gestureHandling property, and set it to either "cooperative" or "none". + * The dimensions of each tile. Required. */ - scrollwheel?: boolean | null; + tileSize: google.maps.Size | null; /** - * A StreetViewPanorama to display when the Street View pegman is dropped on the map. If no panorama is specified, a default StreetViewPanorama will be displayed in the map's div when the pegman is dropped. + * Returns a tile for the given tile coordinate (x, y) and zoom level. This tile will be appended to the given ownerDocument. Not available for base map types. */ - streetView?: google.maps.StreetViewPanorama | null; + getTile(tileCoord: google.maps.Point, zoom: number, ownerDocument: Document): Element | null; /** - * The initial enabled/disabled state of the Street View Pegman control. This control is part of the default UI, and should be set to false when displaying a map type on which the Street View road overlay should not appear (e.g. a non-Earth map type). + * Releases the given tile, performing any necessary cleanup. The provided tile will have already been removed from the document. Optional. */ - streetViewControl?: boolean | null; + releaseTile(tile: Element | null): void; + } + /** + * Options for the rendering of the map type control. + */ + export interface MapTypeControlOptions { /** - * The initial display options for the Street View Pegman control. + * IDs of map types to show in the control. */ - streetViewControlOptions?: google.maps.StreetViewControlOptions | null; + mapTypeIds?: (google.maps.MapTypeIdString | string)[] | null; /** - * Styles to apply to each of the default map types. Note that for satellite/hybrid and terrain modes, these styles will only apply to labels and geometry. This feature is not available when using a map ID, or when using vector maps (use cloud-based maps styling instead). + * Position id. Used to specify the position of the control on the map. + * @defaultValue {@link google.maps.ControlPosition.BLOCK_START_INLINE_START} */ - styles?: google.maps.MapTypeStyle[] | null; + position?: google.maps.ControlPosition | null; /** - * For vector maps, sets the angle of incidence of the map. The allowed values are restricted depending on the zoom level of the map. For raster maps, controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. The value 0 causes the map to always use a 0° overhead view regardless of the zoom level and viewport. The value 45 causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value specified by this option. Because getTilt and this option refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects. + * Style id. Used to select what style of map type control to display. */ - tilt?: number | null; + style?: google.maps.MapTypeControlStyle | null; + } + /** + * Identifiers for common MapTypesControls. + * + * Access by calling `const {MapTypeControlStyle} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum MapTypeControlStyle { /** - * Whether the map should allow user control of the camera tilt. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). - * @defaultValue false + * Uses the default map type control. When the DEFAULT control is shown, it will vary according to window size and other factors. The DEFAULT control may change in future versions of the API. */ - tiltInteractionEnabled?: boolean | null; + DEFAULT = 0, /** - * The initial Map zoom level. Valid zoom values are numbers from zero up to the supported maximum zoom level. Larger zoom values correspond to a higher resolution. + * A dropdown menu for the screen realestate conscious. */ - zoom?: number | null; + DROPDOWN_MENU = 0, /** - * The enabled/disabled state of the Zoom control. + * The standard horizontal radio buttons bar. */ - zoomControl?: boolean | null; + HORIZONTAL_BAR = 0, + } + /** + * Identifiers for common MapTypes. Specify these by value, or by using the constant's name. For example, 'satellite' or google.maps.MapTypeId.SATELLITE. + * + * Access by calling `const {MapTypeId} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum MapTypeId { /** - * The display options for the Zoom control. + * This map type displays a transparent layer of major streets on satellite images. */ - zoomControlOptions?: google.maps.ZoomControlOptions | null; + HYBRID = 'hybrid', /** - * If false, prevents the map from being dragged and zoomed by mouse and touch gestures. Dragging is enabled by default. - * @deprecated Deprecated in 2017. To disable dragging on the map, you can use the gestureHandling property, and set it to "none". + * This map type displays a normal street map. */ - draggable?: boolean | null; + ROADMAP = 'roadmap', /** - * The enabled/disabled state of the Pan control.

- * @deprecated The Pan control is deprecated as of September 2015. + * This map type displays satellite images. */ - panControl?: boolean | null; + SATELLITE = 'satellite', /** - * The display options for the Pan control.

- * @deprecated The Pan control is deprecated as of September 2015. + * This map type displays maps with physical features such as terrain and vegetation. */ - panControlOptions?: google.maps.PanControlOptions | null; + TERRAIN = 'terrain', } + export type MapTypeIdString = `${google.maps.MapTypeId}`; /** * A registry for MapType instances, keyed by MapType id. * Access by calling `const {MapTypeRegistry} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. @@ -3195,278 +3469,311 @@ declare namespace google.maps { set(id: string, mapType: google.maps.MapType | unknown): void; } /** - * This object is sent in an event when a user clicks on an icon on the map. The place ID of this place is stored in the placeId member. To prevent the default info window from showing up, call the stop() method on this event to prevent it being propagated. Learn more about place IDs in the Places API developer guide. + * The MapTypeStyle is a collection of selectors and stylers that define how the map should be styled. Selectors specify the map features and/or elements that should be affected, and stylers specify how those features and elements should be modified. For details, see the style reference. */ - export interface IconMouseEvent extends google.maps.MapMouseEvent { + export interface MapTypeStyle { /** - * The place ID of the place that was clicked. This place ID can be used to query more information about the feature that was clicked.

Learn more about place IDs in the Places API developer guide. + * The element to which a styler should be applied. An element is a visual aspect of a feature on the map. Example: a label, an icon, the stroke or fill applied to the geometry, and more. Optional. If elementType is not specified, the value is assumed to be 'all'. For details of usage and allowed values, see the style reference. */ - placeId: string | null; + elementType?: string | null; + /** + * The feature, or group of features, to which a styler should be applied. Optional. If featureType is not specified, the value is assumed to be 'all'. For details of usage and allowed values, see the style reference. + */ + featureType?: string | null; + /** + * The style rules to apply to the selected map features and elements. The rules are applied in the order that you specify in this array. For guidelines on usage and allowed values, see the style reference. + */ + stylers: object[]; } /** - * These options specify the way the style of a Feature should be modified on a map. + * Access by calling `const {Marker} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated As of February 21st, 2024, google.maps.Marker is deprecated. Please use {@link google.maps.marker.AdvancedMarkerElement} instead. At this time, google.maps.Marker is not scheduled to be discontinued, but {@link google.maps.marker.AdvancedMarkerElement} is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide. */ - export interface FeatureStyleOptions { + export class Marker extends google.maps.MVCObject { /** - * Hex RGB string (like "#00FF00" for green). Only applies to polygon geometries. + * Creates a marker with the options specified. If a map is specified, the marker is added to the map upon construction. Note that the position must be set for the marker to display. + * @param opts */ - fillColor?: string; + constructor(opts?: google.maps.MarkerOptions); /** - * The fill opacity between 0.0 and 1.0. Only applies to polygon geometries. + * Get the currently running animation. */ - fillOpacity?: number; + getAnimation(): google.maps.Animation | null | undefined; /** - * Hex RGB string (like "#00FF00" for green). + * Get the clickable status of the {@link google.maps.Marker}. */ - strokeColor?: string; + getClickable(): boolean; /** - * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon geometries. + * Get the mouse cursor type shown on hover. */ - strokeOpacity?: number; + getCursor(): string | null | undefined; /** - * The stroke width in pixels. Only applies to line and polygon geometries. + * Get the draggable status of the {@link google.maps.Marker}. */ - strokeWeight?: number; - } - /** - * Access by calling `const {Map} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Map extends google.maps.MVCObject { + getDraggable(): boolean; /** - * Creates a new map inside of the given HTML container, which is typically a DIV element. - * @param mapDiv The map will render to fill this element. - * @param opts Options + * Get the icon of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.icon}. */ - constructor(mapDiv: HTMLElement, opts?: google.maps.MapOptions); + getIcon(): string | google.maps.Icon | google.maps.Symbol | null | undefined; /** - * Additional controls to attach to the map. To add a control to the map, add the control's <div> to the MVCArray corresponding to the ControlPosition where it should be rendered. + * Get the label of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.label}. */ - controls: google.maps.MVCArray[]; + getLabel(): google.maps.MarkerLabel | string | null | undefined; /** - * An instance of Data, bound to the map. Add features to this Data object to conveniently display them on this map. + * Get the map or panaroama the {@link google.maps.Marker} is rendered on. */ - data: google.maps.Data; + getMap(): google.maps.Map | google.maps.StreetViewPanorama | null; /** - * A registry of MapType instances by string ID. + * Get the opacity of the {@link google.maps.Marker}. */ - mapTypes: google.maps.MapTypeRegistry; + getOpacity(): number | null | undefined; /** - * Additional map types to overlay. Overlay map types will display on top of the base map they are attached to, in the order in which they appear in the overlayMapTypes array (overlays with higher index values are displayed in front of overlays with lower index values). + * Get the position of the {@link google.maps.Marker}. */ - overlayMapTypes: google.maps.MVCArray; + getPosition(): google.maps.LatLng | null | undefined; /** - * Sets the viewport to contain the given bounds.
Note: When the map is set to display: none, the fitBounds function reads the map's size as 0x0, and therefore does not do anything. To change the viewport while the map is hidden, set the map to visibility: hidden, thereby ensuring the map div has an actual size. For vector maps, this method sets the map's tilt and heading to their default zero values. Calling this method may cause a smooth animation as the map pans and zooms to fit the bounds. Whether or not this method animates depends on an internal heuristic. + * Get the shape of the {@link google.maps.Marker} used for interaction. See {@link google.maps.MarkerOptions.shape} and {@link google.maps.MarkerShape}. */ - fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void; + getShape(): google.maps.MarkerShape | null | undefined; /** - * Returns the lat/lng bounds of the current viewport. If more than one copy of the world is visible, the bounds range in longitude from -180 to 180 degrees inclusive. If the map is not yet initialized or center and zoom have not been set then the result is undefined. For vector maps with non-zero tilt or heading, the returned lat/lng bounds represents the smallest bounding box that includes the visible region of the map's viewport. See {@link google.maps.MapCanvasProjection.getVisibleRegion} for getting the exact visible region of the map's viewport. + * Get the title of the {@link google.maps.Marker} tooltip. See {@link google.maps.MarkerOptions.title}. */ - getBounds(): google.maps.LatLngBounds | undefined; + getTitle(): string | null | undefined; /** - * Returns the position displayed at the center of the map. Note that this {@link google.maps.LatLng} object is not wrapped. See LatLng for more information. If the center or bounds have not been set then the result is undefined. + * Get the visibility of the {@link google.maps.Marker}. */ - getCenter(): google.maps.LatLng | undefined; + getVisible(): boolean; /** - * Returns the clickability of the map icons. A map icon represents a point of interest, also known as a POI. If the returned value is true, then the icons are clickable on the map. + * Get the zIndex of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.zIndex}. */ - getClickableIcons(): boolean | undefined; + getZIndex(): number | null | undefined; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Returns the FeatureLayer for the specified datasetId. Dataset IDs must be configured in the Google Cloud Console. If the dataset ID is not associated with the map's map style, or if Data-driven styling is not available (no map ID, no vector tiles, no Data-Driven Styling feature layers or Datasets configured in the Map Style), this logs an error, and the resulting FeatureLayer.isAvailable will be false. + * Start an animation. Any ongoing animation will be cancelled. Currently supported animations are: {@link google.maps.Animation.BOUNCE}, {@link google.maps.Animation.DROP}. Passing in null will cause any animation to stop. */ - getDatasetFeatureLayer(datasetId: string): google.maps.FeatureLayer; - - getDiv(): HTMLElement; + setAnimation(animation?: google.maps.Animation | null): void; /** - * Returns the FeatureLayer of the specific FeatureType. A FeatureLayer must be enabled in the Google Cloud Console. If a FeatureLayer of the specified FeatureType does not exist on this map, or if Data-driven styling is not available (no map ID, no vector tiles, and no FeatureLayer enabled in the map style), this logs an error, and the resulting FeatureLayer.isAvailable will be false. + * Set if the {@link google.maps.Marker} is clickable. */ - getFeatureLayer(featureType: google.maps.FeatureTypeString): google.maps.FeatureLayer; + setClickable(flag: boolean): void; /** - * Returns the compass heading of the map. The heading value is measured in degrees (clockwise) from cardinal direction North. If the map is not yet initialized then the result is undefined. + * Set the mouse cursor type shown on hover. */ - getHeading(): number | undefined; + setCursor(cursor?: string | null): void; /** - * Returns whether heading interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * Set if the {@link google.maps.Marker} is draggable. */ - getHeadingInteractionEnabled(): boolean | null; + setDraggable(flag: boolean | null): void; /** - * Returns the list of usage attribution IDs, which help Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. + * Set the icon for the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.icon}. */ - getInternalUsageAttributionIds(): Iterable | null; + setIcon(icon?: string | google.maps.Icon | google.maps.Symbol | null): void; /** - * Informs the caller of the current capabilities available to the map based on the map ID that was provided. + * Set the label for the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.label}. */ - getMapCapabilities(): google.maps.MapCapabilities; - - getMapTypeId(): google.maps.MapTypeIdString | string | undefined; + setLabel(label?: string | google.maps.MarkerLabel | null): void; /** - * Returns the current Projection. If the map is not yet initialized then the result is undefined. Listen to the projection_changed event and check its value to ensure it is not undefined. + * Renders the {@link google.maps.Marker} on the specified map or panorama. If map is set to null, the marker will be removed. */ - getProjection(): google.maps.Projection | undefined; + setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void; /** - * Returns the current RenderingType of the map. + * Set the opacity of the {@link google.maps.Marker}. */ - getRenderingType(): google.maps.RenderingTypeString; + setOpacity(opacity?: number | null): void; /** - * Returns the default StreetViewPanorama bound to the map, which may be a default panorama embedded within the map, or the panorama set using setStreetView(). Changes to the map's streetViewControl will be reflected in the display of such a bound panorama. + * Set the options for the {@link google.maps.Marker}. */ - getStreetView(): google.maps.StreetViewPanorama; + setOptions(options: google.maps.MarkerOptions | null): void; /** - * Returns the current angle of incidence of the map, in degrees from the viewport plane to the map plane. For raster maps, the result will be 0 for imagery taken directly overhead or 45 for 45° imagery. This method does not return the value set by setTilt. See setTilt for details. + * Set the postition for the {@link google.maps.Marker}. */ - getTilt(): number | undefined; + setPosition(latlng?: google.maps.LatLng | google.maps.LatLngLiteral | null): void; /** - * Returns whether tilt interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * Set the shape of the {@link google.maps.Marker} used for interaction. See {@link google.maps.MarkerOptions.shape} and {@link google.maps.MarkerShape}. */ - getTiltInteractionEnabled(): boolean | null; + setShape(shape?: google.maps.MarkerShape | null): void; /** - * Returns the zoom of the map. If the zoom has not been set then the result is undefined. + * Set the title of the {@link google.maps.Marker} tooltip. See {@link google.maps.MarkerOptions.title}. */ - getZoom(): number | undefined; + setTitle(title?: string | null): void; /** - * Immediately sets the map's camera to the target camera options, without animation. + * Set if the {@link google.maps.Marker} is visible. */ - moveCamera(cameraOptions: google.maps.CameraOptions): void; + setVisible(visible: boolean): void; /** - * Changes the center of the map by the given distance in pixels. If the distance is less than both the width and height of the map, the transition will be smoothly animated. Note that the map coordinate system increases from west to east (for x values) and north to south (for y values). + * Set the zIndex of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.zIndex}. */ - panBy(x: number, y: number): void; + setZIndex(zIndex?: number | null): void; /** - * Changes the center of the map to the given LatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated. + * The maximum default z-index that the API will assign to a marker. You may set a higher z-index to bring a marker to the front. */ - panTo(latLng: google.maps.LatLng | google.maps.LatLngLiteral): void; + static readonly MAX_ZINDEX: number; + } + /** + * These options specify the appearance of a marker label. A marker label is a string (often a single character) which will appear inside the marker. If you are using it with a custom marker, you can reposition it with the labelOrigin property in the Icon class. + */ + export interface MarkerLabel { /** - * Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that the map will be panned to show as much of the bounds as possible inside {currentMapSizeInPx} - {padding}. For both raster and vector maps, the map's zoom, tilt, and heading will not be changed. + * The className property of the label's element (equivalent to the element's class attribute). Multiple space-separated CSS classes can be added. The font color, size, weight, and family can only be set via the other properties of MarkerLabel. CSS classes should not be used to change the position nor orientation of the label (e.g. using translations and rotations) if also using marker collision management. + * @defaultValue '' (empty string) */ - panToBounds(latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void; - - setCenter(latlng: google.maps.LatLng | google.maps.LatLngLiteral): void; + className?: string; /** - * Controls whether the map icons are clickable or not. A map icon represents a point of interest, also known as a POI. To disable the clickability of map icons, pass a value of false to this method. + * The color of the label text. + * @defaultValue 'black' */ - setClickableIcons(value: boolean): void; + color?: string; /** - * Sets the compass heading for map measured in degrees from cardinal direction North. For raster maps, this method only applies to aerial imagery. + * The font family of the label text (equivalent to the CSS font-family property). */ - setHeading(heading: number): void; + fontFamily?: string; /** - * Sets whether heading interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * The font size of the label text (equivalent to the CSS font-size property). + * @defaultValue '14px' */ - setHeadingInteractionEnabled(headingInteractionEnabled: boolean): void; + fontSize?: string; + /** + * The font weight of the label text (equivalent to the CSS font-weight property). + */ + fontWeight?: string; + /** + * The text to be displayed in the label. + */ + text: string; + } - setMapTypeId(mapTypeId: google.maps.MapTypeIdString | string): void; + export interface MarkerLibrary { - setOptions(options: google.maps.MapOptions | null): void; + AdvancedMarkerClickEvent: typeof google.maps.marker.AdvancedMarkerClickEvent; + + AdvancedMarkerElement: typeof google.maps.marker.AdvancedMarkerElement; + + Animation: typeof google.maps.Animation; + + CollisionBehavior: typeof google.maps.CollisionBehavior; + + Marker: typeof google.maps.Marker; + + PinElement: typeof google.maps.marker.PinElement; + } + /** + * MarkerOptions object used to define the properties that can be set on a Marker. + * @deprecated As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. Please see https://developers.google.com/maps/deprecations for deprecation details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide. + */ + export interface MarkerOptions { /** - * Sets the current RenderingType of the map. + * The offset from the marker's position to the tip of an InfoWindow that has been opened with the marker as anchor. */ - setRenderingType(renderingType: google.maps.RenderingTypeString): void; + anchorPoint?: google.maps.Point | null; /** - * Binds a StreetViewPanorama to the map. This panorama overrides the default StreetViewPanorama, allowing the map to bind to an external panorama outside of the map. Setting the panorama to null binds the default embedded panorama back to the map. + * Which animation to play when marker is added to a map. + * @defaultValue null */ - setStreetView(panorama: google.maps.StreetViewPanorama | null): void; + animation?: google.maps.Animation | null; /** - * For vector maps, sets the angle of incidence of the map. The allowed values are restricted depending on the zoom level of the map.

For raster maps, controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. setTilt(0) causes the map to always use a 0° overhead view regardless of the zoom level and viewport. setTilt(45) causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value set by setTilt. Because getTilt and setTilt refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects. + * If true, the marker receives mouse and touch events. + * @defaultValue true */ - setTilt(tilt: number): void; + clickable?: boolean | null; /** - * Sets whether tilt interactions are enabled. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). + * If false, disables cross that appears beneath the marker when dragging. + * @defaultValue true */ - setTiltInteractionEnabled(tiltInteractionEnabled: boolean): void; + crossOnDrag?: boolean | null; /** - * Sets the zoom of the map. + * Mouse cursor type to show on hover. + * @defaultValue pointer */ - setZoom(zoom: number): void; + cursor?: string | null; /** - * Map ID which can be used for code samples which require a map ID. This map ID is not intended for use in production applications and cannot be used for features which require cloud configuration (such as Cloud Styling). + * If true, the marker can be dragged. Note: Setting this to true will make the marker clickable even if clickable is set to false. + * @defaultValue false */ - static readonly DEMO_MAP_ID: string; - } - /** - * This event is created from monitoring zoom change. - * Access by calling `const {ZoomChangeEvent} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class ZoomChangeEvent extends Event { - } - /** - * MapElement is an HTMLElement subclass for rendering maps. After loading the maps library, a map can be created in HTML. For example:

<gmp-map center="37.4220656,-122.0840897" zoom="10" map-id="DEMO_MAP_ID">
  <button slot="control-block-start-inline-end">Custom Control</button>
</gmp-map>

Internally, it uses {@link google.maps.Map}, which can be accessed with the {@link google.maps.MapElement.innerMap} property. - * Access by calling `const {MapElement} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class MapElement extends HTMLElement implements google.maps.MapElementOptions { + draggable?: boolean | null; /** - * - * @param options + * Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url. */ - constructor(options?: google.maps.MapElementOptions); + icon?: string | google.maps.Icon | google.maps.Symbol | null; /** - * The center latitude/longitude of the map. + * Adds a label to the marker. A marker label is a letter or number that appears inside a marker. The label can either be a string, or a MarkerLabel object. If provided and {@link google.maps.MarkerOptions.title} is not provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided label's text. Please note that the label is currently only used for accessibility text for non-optimized markers. + * @defaultValue null */ - center: google.maps.LatLng | google.maps.LatLngLiteral | null; + label?: string | google.maps.MarkerLabel | null; /** - * Whether the map should allow user control of the camera heading (rotation). This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). - * @defaultValue false + * Map on which to display Marker. The map is required to display the marker and can be provided with {@link google.maps.Marker.setMap} if not provided at marker construction. */ - headingInteractionDisabled: boolean | null; + map?: google.maps.Map | google.maps.StreetViewPanorama | null; /** - * A reference to the {@link google.maps.Map} that the MapElement uses internally. + * A number between 0.0, transparent, and 1.0, opaque. + * @defaultValue 1.0 */ - innerMap: google.maps.Map; + opacity?: number | null; /** - * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property or replace the value with an empty string. Only unique values will be sent. Changes to this value after instantiation may be ignored. - * @defaultValue null + * Optimization enhances performance by rendering many markers as a single static element. This is useful in cases where a large number of markers is required. Read more about marker optimization. Note: This optimization has no effect for markers on vector maps. */ - get internalUsageAttributionIds(): string[] | null; + optimized?: boolean | null; /** - * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property or replace the value with an empty string. Only unique values will be sent. Changes to this value after instantiation may be ignored. - * @defaultValue null + * Sets the marker position. A marker may be constructed but not displayed until its position is provided - for example, by a user's actions or choices. A marker position can be provided with {@link google.maps.Marker.setPosition} if not provided at marker construction. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + position?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * The map ID of the map. This parameter cannot be set or changed after a map is instantiated. {@link google.maps.Map.DEMO_MAP_ID} can be used to try out features that require a map ID but which do not require cloud enablement. + * Image map region definition used for drag/click. */ - mapId: string | null; + shape?: google.maps.MarkerShape | null; /** - * Whether the map should be a raster or vector map. This parameter cannot be set or changed after a map is instantiated. If not set, then the cloud configuration for the map ID will determine the rendering type (if available). Please note that vector maps may not be available for all devices and browsers and the map will fall back to a raster map as needed. - * @defaultValue {@link google.maps.RenderingType.VECTOR} + * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided value. Please note that the title is currently only used for accessibility text for non-optimized markers. + * @defaultValue undefined */ - renderingType: google.maps.RenderingTypeString | null; + title?: string | null; /** - * Whether the map should allow user control of the camera tilt. This option is only in effect when the map is a vector map. If not set in code, then the cloud configuration for the map ID will be used (if available). - * @defaultValue false + * If true, the marker is visible. + * @defaultValue true */ - tiltInteractionDisabled: boolean | null; + visible?: boolean | null; /** - * The zoom level of the map. Valid zoom values are numbers from zero up to the supported maximum zoom level. Larger zoom values correspond to a higher resolution. + * All markers are displayed on the map in order of their zIndex, with higher values displaying in front of markers with lower values. By default, markers are displayed according to their vertical position on screen, with lower markers appearing in front of markers further up the screen. */ - zoom: number | null; - addEventListener(type: K, listener: (this: MapElement, ev: MapElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface MapElementEventMap extends HTMLElementEventMap { - "gmp-zoomchange": google.maps.ZoomChangeEvent; + zIndex?: number | null; + /** + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Set a collision behavior for markers on vector maps. + * @defaultValue null + * @deprecated collisionBehavior is deprecated as of July 2023. Use {@link google.maps.marker.AdvancedMarkerElement.collisionBehavior} instead. + */ + collisionBehavior?: string | google.maps.CollisionBehaviorString | null; } /** - * Animations that can be played on a marker. Use the {@link google.maps.Marker.setAnimation} method on Marker or the {@link google.maps.MarkerOptions.animation} option to play an animation. - * - * Access by calling `const {Animation} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This object defines the clickable region of a marker image. The shape consists of two properties — type and coord — which define the non-transparent region of an image. */ - export enum Animation { + export interface MarkerShape { /** - * Marker bounces until animation is stopped by calling {@link google.maps.Marker.setAnimation} with null. + * The format of this attribute depends on the value of the type and follows the w3 AREA coords specification found at http://www.w3.org/TR/REC-html40/struct/objects.html#adef-coords.
The coords attribute is an array of integers that specify the pixel position of the shape relative to the top-left corner of the target image. The coordinates depend on the value of type as follows:
  - circle: coords is [x1,y1,r] where x1,y2 are the coordinates of the center of the circle, and r is the radius of the circle.
  - poly: coords is [x1,y1,x2,y2...xn,yn] where each x,y pair contains the coordinates of one vertex of the polygon.
  - rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. */ - BOUNCE = 1, + coords: number[] | null; /** - * Marker drops from the top of the map to its final location. Animation will cease once the marker comes to rest and {@link google.maps.Marker.getAnimation} will return null. This type of animation is usually specified during creation of the marker. + * Describes the shape's type and can be circle, poly or rect. */ - DROP = 2, + type: string; } /** - * A service for obtaining the highest zoom level at which satellite imagery is available for a given location. - * Access by calling `const {MaxZoomService} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A MaxZoom result in JSON format retrieved from the MaxZoomService. */ - export class MaxZoomService { + export interface MaxZoomResult { /** - * Creates a new instance of a MaxZoomService that can be used to send queries about the maximum zoom level available for satellite imagery. + * Status of the request. This property is only defined when using callbacks with {@link google.maps.MaxZoomService.getMaxZoomAtLatLng} (it is not defined when using Promises). + */ + status: google.maps.MaxZoomStatusString | null; + /** + * The maximum zoom level found at the given LatLng. + */ + zoom: number; + } + /** + * A service for obtaining the highest zoom level at which satellite imagery is available for a given location. + * Access by calling `const {MaxZoomService} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class MaxZoomService { + /** + * Creates a new instance of a MaxZoomService that can be used to send queries about the maximum zoom level available for satellite imagery. */ constructor(); /** @@ -3491,12462 +3798,12020 @@ declare namespace google.maps { } export type MaxZoomStatusString = `${google.maps.MaxZoomStatus}`; /** - * This object is returned from a mouse event on a FeatureLayer. + * Options for the rendering of the motion tracking control. */ - export interface FeatureMouseEvent extends google.maps.MapMouseEvent { + export interface MotionTrackingControlOptions { /** - * The Features at this mouse event. + * Position id. This is used to specify the position of this control on the panorama. + * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} */ - features: google.maps.Feature[]; + position?: google.maps.ControlPosition | null; } /** - * You can implement this class if you want to display custom types of overlay objects on the map.

Inherit from this class by setting your overlay's prototype: MyOverlay.prototype = new google.maps.OverlayView();. The OverlayView constructor is guaranteed to be an empty function.

You must implement three methods: onAdd(), draw(), and onRemove().
  • In the onAdd() method, you should create DOM objects and append them as children of the panes.
  • In the draw() method, you should position these elements.
  • In the onRemove() method, you should remove the objects from the DOM.
You must call setMap() with a valid Map object to trigger the call to the onAdd() method and setMap(null) in order to trigger the onRemove() method. The setMap() method can be called at the time of construction or at any point afterward when the overlay should be re-shown after removing. The draw() method will then be called whenever a map property changes that could change the position of the element, such as zoom, center, or map type. - * Access by calling `const {OverlayView} = await google.maps.importLibrary("maps");` or `const {OverlayView} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {MVCArray} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class OverlayView extends google.maps.MVCObject { - /** - * Creates an OverlayView. - */ - constructor(); - /** - * Stops click, tap, drag, and wheel events on the element from bubbling up to the map. Use this to prevent map dragging and zooming, as well as map "click" events. - */ - static preventMapHitsAndGesturesFrom(element: Element): void; + export class MVCArray< T = any > extends google.maps.MVCObject { /** - * Stops click or tap on the element from bubbling up to the map. Use this to prevent the map from triggering "click" events. + * A mutable MVC Array. + * @param array */ - static preventMapHitsFrom(element: Element): void; + constructor(array?: T[] | null); /** - * Implement this method to draw or update the overlay. Use the position from projection.fromLatLngToDivPixel() to correctly position the overlay relative to the MapPanes. This method is called after onAdd(), and is called on change of zoom or center. It is not recommended to do computationally expensive work in this method. + * Removes all elements from the array. */ - draw(): void; - - getMap(): google.maps.Map | google.maps.StreetViewPanorama; + clear(): void; /** - * Returns the panes in which this OverlayView can be rendered. The panes are not initialized until onAdd is called by the API. + * Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index). */ - getPanes(): google.maps.MapPanes | null; + forEach(callback: (arg0: T, arg1: number) => void): void; /** - * Returns the MapCanvasProjection object associated with this OverlayView. The projection is not initialized until onAdd is called by the API. + * Returns a reference to the underlying Array. Warning: if the Array is mutated, no events will be fired by this object. */ - getProjection(): google.maps.MapCanvasProjection; + getArray(): T[]; /** - * Implement this method to initialize the overlay DOM elements. This method is called once after setMap() is called with a valid map. At this point, panes and projection will have been initialized. + * Returns the element at the specified index. */ - onAdd(): void; + getAt(i: number): T; /** - * Implement this method to remove your elements from the DOM. This method is called once following a call to setMap(null). + * Returns the number of elements in this array. */ - onRemove(): void; + getLength(): number; /** - * Adds the overlay to the map or panorama. + * Inserts an element at the specified index. */ - setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void; - } - /** - * A polygon (like a polyline) defines a series of connected coordinates in an ordered sequence. Additionally, polygons form a closed loop and define a filled region. See the samples in the developer's guide, starting with a simple polygon, a polygon with a hole, and more. Note that you can also use the Data layer to create a polygon. The Data layer offers a simpler way of creating holes because it handles the order of the inner and outer paths for you. - * Access by calling `const {Polygon} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Polygon extends google.maps.MVCObject { + insertAt(i: number, elem: T): void; /** - * Create a polygon using the passed PolygonOptions, which specify the polygon's path, the stroke style for the polygon's edges, and the fill style for the polygon's interior regions. A polygon may contain one or more paths, where each path consists of an array of LatLngs. You may pass either an array of LatLngs or an MVCArray of LatLngs when constructing these paths. Arrays are converted to MVCArrays within the polygon upon instantiation. - * @param opts + * Removes the last element of the array and returns that element. */ - constructor(opts?: google.maps.PolygonOptions | null); + pop(): T; /** - * Returns whether this shape can be dragged by the user. + * Adds one element to the end of the array and returns the new length of the array. */ - getDraggable(): boolean; + push(elem: T): number; /** - * Returns whether this shape can be edited by the user. + * Removes an element from the specified index. */ - getEditable(): boolean; + removeAt(i: number): T; /** - * Returns the map on which this shape is attached. + * Sets an element at the specified index. */ - getMap(): google.maps.Map | null; + setAt(i: number, elem: T): void; + } + /** + * Base class implementing KVO.

The MVCObject constructor is guaranteed to be an empty function, and so you may inherit from MVCObject by writing MySubclass.prototype = new google.maps.MVCObject();. Unless otherwise noted, this is not true of other classes in the API, and inheriting from other classes in the API is not supported. + * Access by calling `const {MVCObject} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class MVCObject { /** - * Retrieves the first path. + * Creates an MVCObject. */ - getPath(): google.maps.MVCArray; + constructor(); /** - * Retrieves the paths for this polygon. + * Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with google.maps.event.removeListener. */ - getPaths(): google.maps.MVCArray>; + addListener(eventName: string, handler: Function): google.maps.MapsEventListener; /** - * Returns whether this poly is visible on the map. + * Binds a View to a Model. */ - getVisible(): boolean; + bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null, noNotify?: boolean): void; /** - * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. + * Gets a value. */ - setDraggable(draggable: boolean): void; + get(key: string): any; /** - * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. + * Notify all observers of a change on this property. This notifies both objects that are bound to the object's property as well as the object that it is bound to. */ - setEditable(editable: boolean): void; + notify(key: string): void; /** - * Renders this shape on the specified map. If map is set to null, the shape will be removed. + * Sets a value. */ - setMap(map: google.maps.Map | null): void; - - setOptions(options: google.maps.PolygonOptions | null): void; + set(key: string, value: unknown): void; /** - * Sets the first path. See PolygonOptions for more details. + * Sets a collection of key-value pairs. */ - setPath(path: google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[]): void; + setValues(values?: object | null): void; /** - * Sets the path for this polygon. + * Removes a binding. Unbinding will set the unbound property to the current value. The object will not be notified, as the value has not changed. */ - setPaths(paths: google.maps.MVCArray> | google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[][] | (google.maps.LatLng | google.maps.LatLngLiteral)[]): void; + unbind(key: string): void; /** - * Hides this poly if set to false. + * Removes all bindings. */ - setVisible(visible: boolean): void; + unbindAll(): void; } /** - * A polyline is a linear overlay of connected line segments on the map. - * Access by calling `const {Polyline} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A Orientation3D is a three-dimensional vector used for standard mathematical rotation transformations along heading, tilt, and roll.
  • heading is an angle in the range [0, 360) degrees.
  • tilt is an angle in the range [0, 360) degrees.
  • roll is an angle in the range [0, 360) degrees.
+ * Access by calling `const {Orientation3D} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Polyline extends google.maps.MVCObject { + export class Orientation3D implements google.maps.Orientation3DLiteral { /** - * Create a polyline using the passed PolylineOptions, which specify both the path of the polyline and the stroke style to use when drawing the polyline. You may pass either an array of LatLngs or an MVCArray of LatLngs when constructing a polyline, though simple arrays are converted to MVCArrays within the polyline upon instantiation. - * @param opts + * + * @param value The initializing value. */ - constructor(opts?: google.maps.PolylineOptions | null); + constructor(value: google.maps.Orientation3D | google.maps.Orientation3DLiteral); /** - * Returns whether this shape can be dragged by the user. + * Rotation about the z-axis (normal to the Earth's surface). A value of 0 (the default) equals North. A positive rotation is clockwise around the z-axis and specified in degrees from 0 to 360. Values above or below this range will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 530 will be converted to 170 as well. + * @defaultValue 0 */ - getDraggable(): boolean; + get heading(): number; /** - * Returns whether this shape can be edited by the user. + * Rotation about the y-axis. A positive rotation is clockwise around the y-axis and specified in degrees from 0 to 360. Values above or below this range will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 530 will be converted to 170 as well. + * @defaultValue 0 */ - getEditable(): boolean; + get roll(): number; /** - * Returns the map on which this shape is attached. + * Rotation about the x-axis. A positive rotation is clockwise around the x-axis and specified in degrees from 0 to 360. Values above or below this range will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 530 will be converted to 170 as well. + * @defaultValue 0 */ - getMap(): google.maps.Map | null; + get tilt(): number; /** - * Retrieves the path. + * Comparison function. */ - getPath(): google.maps.MVCArray; + equals(other: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null): boolean; /** - * Returns whether this poly is visible on the map. + * Converts to a plain object. */ - getVisible(): boolean; + toJSON(key?: string): google.maps.Orientation3DLiteral; + } + /** + * Object literals are accepted in place of Orientation3D objects, as a convenience, in many places. These are converted to Orientation3D objects when the Maps API encounters them. + */ + export interface Orientation3DLiteral { /** - * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. + * Rotation about the z-axis (normal to the Earth's surface). A value of 0 (the default) equals North. A positive rotation is clockwise around the z-axis and specified in degrees from 0 to 360. */ - setDraggable(draggable: boolean): void; + heading?: number | null; /** - * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. + * Rotation about the y-axis. A positive rotation is clockwise around the y-axis and specified in degrees from 0 to 360. */ - setEditable(editable: boolean): void; + roll?: number | null; /** - * Renders this shape on the specified map. If map is set to null, the shape will be removed. + * Rotation about the x-axis. A positive rotation is clockwise around the x-axis and specified in degrees from 0 to 360. */ - setMap(map: google.maps.Map | null): void; - - setOptions(options: google.maps.PolylineOptions | null): void; + tilt?: number | null; + } + /** + * You can implement this class if you want to display custom types of overlay objects on the map.

Inherit from this class by setting your overlay's prototype: MyOverlay.prototype = new google.maps.OverlayView();. The OverlayView constructor is guaranteed to be an empty function.

You must implement three methods: onAdd(), draw(), and onRemove().
  • In the onAdd() method, you should create DOM objects and append them as children of the panes.
  • In the draw() method, you should position these elements.
  • In the onRemove() method, you should remove the objects from the DOM.
You must call setMap() with a valid Map object to trigger the call to the onAdd() method and setMap(null) in order to trigger the onRemove() method. The setMap() method can be called at the time of construction or at any point afterward when the overlay should be re-shown after removing. The draw() method will then be called whenever a map property changes that could change the position of the element, such as zoom, center, or map type. + * Access by calling `const {OverlayView} = await google.maps.importLibrary("maps");` or `const {OverlayView} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class OverlayView extends google.maps.MVCObject { /** - * Sets the path. See PolylineOptions for more details. + * Creates an OverlayView. */ - setPath(path: google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[]): void; + constructor(); /** - * Hides this poly if set to false. + * Stops click, tap, drag, and wheel events on the element from bubbling up to the map. Use this to prevent map dragging and zooming, as well as map "click" events. */ - setVisible(visible: boolean): void; - } - /** - * A rectangle overlay. - * Access by calling `const {Rectangle} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Rectangle extends google.maps.MVCObject { + static preventMapHitsAndGesturesFrom(element: Element): void; /** - * Create a rectangle using the passed RectangleOptions, which specify the bounds and style. - * @param opts + * Stops click or tap on the element from bubbling up to the map. Use this to prevent the map from triggering "click" events. */ - constructor(opts?: google.maps.RectangleOptions | null); + static preventMapHitsFrom(element: Element): void; /** - * Returns the bounds of this rectangle. + * Implement this method to draw or update the overlay. Use the position from projection.fromLatLngToDivPixel() to correctly position the overlay relative to the MapPanes. This method is called after onAdd(), and is called on change of zoom or center. It is not recommended to do computationally expensive work in this method. */ - getBounds(): google.maps.LatLngBounds | null; + draw(): void; + + getMap(): google.maps.Map | google.maps.StreetViewPanorama | null | undefined; /** - * Returns whether this rectangle can be dragged by the user. + * Returns the panes in which this OverlayView can be rendered. The panes are not initialized until onAdd is called by the API. */ - getDraggable(): boolean; + getPanes(): google.maps.MapPanes | null | undefined; /** - * Returns whether this rectangle can be edited by the user. + * Returns the MapCanvasProjection object associated with this OverlayView. The projection is not initialized until onAdd is called by the API. */ - getEditable(): boolean; + getProjection(): google.maps.MapCanvasProjection; /** - * Returns the map on which this rectangle is displayed. + * Implement this method to initialize the overlay DOM elements. This method is called once after setMap() is called with a valid map. At this point, panes and projection will have been initialized. */ - getMap(): google.maps.Map | null; + onAdd(): void; /** - * Returns whether this rectangle is visible on the map. + * Implement this method to remove your elements from the DOM. This method is called once following a call to setMap(null). */ - getVisible(): boolean; + onRemove(): void; /** - * Sets the bounds of this rectangle. + * Adds the overlay to the map or panorama. */ - setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): void; + setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void; + } + + export interface Padding { /** - * If set to true, the user can drag this rectangle over the map. + * Padding for the bottom, in pixels. */ - setDraggable(draggable: boolean): void; + bottom?: number; /** - * If set to true, the user can edit this rectangle by dragging the control points shown at the corners and on each edge. + * Padding for the left, in pixels. */ - setEditable(editable: boolean): void; + left?: number; /** - * Renders the rectangle on the specified map. If map is set to null, the rectangle will be removed. + * Padding for the right, in pixels. */ - setMap(map: google.maps.Map | null): void; - - setOptions(options: google.maps.RectangleOptions | null): void; + right?: number; /** - * Hides this rectangle if set to false. + * Padding for the top, in pixels. */ - setVisible(visible: boolean): void; - } - /** - * The possible positions of the stroke on a polygon. - * - * Access by calling `const {StrokePosition} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum StrokePosition { - /** - * The stroke is centered on the polygon's path, with half the stroke inside the polygon and half the stroke outside the polygon. - */ - CENTER = 0, - /** - * The stroke lies inside the polygon. - */ - INSIDE = 1, - /** - * The stroke lies outside the polygon. - */ - OUTSIDE = 2, - } - /** - * A layer that illustrates the locations where Street View is available. - * Access by calling `const {StreetViewCoverageLayer} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class StreetViewCoverageLayer extends google.maps.MVCObject { - /** - * Creates a new instance of StreetViewCoverageLayer. - */ - constructor(); - /** - * Returns the map on which this layer is displayed. - */ - getMap(): google.maps.Map | null; - /** - * Renders the layer on the specified map. If the map is set to null, the layer will be removed. - */ - setMap(map: google.maps.Map | null): undefined; + top?: number; } /** - * Options that bias a search result towards returning a Street View panorama that is nearest to the request location, or a panorama that is considered most likely to be what the user wants to see. Specify these by value, or by using the constant's name. For example, 'best' or google.maps.StreetViewPreference.BEST. - * - * Access by calling `const {StreetViewPreference} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Options for the rendering of the pan control. */ - export enum StreetViewPreference { - /** - * Return the Street View panorama that is considered most likely to be what the user wants to see. The best result is determined by algorithms based on user research and parameters such as recognised points of interest, image quality, and distance from the given location. - */ - BEST = 'best', + export interface PanControlOptions { /** - * Return the Street View panorama that is the shortest distance from the provided location. This works well only within a limited radius. The recommended radius is 1km or less. + * Position id. Used to specify the position of the control on the map. + * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} */ - NEAREST = 'nearest', + position?: google.maps.ControlPosition | null; } - export type StreetViewPreferenceString = `${google.maps.StreetViewPreference}`; /** - * The response resolved for a Promise from {@link google.maps.StreetViewService.getPanorama}. + * Options for the Custom Pano Provider. */ - export interface StreetViewResponse { + export interface PanoProviderOptions { /** - * The representation of a panorama. + * If set, the renderer will use technologies (like webgl) that only work when cors headers are appropriately set on the provided images. It is the developer's task to serve the images correctly in combination with this flag, which might otherwise lead to SecurityErrors. */ - data: google.maps.StreetViewPanoramaData; + cors?: boolean; } /** - * A StreetViewService object performs searches for Street View data. - * Access by calling `const {StreetViewService} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * An elevation query sent by the ElevationService containing the path along which to return sampled data. This request defines a continuous path along the earth along which elevation samples should be taken at evenly-spaced distances. All paths from vertex to vertex use segments of the great circle between those two points. */ - export class StreetViewService { + export interface PathElevationRequest { /** - * Creates a StreetViewService, which provides an interface to the data stored in the Street View service. + * The path along which to collect elevation values. */ - constructor(); + path?: (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; /** - * Retrieves the StreetViewPanoramaData for a panorama that matches the supplied Street View query request. The StreetViewPanoramaData is passed to the provided callback. + * Required. The number of equidistant points along the given path for which to retrieve elevation data, including the endpoints. The number of samples must be a value between 2 and 512 inclusive. */ - getPanorama(request: google.maps.StreetViewLocationRequest | google.maps.StreetViewPanoRequest, callback?: ((arg0: google.maps.StreetViewPanoramaData | null, arg1: google.maps.StreetViewStatusString) => void)): Promise; + samples: number; } /** - * Identifiers to limit Street View searches to selected sources. These values are specified as strings. For example, 'outdoor'. - * - * Access by calling `const {StreetViewSource} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * An elevation response returned by the {@link google.maps.ElevationService} containing the list of {@link google.maps.ElevationResult}s evenly-spaced along the path of the {@link google.maps.PathElevationRequest}. */ - export enum StreetViewSource { - /** - * Uses the default sources of Street View, searches will not be limited to specific sources. - */ - DEFAULT = 'default', - /** - * Limits Street View searches to official Google collections. - */ - GOOGLE = 'google', + export interface PathElevationResponse { /** - * Limits Street View searches to outdoor collections. Indoor collections are not included in search results. Note also that the search only returns panoramas where it's possible to determine whether they're indoors or outdoors. For example, PhotoSpheres are not returned because it's unknown whether they are indoors or outdoors. + * The list of {@link google.maps.ElevationResult}s matching the samples of the {@link google.maps.PathElevationRequest}. */ - OUTDOOR = 'outdoor', + results: google.maps.ElevationResult[]; } - export type StreetViewSourceString = `${google.maps.StreetViewSource}`; /** - * The status returned by the StreetViewService on completion of a Street View request. These can be specified by value, or by using the constant's name. For example, 'OK' or google.maps.StreetViewStatus.OK. - * - * Access by calling `const {StreetViewStatus} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Contains information needed to locate, identify, or describe a place for a {@link google.maps.DirectionsRequest} or {@link google.maps.DistanceMatrixRequest}. In this context, "place" means a business, point of interest, or geographic location. For fetching information about a place, see {@link google.maps.places.PlacesService}. */ - export enum StreetViewStatus { + export interface Place { /** - * The request was successful. + * The LatLng of the entity described by this place. */ - OK = 'OK', + location?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * The request could not be successfully processed, yet the exact reason for failure is unknown. + * The place ID of the place (such as a business or point of interest). The place ID is a unique identifier of a place in the Google Maps database. Note that the placeId is the most accurate way of identifying a place. If possible, you should specify the placeId rather than a query. A place ID can be retrieved from any request to the Places API, such as a TextSearch. Place IDs can also be retrieved from requests to the Geocoding API. For more information, see the overview of place IDs. */ - UNKNOWN_ERROR = 'UNKNOWN_ERROR', + placeId?: string; /** - * There are no panoramas found that match the search criteria. + * A search query describing the place (such as a business or point of interest). An example query is "Quay, Upper Level, Overseas Passenger Terminal 5 Hickson Road, The Rocks NSW". If possible, you should specify the placeId rather than a query. The API does not guarantee the accuracy of resolving the query string to a place. If both the placeId and query are provided, an error occurs. */ - ZERO_RESULTS = 'ZERO_RESULTS', + query?: string; } - export type StreetViewStatusString = `${google.maps.StreetViewStatus}`; /** - * This class is used to create a MapType that renders image tiles. + * An interface representing a feature with a place ID which includes features of type {@link google.maps.FeatureType.ADMINISTRATIVE_AREA_LEVEL_1}, {@link google.maps.FeatureType.ADMINISTRATIVE_AREA_LEVEL_2}, {@link google.maps.FeatureType.COUNTRY}, {@link google.maps.FeatureType.LOCALITY}, {@link google.maps.FeatureType.POSTAL_CODE}, and {@link google.maps.FeatureType.SCHOOL_DISTRICT}. */ - export interface ImageMapTypeOptions { - /** - * Alt text to display when this MapType's button is hovered over in the MapTypeControl. - */ - alt?: string | null; - /** - * Returns a string (URL) for given tile coordinate (x, y) and zoom level. - */ - getTileUrl?: ((arg0: google.maps.Point, arg1: number) => (string | null)) | null; - /** - * The maximum zoom level for the map when displaying this MapType. - */ - maxZoom?: number | null; - /** - * The minimum zoom level for the map when displaying this MapType. Optional. - */ - minZoom?: number | null; - /** - * Name to display in the MapTypeControl. - */ - name?: string | null; + export interface PlaceFeature extends google.maps.Feature { /** - * The opacity to apply to the tiles. The opacity should be specified as a float value between 0 and 1.0, where 0 is fully transparent and 1 is fully opaque. + * The {@link google.maps.places.PlaceResult.place_id}. */ - opacity?: number | null; + placeId: string; /** - * The tile size. + * Fetches a Place for this PlaceFeature. In the resulting Place object, the id and the displayName properties will be populated. The display name will be in the language the end user sees on the map. (Additional fields can be subsequently requested via Place.fetchFields() subject to normal Places API enablement and billing.) Do not call this from a FeatureStyleFunction since only synchronous FeatureStyleFunctions are supported. The promise is rejected if there was an error fetching the Place. */ - tileSize?: google.maps.Size | null; + fetchPlace(): Promise; } - /** - * This class implements the MapType interface and is provided for rendering image tiles. - * Access by calling `const {ImageMapType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class ImageMapType extends google.maps.MVCObject implements google.maps.MapType { - /** - * Constructs an ImageMapType using the provided ImageMapTypeOptions - * @param opts - */ - constructor(opts: google.maps.ImageMapTypeOptions | null); - alt: string | null; + export interface PlacesLibrary { - maxZoom: number; + AccessibilityOptions: typeof google.maps.places.AccessibilityOptions; - minZoom: number; + AddressComponent: typeof google.maps.places.AddressComponent; - name: string | null; + AddressDescriptor: typeof google.maps.places.AddressDescriptor; - projection: google.maps.Projection | null; + Area: typeof google.maps.places.Area; - radius: number; + Attribution: typeof google.maps.places.Attribution; - tileSize: google.maps.Size | null; - /** - * Returns the opacity level (0 (transparent) to 1.0) of the ImageMapType tiles. - */ - getOpacity(): number; + AttributionColor: typeof google.maps.places.AttributionColor; - getTile(tileCoord: google.maps.Point | null, zoom: number, ownerDocument: Document | null): Element | null; + AuthorAttribution: typeof google.maps.places.AuthorAttribution; - releaseTile(tileDiv: Element | null): void; - /** - * Sets the opacity level (0 (transparent) to 1.0) of the ImageMapType tiles. - */ - setOpacity(opacity: number): void; - } - /** - * The MapTypeStyle is a collection of selectors and stylers that define how the map should be styled. Selectors specify the map features and/or elements that should be affected, and stylers specify how those features and elements should be modified. For details, see the style reference. - */ - export interface MapTypeStyle { - /** - * The element to which a styler should be applied. An element is a visual aspect of a feature on the map. Example: a label, an icon, the stroke or fill applied to the geometry, and more. Optional. If elementType is not specified, the value is assumed to be 'all'. For details of usage and allowed values, see the style reference. - */ - elementType?: string | null; - /** - * The feature, or group of features, to which a styler should be applied. Optional. If featureType is not specified, the value is assumed to be 'all'. For details of usage and allowed values, see the style reference. - */ - featureType?: string | null; - /** - * The style rules to apply to the selected map features and elements. The rules are applied in the order that you specify in this array. For guidelines on usage and allowed values, see the style reference. - */ - stylers: object[]; - } - /** - * This class is used to specify options when creating a StyledMapType. These options cannot be changed after the StyledMapType is instantiated. - */ - export interface StyledMapTypeOptions { - /** - * Text to display when this MapType's button is hovered over in the map type control. - */ - alt?: string | null; - /** - * The maximum zoom level for the map when displaying this MapType. Optional. - */ - maxZoom?: number | null; - /** - * The minimum zoom level for the map when displaying this MapType. Optional. - */ - minZoom?: number | null; - /** - * The name to display in the map type control. - */ - name?: string | null; - } - /** - * Creates a MapType with a custom style. - * Access by calling `const {StyledMapType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class StyledMapType extends google.maps.MVCObject implements google.maps.MapType { - /** - * Creates a styled MapType with the specified options. The StyledMapType takes an array of MapTypeStyles, where each MapTypeStyle is applied to the map consecutively. A later MapTypeStyle that applies the same MapTypeStylers to the same selectors as an earlier MapTypeStyle will override the earlier MapTypeStyle.

Note that the StyledMapType is not supported when a map ID is set. When using both together, you will receive a console warning. - * @param styles - * @param options - */ - constructor(styles: (google.maps.MapTypeStyle | null)[] | null, options?: google.maps.StyledMapTypeOptions | null); + Autocomplete: typeof google.maps.places.Autocomplete; - alt: string; + AutocompleteService: typeof google.maps.places.AutocompleteService; - maxZoom: number; + AutocompleteSessionToken: typeof google.maps.places.AutocompleteSessionToken; - minZoom: number; + AutocompleteSuggestion: typeof google.maps.places.AutocompleteSuggestion; - name: string; + BasicPlaceAutocompleteElement: typeof google.maps.places.BasicPlaceAutocompleteElement; - projection: google.maps.Projection | null; + BusinessStatus: typeof google.maps.places.BusinessStatus; - radius: number; + ConnectorAggregation: typeof google.maps.places.ConnectorAggregation; - tileSize: google.maps.Size | null; + ConsumerAlert: typeof google.maps.places.ConsumerAlert; - getTile(tileCoord: google.maps.Point | null, zoom: number, ownerDocument: Document | null): Element | null; + ConsumerAlertDetails: typeof google.maps.places.ConsumerAlertDetails; - releaseTile(tile: Element | null): void; - } - /** - * An event listener, created by google.maps.event.addListener() and friends. - */ - export interface MapsEventListener { - /** - * Removes the listener.

Calling listener.remove() is equivalent to google.maps.event.removeListener(listener). - */ - remove(): void; - } - /** - * The status returned by a web service. See https://grpc.github.io/grpc/core/md_doc_statuscodes.html. - * - * Access by calling `const {RPCStatus} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum RPCStatus { - /** - * The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. - */ - ABORTED = 'ABORTED', - /** - * The entity that a client attempted to create (e.g., file or directory) already exists. - */ - ALREADY_EXISTS = 'ALREADY_EXISTS', - /** - * The operation was cancelled, typically by the caller. - */ - CANCELLED = 'CANCELLED', - /** - * Unrecoverable data loss or corruption. - */ - DATA_LOSS = 'DATA_LOSS', - /** - * The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long. - */ - DEADLINE_EXCEEDED = 'DEADLINE_EXCEEDED', - /** - * The operation was rejected because the system is not in a state required for the operation's execution. - */ - FAILED_PRECONDITION = 'FAILED_PRECONDITION', - /** - * Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. - */ - INTERNAL = 'INTERNAL', - /** - * The client specified an invalid argument. Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). - */ - INVALID_ARGUMENT = 'INVALID_ARGUMENT', - /** - * Some requested entity (e.g., file or directory) was not found. - */ - NOT_FOUND = 'NOT_FOUND', - /** - * Not an error; returned on success. - */ - OK = 'OK', - /** - * The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate INVALID_ARGUMENT if asked to read at an offset that is not in the range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from an offset past the current file size. - */ - OUT_OF_RANGE = 'OUT_OF_RANGE', - /** - * The caller does not have permission to execute the specified operation. This error code does not imply the request is valid or the requested entity exists or satisfies other pre-conditions. - */ - PERMISSION_DENIED = 'PERMISSION_DENIED', - /** - * Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - */ - RESOURCE_EXHAUSTED = 'RESOURCE_EXHAUSTED', - /** - * The request does not have valid authentication credentials for the operation. - */ - UNAUTHENTICATED = 'UNAUTHENTICATED', - /** - * The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. - */ - UNAVAILABLE = 'UNAVAILABLE', - /** - * Operation is not implemented or not supported/enabled in this service. - */ - UNIMPLEMENTED = 'UNIMPLEMENTED', - /** - * Unknown error. For example, this error may be returned when a status received from another address space belongs to an error space that is not known in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error. - */ - UNKNOWN = 'UNKNOWN', - } - export type RPCStatusString = `${google.maps.RPCStatus}`; + Containment: typeof google.maps.places.Containment; - export interface CoreLibrary { + ContentBlock: typeof google.maps.places.ContentBlock; - ColorScheme: typeof google.maps.ColorScheme; + EVChargeAmenitySummary: typeof google.maps.places.EVChargeAmenitySummary; - ControlPosition: typeof google.maps.ControlPosition; + EVChargeOptions: typeof google.maps.places.EVChargeOptions; - event: typeof google.maps.event; + EVConnectorType: typeof google.maps.places.EVConnectorType; - LatLng: typeof google.maps.LatLng; + FormattableText: typeof google.maps.places.FormattableText; - LatLngAltitude: typeof google.maps.LatLngAltitude; + FuelOptions: typeof google.maps.places.FuelOptions; - LatLngBounds: typeof google.maps.LatLngBounds; + FuelPrice: typeof google.maps.places.FuelPrice; - MapsNetworkError: typeof google.maps.MapsNetworkError; + FuelType: typeof google.maps.places.FuelType; - MapsNetworkErrorEndpoint: typeof google.maps.MapsNetworkErrorEndpoint; + GenerativeSummary: typeof google.maps.places.GenerativeSummary; - MapsRequestError: typeof google.maps.MapsRequestError; + GoogleMapsLinks: typeof google.maps.places.GoogleMapsLinks; - MapsServerError: typeof google.maps.MapsServerError; + Landmark: typeof google.maps.places.Landmark; - MVCArray: typeof google.maps.MVCArray; + MediaSize: typeof google.maps.places.MediaSize; - MVCObject: typeof google.maps.MVCObject; + Money: typeof google.maps.places.Money; - Orientation3D: typeof google.maps.Orientation3D; + NeighborhoodSummary: typeof google.maps.places.NeighborhoodSummary; - Point: typeof google.maps.Point; + OpeningHours: typeof google.maps.places.OpeningHours; - RPCStatus: typeof google.maps.RPCStatus; + OpeningHoursPeriod: typeof google.maps.places.OpeningHoursPeriod; - Settings: typeof google.maps.Settings; + OpeningHoursPoint: typeof google.maps.places.OpeningHoursPoint; - Size: typeof google.maps.Size; + ParkingOptions: typeof google.maps.places.ParkingOptions; - SymbolPath: typeof google.maps.SymbolPath; + PaymentOptions: typeof google.maps.places.PaymentOptions; - UnitSystem: typeof google.maps.UnitSystem; + Photo: typeof google.maps.places.Photo; - Vector3D: typeof google.maps.Vector3D; - } + Place: typeof google.maps.places.Place; - export interface MapsLibrary { + PlaceAccessibleEntranceIconElement: typeof google.maps.places.PlaceAccessibleEntranceIconElement; - BicyclingLayer: typeof google.maps.BicyclingLayer; + PlaceAddressElement: typeof google.maps.places.PlaceAddressElement; - Circle: typeof google.maps.Circle; + PlaceAllContentElement: typeof google.maps.places.PlaceAllContentElement; - Data: typeof google.maps.Data; + PlaceAttributionElement: typeof google.maps.places.PlaceAttributionElement; - FeatureType: typeof google.maps.FeatureType; + PlaceAutocompleteElement: typeof google.maps.places.PlaceAutocompleteElement; - GroundOverlay: typeof google.maps.GroundOverlay; + PlaceContentConfigElement: typeof google.maps.places.PlaceContentConfigElement; - ImageMapType: typeof google.maps.ImageMapType; + PlaceContextualElement: typeof google.maps.places.PlaceContextualElement; - InfoWindow: typeof google.maps.InfoWindow; + PlaceContextualListConfigElement: typeof google.maps.places.PlaceContextualListConfigElement; - KmlLayer: typeof google.maps.KmlLayer; + PlaceContextualListLayout: typeof google.maps.places.PlaceContextualListLayout; - KmlLayerStatus: typeof google.maps.KmlLayerStatus; + PlaceDetailsCompactElement: typeof google.maps.places.PlaceDetailsCompactElement; - Map: typeof google.maps.Map; + PlaceDetailsElement: typeof google.maps.places.PlaceDetailsElement; - MapElement: typeof google.maps.MapElement; + PlaceDetailsLocationRequestElement: typeof google.maps.places.PlaceDetailsLocationRequestElement; - MapTypeControlStyle: typeof google.maps.MapTypeControlStyle; + PlaceDetailsOrientation: typeof google.maps.places.PlaceDetailsOrientation; - MapTypeId: typeof google.maps.MapTypeId; + PlaceDetailsPlaceRequestElement: typeof google.maps.places.PlaceDetailsPlaceRequestElement; - MapTypeRegistry: typeof google.maps.MapTypeRegistry; + PlaceFeatureListElement: typeof google.maps.places.PlaceFeatureListElement; - MaxZoomService: typeof google.maps.MaxZoomService; + PlaceMediaElement: typeof google.maps.places.PlaceMediaElement; - MaxZoomStatus: typeof google.maps.MaxZoomStatus; + PlaceNearbySearchRequestElement: typeof google.maps.places.PlaceNearbySearchRequestElement; - OverlayView: typeof google.maps.OverlayView; + PlaceOpeningHoursElement: typeof google.maps.places.PlaceOpeningHoursElement; - Polygon: typeof google.maps.Polygon; + PlaceOpenNowStatusElement: typeof google.maps.places.PlaceOpenNowStatusElement; - Polyline: typeof google.maps.Polyline; + PlacePhoneNumberElement: typeof google.maps.places.PlacePhoneNumberElement; - Rectangle: typeof google.maps.Rectangle; + PlacePlusCodeElement: typeof google.maps.places.PlacePlusCodeElement; - RenderingType: typeof google.maps.RenderingType; + PlacePrediction: typeof google.maps.places.PlacePrediction; - StrokePosition: typeof google.maps.StrokePosition; + PlacePredictionSelectEvent: typeof google.maps.places.PlacePredictionSelectEvent; - StyledMapType: typeof google.maps.StyledMapType; + PlacePriceElement: typeof google.maps.places.PlacePriceElement; - TrafficLayer: typeof google.maps.TrafficLayer; + PlaceRatingElement: typeof google.maps.places.PlaceRatingElement; - TransitLayer: typeof google.maps.TransitLayer; + PlaceReviewsElement: typeof google.maps.places.PlaceReviewsElement; - WebGLOverlayView: typeof google.maps.WebGLOverlayView; + PlaceReviewSummaryElement: typeof google.maps.places.PlaceReviewSummaryElement; - ZoomChangeEvent: typeof google.maps.ZoomChangeEvent; - } + PlaceSearchAttributionPosition: typeof google.maps.places.PlaceSearchAttributionPosition; - export interface GeocodingLibrary { + PlaceSearchElement: typeof google.maps.places.PlaceSearchElement; - Containment: typeof google.maps.Containment; + PlaceSearchOrientation: typeof google.maps.places.PlaceSearchOrientation; - ExtraGeocodeComputation: typeof google.maps.ExtraGeocodeComputation; + PlaceSelectEvent: typeof google.maps.places.PlaceSelectEvent; - Geocoder: typeof google.maps.Geocoder; + PlacesService: typeof google.maps.places.PlacesService; - GeocoderLocationType: typeof google.maps.GeocoderLocationType; + PlacesServiceStatus: typeof google.maps.places.PlacesServiceStatus; - GeocoderStatus: typeof google.maps.GeocoderStatus; + PlaceStandardContentElement: typeof google.maps.places.PlaceStandardContentElement; - SpatialRelationship: typeof google.maps.SpatialRelationship; - } + PlaceSummaryElement: typeof google.maps.places.PlaceSummaryElement; - export interface StreetViewLibrary { + PlaceTextSearchRequestElement: typeof google.maps.places.PlaceTextSearchRequestElement; - InfoWindow: typeof google.maps.InfoWindow; + PlaceTypeElement: typeof google.maps.places.PlaceTypeElement; - OverlayView: typeof google.maps.OverlayView; + PlaceTypeSpecificHighlightsElement: typeof google.maps.places.PlaceTypeSpecificHighlightsElement; - StreetViewCoverageLayer: typeof google.maps.StreetViewCoverageLayer; + PlaceWebsiteElement: typeof google.maps.places.PlaceWebsiteElement; - StreetViewPanorama: typeof google.maps.StreetViewPanorama; + PlusCode: typeof google.maps.places.PlusCode; - StreetViewPreference: typeof google.maps.StreetViewPreference; + PostalAddress: typeof google.maps.places.PostalAddress; - StreetViewService: typeof google.maps.StreetViewService; + PriceLevel: typeof google.maps.places.PriceLevel; - StreetViewSource: typeof google.maps.StreetViewSource; + PriceRange: typeof google.maps.places.PriceRange; - StreetViewStatus: typeof google.maps.StreetViewStatus; + RankBy: typeof google.maps.places.RankBy; + + Review: typeof google.maps.places.Review; + + ReviewSummary: typeof google.maps.places.ReviewSummary; + + SearchBox: typeof google.maps.places.SearchBox; + + SearchByTextRankPreference: typeof google.maps.places.SearchByTextRankPreference; + + SearchNearbyRankPreference: typeof google.maps.places.SearchNearbyRankPreference; + + SecondaryOpeningHours: typeof google.maps.places.SecondaryOpeningHours; + + SpatialRelationship: typeof google.maps.places.SpatialRelationship; + + StringRange: typeof google.maps.places.StringRange; + + TimeZone: typeof google.maps.places.TimeZone; + + TransitAgency: typeof google.maps.places.TransitAgency; + + TransitIcon: typeof google.maps.places.TransitIcon; + + TransitLine: typeof google.maps.places.TransitLine; + + TransitStation: typeof google.maps.places.TransitStation; + + TransitStop: typeof google.maps.places.TransitStop; + + TransitVehicleType: typeof google.maps.places.TransitVehicleType; } /** - * A DirectionsWaypoint represents a location between origin and destination through which the trip should be routed. + * Access by calling `const {Point} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface DirectionsWaypoint { + export class Point { /** - * Waypoint location. Can be an address string, a LatLng, or a Place. Optional. + * A point on a two-dimensional plane. + * @param x + * @param y */ - location?: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place; + constructor(x: number, y: number); /** - * If true, indicates that this waypoint is a stop between the origin and destination. This has the effect of splitting the route into two legs. If false, indicates that the route should be biased to go through this waypoint, but not split into two legs. This is useful if you want to create a route in response to the user dragging waypoints on a map. - * @defaultValue true + * The X coordinate */ - stopover?: boolean; - } - /** - * Configures the DirectionsRequest when the travel mode is set to DRIVING. - */ - export interface DrivingOptions { + x: number; /** - * The desired departure time for the route, specified as a Date object. The Date object measures time in milliseconds since 1 January 1970. This must be specified for a DrivingOptions to be valid. The departure time must be set to the current time or some time in the future. It cannot be in the past. + * The Y coordinate */ - departureTime: Date; + y: number; /** - * The preferred assumption to use when predicting duration in traffic. The default is BEST_GUESS. + * Compares two Points */ - trafficModel?: google.maps.TrafficModelString; + equals(other: google.maps.Point | null): boolean; + /** + * Returns a string representation of this Point. + */ + toString(): string; } /** - * The TransitOptions object to be included in a DirectionsRequest when the travel mode is set to TRANSIT. + * A polygon (like a polyline) defines a series of connected coordinates in an ordered sequence. Additionally, polygons form a closed loop and define a filled region. See the samples in the developer's guide, starting with a simple polygon, a polygon with a hole, and more. Note that you can also use the Data layer to create a polygon. The Data layer offers a simpler way of creating holes because it handles the order of the inner and outer paths for you. + * Access by calling `const {Polygon} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface TransitOptions { + export class Polygon extends google.maps.MVCObject { /** - * The desired arrival time for the route, specified as a Date object. The Date object measures time in milliseconds since 1 January 1970. If arrival time is specified, departure time is ignored. + * Create a polygon using the passed PolygonOptions, which specify the polygon's path, the stroke style for the polygon's edges, and the fill style for the polygon's interior regions. A polygon may contain one or more paths, where each path consists of an array of LatLngs. You may pass either an array of LatLngs or an MVCArray of LatLngs when constructing these paths. Arrays are converted to MVCArrays within the polygon upon instantiation. + * @param opts */ - arrivalTime?: Date | null; + constructor(opts?: google.maps.PolygonOptions | null); /** - * The desired departure time for the route, specified as a Date object. The Date object measures time in milliseconds since 1 January 1970. If neither departure time nor arrival time is specified, the time is assumed to be "now". + * Returns whether this shape can be dragged by the user. */ - departureTime?: Date | null; + getDraggable(): boolean; /** - * One or more preferred modes of transit, such as bus or train. If no preference is given, the API returns the default best route. + * Returns whether this shape can be edited by the user. */ - modes?: google.maps.TransitModeString[] | null; + getEditable(): boolean; /** - * A preference that can bias the choice of transit route, such as less walking. If no preference is given, the API returns the default best route. + * Returns the map on which this shape is attached. */ - routingPreference?: google.maps.TransitRoutePreferenceString | null; - } - /** - * A representation of time as a Date object, a localized string, and a time zone. - */ - export interface Time { + getMap(): google.maps.Map | null; /** - * A string representing the time's value. The time is displayed in the time zone of the transit stop. + * Retrieves the first path. */ - text: string; + getPath(): google.maps.MVCArray; /** - * The time zone in which this stop lies. The value is the name of the time zone as defined in the IANA Time Zone Database, e.g. "America/New_York". + * Retrieves the paths for this polygon. */ - time_zone: string; + getPaths(): google.maps.MVCArray>; /** - * The time of this departure or arrival, specified as a JavaScript Date object. + * Returns whether this poly is visible on the map. */ - value: Date; - } - /** - * Information about an agency that operates a transit line. - */ - export interface TransitAgency { + getVisible(): boolean; /** - * The name of this transit agency. + * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. */ - name: string; + setDraggable(draggable: boolean): void; /** - * The transit agency's phone number. + * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. */ - phone: string; + setEditable(editable: boolean): void; /** - * The transit agency's URL. + * Renders this shape on the specified map. If map is set to null, the shape will be removed. */ - url: string; + setMap(map: google.maps.Map | null): void; + + setOptions(options: google.maps.PolygonOptions | null): void; + /** + * Sets the first path. See PolygonOptions for more details. + */ + setPath(path: google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[]): void; + /** + * Sets the path for this polygon. + */ + setPaths(paths: google.maps.MVCArray> | google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[][] | (google.maps.LatLng | google.maps.LatLngLiteral)[]): void; + /** + * Hides this poly if set to false. + */ + setVisible(visible: boolean): void; } /** - * Information about the vehicle that operates on a transit line. + * PolygonOptions object used to define the properties that can be set on a Polygon. */ - export interface TransitVehicle { + export interface PolygonOptions { /** - * A URL for an icon that corresponds to the type of vehicle used on this line. + * Indicates whether this Polygon handles mouse events. + * @defaultValue true */ - icon: string; + clickable?: boolean | null; /** - * A URL for an icon that corresponds to the type of vehicle used in this region instead of the more general icon. + * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. + * @defaultValue false */ - local_icon: string; + draggable?: boolean | null; /** - * A name for this type of TransitVehicle, e.g. "Train" or "Bus". + * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. + * @defaultValue false */ - name: string; + editable?: boolean | null; /** - * The type of vehicle used, e.g. train, bus, or ferry. + * The fill color. All CSS3 colors are supported except for extended named colors. */ - type: google.maps.VehicleTypeString; - } - /** - * Information about the transit line that operates this transit step. - */ - export interface TransitLine { + fillColor?: string | null; /** - * The transit agency that operates this transit line. + * The fill opacity between 0.0 and 1.0 */ - agencies: google.maps.TransitAgency[]; + fillOpacity?: number | null; /** - * The color commonly used in signage for this transit line, represented as a hex string. + * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. Note that the shape of a geodesic polygon may appear to change when dragged, as the dimensions are maintained relative to the surface of the earth. + * @defaultValue false */ - color: string; + geodesic?: boolean | null; /** - * The URL for an icon associated with this line. + * Map on which to display Polygon. */ - icon: string; + map?: google.maps.Map | null; /** - * The full name of this transit line, e.g. "8 Avenue Local". + * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths. As a result, the paths property may specify one or more arrays of LatLng coordinates. Paths are closed automatically; do not repeat the first vertex of the path as the last vertex. Simple polygons may be defined using a single array of LatLngs. More complex polygons may specify an array of arrays. Any simple arrays are converted into MVCArrays. Inserting or removing LatLngs from the MVCArray will automatically update the polygon on the map. */ - name: string; + paths?: google.maps.MVCArray> | google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[][] | (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; /** - * The short name of this transit line, e.g. "E". + * The stroke color. All CSS3 colors are supported except for extended named colors. */ - short_name: string; + strokeColor?: string | null; /** - * The text color commonly used in signage for this transit line, represented as a hex string. + * The stroke opacity between 0.0 and 1.0 */ - text_color: string; + strokeOpacity?: number | null; /** - * The agency's URL which is specific to this transit line. + * The stroke position. + * @defaultValue {@link google.maps.StrokePosition.CENTER} */ - url: string; + strokePosition?: google.maps.StrokePosition | null; /** - * The type of vehicle used, e.g. train or bus. + * The stroke width in pixels. */ - vehicle: google.maps.TransitVehicle; - } - /** - * Details about a transit stop or station. - */ - export interface TransitStop { + strokeWeight?: number | null; /** - * The location of this stop. + * Whether this polygon is visible on the map. + * @defaultValue true */ - location: google.maps.LatLng; + visible?: boolean | null; /** - * The name of this transit stop. + * The zIndex compared to other polys. */ - name: string; + zIndex?: number | null; } /** - * Details about the departure, arrival, and mode of transit used in this step. + * A polyline is a linear overlay of connected line segments on the map. + * Access by calling `const {Polyline} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface TransitDetails { - /** - * The arrival stop of this transit step. - */ - arrival_stop: google.maps.TransitStop; + export class Polyline extends google.maps.MVCObject { /** - * The arrival time of this step, specified as a Time object. + * Create a polyline using the passed PolylineOptions, which specify both the path of the polyline and the stroke style to use when drawing the polyline. You may pass either an array of LatLngs or an MVCArray of LatLngs when constructing a polyline, though simple arrays are converted to MVCArrays within the polyline upon instantiation. + * @param opts */ - arrival_time: google.maps.Time; + constructor(opts?: google.maps.PolylineOptions | null); /** - * The departure stop of this transit step. + * Returns whether this shape can be dragged by the user. */ - departure_stop: google.maps.TransitStop; + getDraggable(): boolean; /** - * The departure time of this step, specified as a Time object. + * Returns whether this shape can be edited by the user. */ - departure_time: google.maps.Time; + getEditable(): boolean; /** - * The direction in which to travel on this line, as it is marked on the vehicle or at the departure stop. + * Returns the map on which this shape is attached. */ - headsign: string; + getMap(): google.maps.Map | null; /** - * The expected number of seconds between equivalent vehicles at this stop. + * Retrieves the path. */ - headway: number; + getPath(): google.maps.MVCArray; /** - * Details about the transit line used in this step. + * Returns whether this poly is visible on the map. */ - line: google.maps.TransitLine; + getVisible(): boolean; /** - * The number of stops on this step. Includes the arrival stop, but not the departure stop. + * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. */ - num_stops: number; + setDraggable(draggable: boolean): void; /** - * The text that appears in schedules and sign boards to identify a transit trip to passengers, for example, to identify train numbers for commuter rail trips. The text uniquely identifies a trip within a service day. + * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. */ - trip_short_name: string; - } - /** - * A fare of a DirectionsRoute consisting of value and currency. - */ - export interface TransitFare { + setEditable(editable: boolean): void; /** - * An ISO 4217 currency code indicating the currency in which the fare is expressed. + * Renders this shape on the specified map. If map is set to null, the shape will be removed. */ - currency: string; + setMap(map: google.maps.Map | null): void; + + setOptions(options: google.maps.PolylineOptions | null): void; /** - * The value of the fare, expressed in the given currency, as a string. + * Sets the path. See PolylineOptions for more details. */ - text: string; + setPath(path: google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[]): void; /** - * The numerical value of the fare, expressed in the given currency. + * Hides this poly if set to false. */ - value: number; + setVisible(visible: boolean): void; } /** - * This object defines the properties that can be set on a DirectionsRenderer object. + * PolylineOptions object used to define the properties that can be set on a Polyline. */ - export interface DirectionsRendererOptions { + export interface PolylineOptions { /** - * The directions to display on the map and/or in a <div> panel, retrieved as a DirectionsResult object from DirectionsService. + * Indicates whether this Polyline handles mouse events. + * @defaultValue true */ - directions?: google.maps.DirectionsResult | null; + clickable?: boolean | null; /** - * If true, allows the user to drag and modify the paths of routes rendered by this DirectionsRenderer. + * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. + * @defaultValue false */ draggable?: boolean | null; /** - * This property indicates whether the renderer should provide a user-selectable list of routes shown in the directions panel. + * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. * @defaultValue false */ - hideRouteList?: boolean | null; + editable?: boolean | null; /** - * The InfoWindow in which to render text information when a marker is clicked. Existing info window content will be overwritten and its position moved. If no info window is specified, the DirectionsRenderer will create and use its own info window. This property will be ignored if suppressInfoWindows is set to true. + * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. Note that the shape of a geodesic polygon may appear to change when dragged, as the dimensions are maintained relative to the surface of the earth. + * @defaultValue false */ - infoWindow?: google.maps.InfoWindow | null; + geodesic?: boolean | null; /** - * Map on which to display the directions. + * The icons to be rendered along the polyline. */ - map?: google.maps.Map | null; + icons?: google.maps.IconSequence[] | null; /** - * Options for the markers. All markers rendered by the DirectionsRenderer will use these options. + * Map on which to display Polyline. */ - markerOptions?: google.maps.MarkerOptions | null; + map?: google.maps.Map | null; /** - * The <div> in which to display the directions steps. + * The ordered sequence of coordinates of the Polyline. This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs. Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing LatLngs in the MVCArray will automatically update the polyline on the map. */ - panel?: HTMLElement | null; - /** - * Options for the polylines. All polylines rendered by the DirectionsRenderer will use these options. - */ - polylineOptions?: google.maps.PolylineOptions | null; - /** - * If this option is set to true or the map's center and zoom were never set, the input map is centered and zoomed to the bounding box of this set of directions. - * @defaultValue false - */ - preserveViewport?: boolean | null; - /** - * The index of the route within the DirectionsResult object. The default value is 0. - */ - routeIndex?: number | null; - /** - * Suppress the rendering of the BicyclingLayer when bicycling directions are requested. - */ - suppressBicyclingLayer?: boolean | null; - /** - * Suppress the rendering of info windows. - */ - suppressInfoWindows?: boolean | null; + path?: google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; /** - * Suppress the rendering of markers. + * The stroke color. All CSS3 colors are supported except for extended named colors. */ - suppressMarkers?: boolean | null; + strokeColor?: string | null; /** - * Suppress the rendering of polylines. + * The stroke opacity between 0.0 and 1.0. */ - suppressPolylines?: boolean | null; - } - /** - * The result of an ElevationService request, consisting of the set of elevation coordinates and their elevation values. Note that a single request may produce multiple ElevationResults. - */ - export interface ElevationResult { + strokeOpacity?: number | null; /** - * The elevation of this point on Earth, in meters above sea level. + * The stroke width in pixels. */ - elevation: number; + strokeWeight?: number | null; /** - * The location of this elevation result. + * Whether this polyline is visible on the map. + * @defaultValue true */ - location: google.maps.LatLng | null; + visible?: boolean | null; /** - * The distance, in meters, between sample points from which the elevation was interpolated. This property will be missing if the resolution is not known. Note that elevation data becomes more coarse (larger resolution values) when multiple points are passed. To obtain the most accurate elevation value for a point, it should be queried independently. + * The zIndex compared to other polys. */ - resolution: number; + zIndex?: number | null; } /** - * An elevation query sent by the ElevationService containing the path along which to return sampled data. This request defines a continuous path along the earth along which elevation samples should be taken at evenly-spaced distances. All paths from vertex to vertex use segments of the great circle between those two points. + * This object is returned from mouse events on polylines and polygons. */ - export interface PathElevationRequest { + export interface PolyMouseEvent extends google.maps.MapMouseEvent { /** - * The path along which to collect elevation values. + * The index of the edge within the path beneath the cursor when the event occurred, if the event occurred on a mid-point on an editable polygon. */ - path?: (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; + edge?: number; /** - * Required. The number of equidistant points along the given path for which to retrieve elevation data, including the endpoints. The number of samples must be a value between 2 and 512 inclusive. + * The index of the path beneath the cursor when the event occurred, if the event occurred on a vertex and the polygon is editable. Otherwise undefined. */ - samples: number; - } - /** - * An elevation response returned by the {@link google.maps.ElevationService} containing the list of {@link google.maps.ElevationResult}s evenly-spaced along the path of the {@link google.maps.PathElevationRequest}. - */ - export interface PathElevationResponse { + path?: number; /** - * The list of {@link google.maps.ElevationResult}s matching the samples of the {@link google.maps.PathElevationRequest}. + * The index of the vertex beneath the cursor when the event occurred, if the event occurred on a vertex and the polyline or polygon is editable. If the event does not occur on a vertex, the value is undefined. */ - results: google.maps.ElevationResult[]; + vertex?: number; } /** - * An elevation request sent by the ElevationService containing the list of discrete coordinates (LatLngs) for which to return elevation data. + * Projection interface. */ - export interface LocationElevationRequest { + export interface Projection { /** - * The discrete locations for which to retrieve elevations. + * Translates from the LatLng cylinder to the Point plane. This interface specifies a function which implements translation from given LatLng values to world coordinates on the map projection. The Maps API calls this method when it needs to plot locations on screen. Projection objects must implement this method, but may return null if the projection cannot calculate the Point. */ - locations?: (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; - } - /** - * An elevation response returned by the {@link google.maps.ElevationService} containing the list of {@link google.maps.ElevationResult}s matching the locations of the {@link google.maps.LocationElevationRequest}. - */ - export interface LocationElevationResponse { + fromLatLngToPoint(latLng: google.maps.LatLng | google.maps.LatLngLiteral, point?: google.maps.Point): google.maps.Point | null; /** - * The list of {@link google.maps.ElevationResult}s matching the locations of the {@link google.maps.LocationElevationRequest}. + * This interface specifies a function which implements translation from world coordinates on a map projection to LatLng values. The Maps API calls this method when it needs to translate actions on screen to positions on the map. Projection objects must implement this method, but may return null if the projection cannot calculate the LatLng. */ - results: google.maps.ElevationResult[]; + fromPointToLatLng(pixel: google.maps.Point, noClampNoWrap?: boolean): google.maps.LatLng | null; } /** - * A single address component within a GeocoderResult. A full address may consist of multiple address components. + * A rectangle overlay. + * Access by calling `const {Rectangle} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface GeocoderAddressComponent { + export class Rectangle extends google.maps.MVCObject { /** - * The full text of the address component + * Create a rectangle using the passed RectangleOptions, which specify the bounds and style. + * @param opts */ - long_name: string; + constructor(opts?: google.maps.RectangleOptions | null); /** - * The abbreviated, short text of the given address component + * Returns the bounds of this rectangle. */ - short_name: string; + getBounds(): google.maps.LatLngBounds | null; /** - * An array of strings denoting the type of this address component. A list of valid types can be found here + * Returns whether this rectangle can be dragged by the user. */ - types: string[]; - } - /** - * GeocoderComponentRestrictions represents a set of filters that resolve to a specific area. For details on how this works, see Geocoding Component Filtering. - */ - export interface GeocoderComponentRestrictions { + getDraggable(): boolean; /** - * Matches all the administrative_area levels. Optional. + * Returns whether this rectangle can be edited by the user. */ - administrativeArea?: string; + getEditable(): boolean; /** - * Matches a country name or a two letter ISO 3166-1 country code. Optional. + * Returns the map on which this rectangle is displayed. */ - country?: string; + getMap(): google.maps.Map | null; /** - * Matches against both locality and sublocality types. Optional. + * Returns whether this rectangle is visible on the map. */ - locality?: string; + getVisible(): boolean; /** - * Matches postal_code and postal_code_prefix. Optional. + * Sets the bounds of this rectangle. */ - postalCode?: string; + setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): void; /** - * Matches the long or short name of a route. Optional. + * If set to true, the user can drag this rectangle over the map. */ - route?: string; - } - /** - * A Geocoder response returned by the {@link google.maps.Geocoder} containing the list of {@link google.maps.GeocoderResult}s. - */ - export interface GeocoderResponse { + setDraggable(draggable: boolean): void; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A relational description of a location. Includes a ranked set of nearby landmarks and the areas containing the target location. It is only populated for reverse geocoding requests and only when {@link google.maps.ExtraGeocodeComputation.ADDRESS_DESCRIPTORS} is enabled. + * If set to true, the user can edit this rectangle by dragging the control points shown at the corners and on each edge. */ - address_descriptor?: google.maps.AddressDescriptor | null; + setEditable(editable: boolean): void; /** - * The plus code associated with the location. + * Renders the rectangle on the specified map. If map is set to null, the rectangle will be removed. */ - plus_code?: google.maps.places.PlacePlusCode | null; + setMap(map: google.maps.Map | null): void; + + setOptions(options: google.maps.RectangleOptions | null): void; /** - * The list of {@link google.maps.GeocoderResult}s. + * Hides this rectangle if set to false. */ - results: google.maps.GeocoderResult[]; + setVisible(visible: boolean): void; } /** - * A single geocoder result retrieved from the geocode server. A geocode request may return multiple result objects. Note that though this result is "JSON-like," it is not strictly JSON, as it indirectly includes a LatLng object. + * RectangleOptions object used to define the properties that can be set on a Rectangle. */ - export interface GeocoderResult { + export interface RectangleOptions { /** - * An array of GeocoderAddressComponents + * The bounds. */ - address_components: google.maps.GeocoderAddressComponent[]; + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A relational description of the location associated with this geocode. Includes a ranked set of nearby landmarks and the areas containing the target location. This will only be populated for forward geocoding and place ID lookup requests, only when {@link google.maps.ExtraGeocodeComputation.ADDRESS_DESCRIPTORS} is enabled, and only for certain localized places. + * Indicates whether this Rectangle handles mouse events. + * @defaultValue true */ - address_descriptor?: google.maps.AddressDescriptor; + clickable?: boolean | null; /** - * A string containing the human-readable address of this location. + * If set to true, the user can drag this rectangle over the map. + * @defaultValue false */ - formatted_address: string; + draggable?: boolean | null; /** - * A GeocoderGeometry object + * If set to true, the user can edit this rectangle by dragging the control points shown at the corners and on each edge. + * @defaultValue false */ - geometry: google.maps.GeocoderGeometry; + editable?: boolean | null; /** - * Whether the geocoder did not return an exact match for the original request, though it was able to match part of the requested address. If an exact match, the value will be undefined. + * The fill color. All CSS3 colors are supported except for extended named colors. */ - partial_match?: boolean; + fillColor?: string | null; /** - * The place ID associated with the location. Place IDs uniquely identify a place in the Google Places database and on Google Maps. Learn more about Place IDs in the Places API developer guide. + * The fill opacity between 0.0 and 1.0 */ - place_id: string; + fillOpacity?: number | null; /** - * The plus code associated with the location. + * Map on which to display Rectangle. */ - plus_code?: google.maps.places.PlacePlusCode; + map?: google.maps.Map | null; /** - * An array of strings denoting all the localities contained in a postal code. This is only present when the result is a postal code that contains multiple localities. + * The stroke color. All CSS3 colors are supported except for extended named colors. */ - postcode_localities?: string[]; + strokeColor?: string | null; /** - * An array of strings denoting the type of the returned geocoded element. For a list of possible strings, refer to the Address Component Types section of the Developer's Guide. + * The stroke opacity between 0.0 and 1.0 */ - types: string[]; - } - /** - * Geometry information about this GeocoderResult - */ - export interface GeocoderGeometry { + strokeOpacity?: number | null; /** - * The precise bounds of this GeocoderResult, if applicable + * The stroke position. + * @defaultValue {@link google.maps.StrokePosition.CENTER} */ - bounds?: google.maps.LatLngBounds; + strokePosition?: google.maps.StrokePosition | null; /** - * The latitude/longitude coordinates of this result + * The stroke width in pixels. */ - location: google.maps.LatLng; + strokeWeight?: number | null; /** - * The type of location returned in location + * Whether this rectangle is visible on the map. + * @defaultValue true */ - location_type: google.maps.GeocoderLocationTypeString; + visible?: boolean | null; /** - * The bounds of the recommended viewport for displaying this GeocoderResult + * The zIndex compared to other polys. */ - viewport: google.maps.LatLngBounds; + zIndex?: number | null; } /** - * Object literals are accepted in place of LatLngBounds objects throughout the API. These are automatically converted to LatLngBounds objects. All south, west, north and east must be set, otherwise an exception is thrown. + * + * Access by calling `const {RenderingType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface LatLngBoundsLiteral { - /** - * East longitude in degrees. Values outside the range [-180, 180] will be wrapped to the range [-180, 180). For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. - */ - east: number; + export enum RenderingType { /** - * North latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. + * Indicates that the map is a raster map. */ - north: number; + RASTER = 'RASTER', /** - * South latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. + * Indicates that it is unknown yet whether the map is vector or raster, because the map has not finished initializing yet. */ - south: number; + UNINITIALIZED = 'UNINITIALIZED', /** - * West longitude in degrees. Values outside the range [-180, 180] will be wrapped to the range [-180, 180). For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. + * Indicates that the map is a vector map. */ - west: number; + VECTOR = 'VECTOR', } + export type RenderingTypeString = `${google.maps.RenderingType}`; /** - * Contains the four points defining the four-sided polygon that is the visible region of the map. On a vector map this polygon can be a trapezoid instead of a rectangle, when a vector map has tilt. + * Options for the rendering of the rotate control. */ - export interface VisibleRegion { - - farLeft: google.maps.LatLng; - - farRight: google.maps.LatLng; + export interface RotateControlOptions { /** - * The smallest bounding box that includes the visible region. + * Position id. Used to specify the position of the control on the map. + * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} */ - latLngBounds: google.maps.LatLngBounds; + position?: google.maps.ControlPosition | null; + } - nearLeft: google.maps.LatLng; + export interface RoutesLibrary { - nearRight: google.maps.LatLng; - } - /** - * InfoWindowOptions object used to define the properties that can be set on a InfoWindow. - */ - export interface InfoWindowOptions { - /** - * AriaLabel to assign to the InfoWindow. - */ - ariaLabel?: string | null; - /** - * Content to display in the InfoWindow. This can be an HTML element, a plain-text string, or a string containing HTML. The InfoWindow will be sized according to the content. To set an explicit size for the content, set content to be a HTML element with that size. - */ - content?: string | Element | Text | null; - /** - * Disable panning the map to make the InfoWindow fully visible when it opens. - * @defaultValue false - */ - disableAutoPan?: boolean | null; - /** - * The content to display in the InfoWindow header row. This can be an HTML element, or a string of plain text. The InfoWindow will be sized according to the content. To set an explicit size for the header content, set headerContent to be a HTML element with that size. - */ - headerContent?: string | Element | Text | null; - /** - * Disables the whole header row in the InfoWindow. When set to true, the header will be removed so that the header content and the close button will be hidden. - */ - headerDisabled?: boolean | null; - /** - * Maximum width of the InfoWindow, regardless of content's width. This value is only considered if it is set before a call to open(). To change the maximum width when changing content, call close(), setOptions(), and then open(). - */ - maxWidth?: number | null; - /** - * Minimum width of the InfoWindow, regardless of the content's width. When using this property, it is strongly recommended to set the minWidth to a value less than the width of the map (in pixels). This value is only considered if it is set before a call to open(). To change the minimum width when changing content, call close(), setOptions(), and then open(). - */ - minWidth?: number | null; - /** - * The offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored. If an InfoWindow is opened with an anchor, the pixelOffset will be calculated from the anchor's anchorPoint property. - */ - pixelOffset?: google.maps.Size | null; - /** - * The LatLng at which to display this InfoWindow. If the InfoWindow is opened with an anchor, the anchor's position will be used instead. - */ - position?: google.maps.LatLng | google.maps.LatLngLiteral | null; + ComputeRouteMatrixExtraComputation: typeof google.maps.routes.ComputeRouteMatrixExtraComputation; + + ComputeRoutesExtraComputation: typeof google.maps.routes.ComputeRoutesExtraComputation; + + DirectionalLocation: typeof google.maps.routes.DirectionalLocation; + + DirectionsRenderer: typeof google.maps.DirectionsRenderer; + + DirectionsService: typeof google.maps.DirectionsService; + + DirectionsStatus: typeof google.maps.DirectionsStatus; + + DistanceMatrixElementStatus: typeof google.maps.DistanceMatrixElementStatus; + + DistanceMatrixService: typeof google.maps.DistanceMatrixService; + + DistanceMatrixStatus: typeof google.maps.DistanceMatrixStatus; + + FallbackInfo: typeof google.maps.routes.FallbackInfo; + + FallbackReason: typeof google.maps.routes.FallbackReason; + + FallbackRoutingMode: typeof google.maps.routes.FallbackRoutingMode; + + GeocodedWaypoint: typeof google.maps.routes.GeocodedWaypoint; + + GeocodingResults: typeof google.maps.routes.GeocodingResults; + + MultiModalSegment: typeof google.maps.routes.MultiModalSegment; + + PolylineDetailInfo: typeof google.maps.routes.PolylineDetailInfo; + + PolylineDetails: typeof google.maps.routes.PolylineDetails; + + PolylineQuality: typeof google.maps.routes.PolylineQuality; + + ReferenceRoute: typeof google.maps.routes.ReferenceRoute; + + RoadFeatureState: typeof google.maps.routes.RoadFeatureState; + + Route: typeof google.maps.routes.Route; /** - * All InfoWindows are displayed on the map in order of their zIndex, with higher values displaying in front of InfoWindows with lower values. By default, InfoWindows are displayed according to their latitude, with InfoWindows of lower latitudes appearing in front of InfoWindows at higher latitudes. InfoWindows are always displayed in front of markers. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. */ - zIndex?: number | null; - } + Route3DElement: typeof google.maps.routes.Route3DElement; - export interface JourneySharingLibrary { + RouteLabel: typeof google.maps.routes.RouteLabel; - AutomaticViewportMode: typeof google.maps.journeySharing.AutomaticViewportMode; + RouteLeg: typeof google.maps.routes.RouteLeg; - DeliveryVehicleStopState: typeof google.maps.journeySharing.DeliveryVehicleStopState; + RouteLegLocalizedValues: typeof google.maps.routes.RouteLegLocalizedValues; - FleetEngineDeliveryFleetLocationProvider: typeof google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider; + RouteLegStep: typeof google.maps.routes.RouteLegStep; - FleetEngineDeliveryVehicleLocationProvider: typeof google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider; + RouteLegStepLocalizedValues: typeof google.maps.routes.RouteLegStepLocalizedValues; - FleetEngineFleetLocationProvider: typeof google.maps.journeySharing.FleetEngineFleetLocationProvider; + RouteLegTravelAdvisory: typeof google.maps.routes.RouteLegTravelAdvisory; - FleetEngineServiceType: typeof google.maps.journeySharing.FleetEngineServiceType; + RouteLocalizedValues: typeof google.maps.routes.RouteLocalizedValues; - FleetEngineShipmentLocationProvider: typeof google.maps.journeySharing.FleetEngineShipmentLocationProvider; + RouteMatrix: typeof google.maps.routes.RouteMatrix; - FleetEngineTripLocationProvider: typeof google.maps.journeySharing.FleetEngineTripLocationProvider; + RouteMatrixItem: typeof google.maps.routes.RouteMatrixItem; - FleetEngineVehicleLocationProvider: typeof google.maps.journeySharing.FleetEngineVehicleLocationProvider; + RouteMatrixItemCondition: typeof google.maps.routes.RouteMatrixItemCondition; - JourneySharingMapView: typeof google.maps.journeySharing.JourneySharingMapView; + RouteMatrixItemError: typeof google.maps.routes.RouteMatrixItemError; - Speed: typeof google.maps.journeySharing.Speed; + RouteMatrixItemLocalizedValues: typeof google.maps.routes.RouteMatrixItemLocalizedValues; - TripType: typeof google.maps.journeySharing.TripType; + RouteMatrixRow: typeof google.maps.routes.RouteMatrixRow; - VehicleNavigationStatus: typeof google.maps.journeySharing.VehicleNavigationStatus; + RouteTravelAdvisory: typeof google.maps.routes.RouteTravelAdvisory; - VehicleState: typeof google.maps.journeySharing.VehicleState; + RoutingPreference: typeof google.maps.routes.RoutingPreference; - VehicleType: typeof google.maps.journeySharing.VehicleType; + Speed: typeof google.maps.routes.Speed; - WaypointType: typeof google.maps.journeySharing.WaypointType; + SpeedReadingInterval: typeof google.maps.routes.SpeedReadingInterval; + + StepsOverview: typeof google.maps.routes.StepsOverview; + + TollInfo: typeof google.maps.routes.TollInfo; + + TrafficModel: typeof google.maps.TrafficModel; + + TransitAgency: typeof google.maps.routes.TransitAgency; + + TransitDetails: typeof google.maps.routes.TransitDetails; + + TransitLine: typeof google.maps.routes.TransitLine; + + TransitMode: typeof google.maps.TransitMode; + + TransitRoutePreference: typeof google.maps.TransitRoutePreference; + + TransitStop: typeof google.maps.routes.TransitStop; + + TransitVehicle: typeof google.maps.routes.TransitVehicle; + + TravelMode: typeof google.maps.TravelMode; + + VehicleEmissionType: typeof google.maps.routes.VehicleEmissionType; + + VehicleType: typeof google.maps.VehicleType; } /** - * This object defines the properties that can be set on a GroundOverlay object. + * The status returned by a web service. See https://grpc.github.io/grpc/core/md_doc_statuscodes.html. + * + * Access by calling `const {RPCStatus} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface GroundOverlayOptions { + export enum RPCStatus { /** - * If true, the ground overlay can receive mouse events. + * The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. */ - clickable?: boolean | null; + ABORTED = 'ABORTED', /** - * The map on which to display the overlay. + * The entity that a client attempted to create (e.g., file or directory) already exists. */ - map?: google.maps.Map | null; + ALREADY_EXISTS = 'ALREADY_EXISTS', /** - * The opacity of the overlay, expressed as a number between 0 and 1. Optional. - * @defaultValue 1.0 + * The operation was cancelled, typically by the caller. */ - opacity?: number | null; - } - /** - * Contains details of the author of a KML document or feature. - */ - export interface KmlAuthor { + CANCELLED = 'CANCELLED', /** - * The author's e-mail address, or an empty string if not specified. + * Unrecoverable data loss or corruption. */ - email: string; + DATA_LOSS = 'DATA_LOSS', /** - * The author's name, or an empty string if not specified. + * The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long. */ - name: string; + DEADLINE_EXCEEDED = 'DEADLINE_EXCEEDED', /** - * The author's home page, or an empty string if not specified. + * The operation was rejected because the system is not in a state required for the operation's execution. */ - uri: string; - } - /** - * Data for a single KML feature in JSON format, returned when a KML feature is clicked. The data contained in this object mirrors that associated with the feature in the KML or GeoRSS markup in which it is declared. - */ - export interface KmlFeatureData { + FAILED_PRECONDITION = 'FAILED_PRECONDITION', /** - * The feature's <atom:author>, extracted from the layer markup (if specified). + * Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. */ - author: google.maps.KmlAuthor; + INTERNAL = 'INTERNAL', /** - * The feature's <description>, extracted from the layer markup. + * The client specified an invalid argument. Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). */ - description: string; + INVALID_ARGUMENT = 'INVALID_ARGUMENT', /** - * The feature's <id>, extracted from the layer markup. If no <id> has been specified, a unique ID will be generated for this feature. + * Some requested entity (e.g., file or directory) was not found. */ - id: string; + NOT_FOUND = 'NOT_FOUND', /** - * The feature's balloon styled text, if set. + * Not an error; returned on success. */ - infoWindowHtml: string; + OK = 'OK', /** - * The feature's <name>, extracted from the layer markup. + * The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate INVALID_ARGUMENT if asked to read at an offset that is not in the range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from an offset past the current file size. */ - name: string; + OUT_OF_RANGE = 'OUT_OF_RANGE', /** - * The feature's <Snippet>, extracted from the layer markup. + * The caller does not have permission to execute the specified operation. This error code does not imply the request is valid or the requested entity exists or satisfies other pre-conditions. */ - snippet: string; - } - /** - * Metadata for a single KML layer, in JSON format. - */ - export interface KmlLayerMetadata { + PERMISSION_DENIED = 'PERMISSION_DENIED', /** - * The layer's <atom:author>, extracted from the layer markup. + * Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. */ - author: google.maps.KmlAuthor | null; + RESOURCE_EXHAUSTED = 'RESOURCE_EXHAUSTED', /** - * The layer's <description>, extracted from the layer markup. + * The request does not have valid authentication credentials for the operation. */ - description: string; + UNAUTHENTICATED = 'UNAUTHENTICATED', /** - * Whether the layer has any screen overlays. + * The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. */ - hasScreenOverlays: boolean; + UNAVAILABLE = 'UNAVAILABLE', /** - * The layer's <name>, extracted from the layer markup. + * Operation is not implemented or not supported/enabled in this service. */ - name: string; + UNIMPLEMENTED = 'UNIMPLEMENTED', /** - * The layer's <Snippet>, extracted from the layer markup + * Unknown error. For example, this error may be returned when a status received from another address space belongs to an error space that is not known in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error. */ - snippet: string; + UNKNOWN = 'UNKNOWN', } + export type RPCStatusString = `${google.maps.RPCStatus}`; /** - * This object defines the properties that can be set on a KmlLayer object. + * Options for the rendering of the scale control. */ - export interface KmlLayerOptions { + export interface ScaleControlOptions { /** - * If true, the layer receives mouse events. - * @defaultValue true + * Style id. Used to select what style of scale control to display. */ - clickable?: boolean | null; + style?: google.maps.ScaleControlStyle | null; + } + /** + * Identifiers for scale control ids. + */ + export enum ScaleControlStyle { /** - * The map on which to display the layer. + * The standard scale control. */ - map?: google.maps.Map | null; + DEFAULT = 0, + } + /** + * Settings which control the behavior of the Maps JavaScript API as a whole. + * Access by calling `const {Settings} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Settings { /** - * If this option is set to true or if the map's center and zoom were never set, the input map is centered and zoomed to the bounding box of the contents of the layer. - * @defaultValue false + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A collection of unique experience IDs to which to attribute Maps JS API calls. The returned value is a copy of the internal value that is stored in the Settings class singleton instance. Operations on google.maps.Settings.getInstance().experienceIds will therefore only modify the copy and not the internal value.

To update the internal value, set the property equal to the new value on the singleton instance (ex: google.maps.Settings.getInstance().experienceIds = [experienceId];). */ - preserveViewport?: boolean | null; + get experienceIds(): Iterable; /** - * Whether to render the screen overlays. - * @defaultValue true + * Set this property to a function that returns a promise which resolves to a Firebase App Check token result. */ - screenOverlays?: boolean | null; + fetchAppCheckToken: () => Promise; /** - * Suppress the rendering of info windows when layer features are clicked. + * Returns the singleton instance of google.maps.Settings. */ - suppressInfoWindows?: boolean | null; + static getInstance(): google.maps.Settings; + } + /** + * Access by calling `const {Size} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Size { /** - * The URL of the KML document to display. + * Two-dimensional size, where width is the distance on the x-axis, and height is the distance on the y-axis. + * @param width + * @param height + * @param widthUnit + * @param heightUnit */ - url?: string | null; + constructor(width: number, height: number, widthUnit?: string, heightUnit?: string); /** - * The z-index of the layer. + * The height along the y-axis, in pixels. */ - zIndex?: number | null; - } - /** - * The properties of a click event on a KML/KMZ or GeoRSS document. - */ - export interface KmlMouseEvent { + height: number; /** - * A KmlFeatureData object, containing information about the clicked feature. + * The width along the x-axis, in pixels. */ - featureData: google.maps.KmlFeatureData; + width: number; /** - * The position at which to anchor an infowindow on the clicked feature. + * Compares two Sizes. */ - latLng: google.maps.LatLng; + equals(other: google.maps.Size | null): boolean; /** - * The offset to apply to an infowindow anchored on the clicked feature. + * Returns a string representation of this Size. */ - pixelOffset: google.maps.Size; + toString(): string; } /** - * TrafficLayerOptions object used to define the properties that can be set on a TrafficLayer. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * An enum representing the relationship in space between the landmark and the target. + * + * Access by calling `const {SpatialRelationship} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface TrafficLayerOptions { + export enum SpatialRelationship { /** - * Whether the traffic layer refreshes with updated information automatically. - * @defaultValue true + * The target is directly opposite the landmark on the other side of the road. */ - autoRefresh?: boolean | null; + ACROSS_THE_ROAD = 'ACROSS_THE_ROAD', /** - * Map on which to display the traffic layer. + * Not on the same route as the landmark but a single turn away. */ - map?: google.maps.Map | null; - } - /** - * Used for retrieving camera parameters, such as that of the GL camera used for the {@link google.maps.WebGLOverlayView}. - */ - export interface CameraParams extends google.maps.CameraOptions { - - center: google.maps.LatLng; - - heading: number; - - tilt: number; - - zoom: number; - } - - export interface Padding { + AROUND_THE_CORNER = 'AROUND_THE_CORNER', /** - * Padding for the bottom, in pixels. + * Close to the landmark's structure but further away from its access point. */ - bottom?: number; + BEHIND = 'BEHIND', /** - * Padding for the left, in pixels. + * The target is directly adjacent to the landmark. */ - left?: number; + BESIDE = 'BESIDE', /** - * Padding for the right, in pixels. + * On the same route as the landmark but not besides or across. */ - right?: number; + DOWN_THE_ROAD = 'DOWN_THE_ROAD', /** - * Padding for the top, in pixels. + * This is the default relationship when nothing more specific below applies. */ - top?: number; + NEAR = 'NEAR', + /** + * The landmark has a spatial geometry and the target is within its bounds. + */ + WITHIN = 'WITHIN', } + export type SpatialRelationshipString = `${google.maps.SpatialRelationship}`; /** - * A structure representing a Marker icon image. + * Options for the rendering of the Street View address control. */ - export interface Icon { + export interface StreetViewAddressControlOptions { /** - * The position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image. + * Position id. This id is used to specify the position of the control on the map. The default position is TOP_LEFT. */ - anchor?: google.maps.Point | null; + position?: google.maps.ControlPosition | null; + } + /** + * Options for the rendering of the Street View pegman control on the map. + */ + export interface StreetViewControlOptions { /** - * The origin of the label relative to the top-left corner of the icon image, if a label is supplied by the marker. By default, the origin is located in the center point of the image. + * Position id. Used to specify the position of the control on the map. The default position is embedded within the navigation (zoom and pan) controls. If this position is empty or the same as that specified in the zoomControlOptions or panControlOptions, the Street View control will be displayed as part of the navigation controls. Otherwise, it will be displayed separately. */ - labelOrigin?: google.maps.Point | null; + position?: google.maps.ControlPosition | null; /** - * The position of the image within a sprite, if any. By default, the origin is located at the top left corner of the image (0, 0). + * Specifies the sources of panoramas to search. This allows a restriction to search for just official Google panoramas for example. Setting multiple sources will be evaluated as the intersection of those sources. Note: the {@link google.maps.StreetViewSource.OUTDOOR} source is not supported at this time. + * @defaultValue [{@link google.maps.StreetViewSource.DEFAULT}] */ - origin?: google.maps.Point | null; + sources?: Iterable | null; + } + /** + * A layer that illustrates the locations where Street View is available. + * Access by calling `const {StreetViewCoverageLayer} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class StreetViewCoverageLayer extends google.maps.MVCObject { /** - * The size of the entire image after scaling, if any. Use this property to stretch/shrink an image or a sprite. + * Creates a new instance of StreetViewCoverageLayer. */ - scaledSize?: google.maps.Size | null; + constructor(); /** - * The display size of the sprite or image. When using sprites, you must specify the sprite size. If the size is not provided, it will be set when the image loads. + * Returns the map on which this layer is displayed. */ - size?: google.maps.Size | null; + getMap(): google.maps.Map | null; /** - * The URL of the image or sprite sheet. + * Renders the layer on the specified map. If the map is set to null, the layer will be removed. */ - url: string; + setMap(map: google.maps.Map | null): undefined; + } + + export interface StreetViewLibrary { + + InfoWindow: typeof google.maps.InfoWindow; + + OverlayView: typeof google.maps.OverlayView; + + StreetViewCoverageLayer: typeof google.maps.StreetViewCoverageLayer; + + StreetViewPanorama: typeof google.maps.StreetViewPanorama; + + StreetViewPreference: typeof google.maps.StreetViewPreference; + + StreetViewService: typeof google.maps.StreetViewService; + + StreetViewSource: typeof google.maps.StreetViewSource; + + StreetViewStatus: typeof google.maps.StreetViewStatus; } /** - * MarkerOptions object used to define the properties that can be set on a Marker. - * @deprecated As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. Please see https://developers.google.com/maps/deprecations for deprecation details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide. + * A collection of references to adjacent Street View panos. */ - export interface MarkerOptions { + export interface StreetViewLink { /** - * The offset from the marker's position to the tip of an InfoWindow that has been opened with the marker as anchor. + * A localized string describing the link. */ - anchorPoint?: google.maps.Point | null; + description: string | null; /** - * Which animation to play when marker is added to a map. - * @defaultValue null + * The heading of the link. */ - animation?: google.maps.Animation | null; + heading: number | null; /** - * If true, the marker receives mouse and touch events. - * @defaultValue true + * A unique identifier for the panorama. This id is stable within a session but unstable across sessions. */ - clickable?: boolean | null; + pano: string | null; + } + /** + * A representation of a location in the Street View panorama. + */ + export interface StreetViewLocation { /** - * If false, disables cross that appears beneath the marker when dragging. - * @defaultValue true + * A localized string describing the location. */ - crossOnDrag?: boolean | null; + description?: string | null; /** - * Mouse cursor type to show on hover. - * @defaultValue pointer + * The latlng of the panorama. */ - cursor?: string | null; + latLng?: google.maps.LatLng | null; /** - * If true, the marker can be dragged. Note: Setting this to true will make the marker clickable even if clickable is set to false. - * @defaultValue false + * A unique identifier for the panorama. This is stable within a session but unstable across sessions. */ - draggable?: boolean | null; + pano: string; /** - * Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url. + * Short description of the location. */ - icon?: string | google.maps.Icon | google.maps.Symbol | null; + shortDescription?: string | null; + } + /** + * A Street View request to be sent with getPanorama. StreetViewLocationRequest lets you search for a Street View panoroma at a specified location. + */ + export interface StreetViewLocationRequest { /** - * Adds a label to the marker. A marker label is a letter or number that appears inside a marker. The label can either be a string, or a MarkerLabel object. If provided and {@link google.maps.MarkerOptions.title} is not provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided label's text. Please note that the label is currently only used for accessibility text for non-optimized markers. - * @defaultValue null + * Specifies the location where to search for a Street View panorama. */ - label?: string | google.maps.MarkerLabel | null; + location?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * Map on which to display Marker. The map is required to display the marker and can be provided with {@link google.maps.Marker.setMap} if not provided at marker construction. + * Sets a preference for which panorama should be found within the radius: the one nearest to the provided location, or the best one within the radius. */ - map?: google.maps.Map | google.maps.StreetViewPanorama | null; + preference?: google.maps.StreetViewPreferenceString | null; /** - * A number between 0.0, transparent, and 1.0, opaque. - * @defaultValue 1.0 + * Sets a radius in meters in which to search for a panorama. + * @defaultValue 50 */ - opacity?: number | null; + radius?: number | null; /** - * Optimization enhances performance by rendering many markers as a single static element. This is useful in cases where a large number of markers is required. Read more about marker optimization. Note: This optimization has no effect for markers on vector maps. + * Specifies the sources of panoramas to search. This allows a restriction to search for just outdoor panoramas for example. Setting multiple sources will be evaluated as the intersection of those sources. + * @defaultValue [{@link google.maps.StreetViewSource.DEFAULT}] */ - optimized?: boolean | null; + sources?: Iterable | null; /** - * Sets the marker position. A marker may be constructed but not displayed until its position is provided - for example, by a user's actions or choices. A marker position can be provided with {@link google.maps.Marker.setPosition} if not provided at marker construction. + * Specifies the source of panoramas to search. This allows a restriction to search for just outdoor panoramas for example. + * @defaultValue {@link google.maps.StreetViewSource.DEFAULT} + * @deprecated Use sources instead. */ - position?: google.maps.LatLng | google.maps.LatLngLiteral | null; + source?: google.maps.StreetViewSourceString | null; + } + /** + * Displays the panorama for a given LatLng or panorama ID. A StreetViewPanorama object provides a Street View "viewer" which can be stand-alone within a separate <div> or bound to a Map. + * Access by calling `const {StreetViewPanorama} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class StreetViewPanorama extends google.maps.MVCObject { /** - * Image map region definition used for drag/click. + * Creates a panorama with the passed StreetViewPanoramaOptions. + * @param container + * @param opts */ - shape?: google.maps.MarkerShape | null; + constructor(container: HTMLElement, opts?: google.maps.StreetViewPanoramaOptions | null); /** - * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided value. Please note that the title is currently only used for accessibility text for non-optimized markers. - * @defaultValue undefined - */ - title?: string | null; - /** - * If true, the marker is visible. - * @defaultValue true - */ - visible?: boolean | null; - /** - * All markers are displayed on the map in order of their zIndex, with higher values displaying in front of markers with lower values. By default, markers are displayed according to their vertical position on screen, with lower markers appearing in front of markers further up the screen. + * Additional controls to attach to the panorama. To add a control to the panorama, add the control's <div> to the MVCArray corresponding to the {@link google.maps.ControlPosition} where it should be rendered. */ - zIndex?: number | null; + controls: google.maps.MVCArray[]; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Set a collision behavior for markers on vector maps. - * @defaultValue null - * @deprecated collisionBehavior is deprecated as of July 2023. Use {@link google.maps.marker.AdvancedMarkerElement.collisionBehavior} instead. + * Sets focus on this StreetViewPanorama. You may wish to consider using this method along with a visible_changed event to make sure that StreetViewPanorama is visible before setting focus on it. A StreetViewPanorama that is not visible cannot be focused. */ - collisionBehavior?: string | google.maps.CollisionBehaviorString | null; - } - /** - * This object defines the clickable region of a marker image. The shape consists of two properties — type and coord — which define the non-transparent region of an image. - */ - export interface MarkerShape { + focus(): void; /** - * The format of this attribute depends on the value of the type and follows the w3 AREA coords specification found at http://www.w3.org/TR/REC-html40/struct/objects.html#adef-coords.
The coords attribute is an array of integers that specify the pixel position of the shape relative to the top-left corner of the target image. The coordinates depend on the value of type as follows:
  - circle: coords is [x1,y1,r] where x1,y2 are the coordinates of the center of the circle, and r is the radius of the circle.
  - poly: coords is [x1,y1,x2,y2...xn,yn] where each x,y pair contains the coordinates of one vertex of the polygon.
  - rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. + * Returns the set of navigation links for the Street View panorama. */ - coords: number[] | null; + getLinks(): (google.maps.StreetViewLink | null)[] | null; /** - * Describes the shape's type and can be circle, poly or rect. + * Returns the StreetViewLocation of the current panorama. */ - type: string; - } - /** - * These options specify the appearance of a marker label. A marker label is a string (often a single character) which will appear inside the marker. If you are using it with a custom marker, you can reposition it with the labelOrigin property in the Icon class. - */ - export interface MarkerLabel { + getLocation(): google.maps.StreetViewLocation; /** - * The className property of the label's element (equivalent to the element's class attribute). Multiple space-separated CSS classes can be added. The font color, size, weight, and family can only be set via the other properties of MarkerLabel. CSS classes should not be used to change the position nor orientation of the label (e.g. using translations and rotations) if also using marker collision management. - * @defaultValue '' (empty string) + * Returns the state of motion tracker. If true when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements. */ - className?: string; + getMotionTracking(): boolean; /** - * The color of the label text. - * @defaultValue 'black' + * Returns the current panorama ID for the Street View panorama. This id is stable within the browser's current session only. */ - color?: string; + getPano(): string; /** - * The font family of the label text (equivalent to the CSS font-family property). + * Returns the heading and pitch of the photographer when this panorama was taken. For Street View panoramas on the road, this also reveals in which direction the car was travelling. This data is available after the pano_changed event. */ - fontFamily?: string; + getPhotographerPov(): google.maps.StreetViewPov; /** - * The font size of the label text (equivalent to the CSS font-size property). - * @defaultValue '14px' + * Returns the current LatLng position for the Street View panorama. */ - fontSize?: string; + getPosition(): google.maps.LatLng | null; /** - * The font weight of the label text (equivalent to the CSS font-weight property). + * Returns the current point of view for the Street View panorama. */ - fontWeight?: string; + getPov(): google.maps.StreetViewPov; /** - * The text to be displayed in the label. + * Returns the status of the panorama on completion of the setPosition() or setPano() request. */ - text: string; - } - /** - * A MaxZoom result in JSON format retrieved from the MaxZoomService. - */ - export interface MaxZoomResult { + getStatus(): google.maps.StreetViewStatusString; /** - * Status of the request. This property is only defined when using callbacks with {@link google.maps.MaxZoomService.getMaxZoomAtLatLng} (it is not defined when using Promises). + * Returns true if the panorama is visible. It does not specify whether Street View imagery is available at the specified position. */ - status: google.maps.MaxZoomStatusString | null; + getVisible(): boolean; /** - * The maximum zoom level found at the given LatLng. + * Returns the zoom level of the panorama. Fully zoomed-out is level 0, where the field of view is 180 degrees. Zooming in increases the zoom level. */ - zoom: number; - } - /** - * CircleOptions object used to define the properties that can be set on a Circle. - */ - export interface CircleOptions { + getZoom(): number; /** - * The center of the Circle. + * Set the custom panorama provider called on pano change to load custom panoramas. */ - center?: google.maps.LatLng | google.maps.LatLngLiteral | null; + registerPanoProvider(provider: (arg0: string) => (google.maps.StreetViewPanoramaData | null), opt_options?: google.maps.PanoProviderOptions): void; /** - * Indicates whether this Circle handles mouse events. - * @defaultValue true + * Sets the set of navigation links for the Street View panorama. */ - clickable?: boolean | null; + setLinks(links: google.maps.StreetViewLink[]): void; /** - * If set to true, the user can drag this circle over the map. - * @defaultValue false + * Sets the state of motion tracker. If true when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements. */ - draggable?: boolean | null; + setMotionTracking(motionTracking: boolean): void; /** - * If set to true, the user can edit this circle by dragging the control points shown at the center and around the circumference of the circle. - * @defaultValue false + * Sets a collection of key-value pairs. */ - editable?: boolean | null; + setOptions(options: google.maps.StreetViewPanoramaOptions | null): void; /** - * The fill color. All CSS3 colors are supported except for extended named colors. + * Sets the current panorama ID for the Street View panorama. */ - fillColor?: string | null; + setPano(pano: string): void; /** - * The fill opacity between 0.0 and 1.0. + * Sets the current LatLng position for the Street View panorama. */ - fillOpacity?: number | null; + setPosition(latLng: google.maps.LatLng | google.maps.LatLngLiteral | null): void; /** - * Map on which to display the Circle. + * Sets the point of view for the Street View panorama. */ - map?: google.maps.Map | null; + setPov(pov: google.maps.StreetViewPov): void; /** - * The radius in meters on the Earth's surface. + * Sets to true to make the panorama visible. If set to false, the panorama will be hidden whether it is embedded in the map or in its own <div>. */ - radius?: number | null; + setVisible(flag: boolean): void; /** - * The stroke color. All CSS3 colors are supported except for extended named colors. + * Sets the zoom level of the panorama. Fully zoomed-out is level 0, where the field of view is 180 degrees. Zooming in increases the zoom level. */ - strokeColor?: string | null; + setZoom(zoom: number): void; + } + /** + * The representation of a panorama returned from the provider defined using registerPanoProvider. + */ + export interface StreetViewPanoramaData { /** - * The stroke opacity between 0.0 and 1.0. + * Specifies the copyright text for this panorama. */ - strokeOpacity?: number | null; + copyright?: string; /** - * The stroke position. - * @defaultValue {@link google.maps.StrokePosition.CENTER} + * Specifies the year and month in which the imagery in this panorama was acquired. The date string is in the form YYYY-MM. */ - strokePosition?: google.maps.StrokePosition | null; + imageDate?: string; /** - * The stroke width in pixels. + * Specifies the navigational links to adjacent panoramas. */ - strokeWeight?: number | null; + links?: google.maps.StreetViewLink[]; /** - * Whether this circle is visible on the map. - * @defaultValue true + * Specifies the location meta-data for this panorama. */ - visible?: boolean | null; + location?: google.maps.StreetViewLocation; /** - * The zIndex compared to other polys. + * Specifies the custom tiles for this panorama. */ - zIndex?: number | null; + tiles: google.maps.StreetViewTileData; } /** - * Describes how icons are to be rendered on a line.

If your polyline is geodesic, then the distances specified for both offset and repeat are calculated in meters by default. Setting either offset or repeat to a pixel value will cause the distances to be calculated in pixels on the screen. + * Options defining the properties of a StreetViewPanorama object. */ - export interface IconSequence { + export interface StreetViewPanoramaOptions { /** - * If true, each icon in the sequence has the same fixed rotation regardless of the angle of the edge on which it lies. If false, case each icon in the sequence is rotated to align with its edge. - * @defaultValue false + * The enabled/disabled state of the address control. */ - fixedRotation?: boolean; + addressControl?: boolean | null; /** - * The icon to render on the line. + * The display options for the address control. */ - icon?: google.maps.Symbol | null; + addressControlOptions?: google.maps.StreetViewAddressControlOptions | null; /** - * The distance from the start of the line at which an icon is to be rendered. This distance may be expressed as a percentage of line's length (e.g. '50%') or in pixels (e.g. '50px'). - * @defaultValue '100%' + * The enabled/disabled state of click-to-go. Not applicable to custom panoramas. + * @defaultValue true */ - offset?: string; + clickToGo?: boolean | null; /** - * The distance between consecutive icons on the line. This distance may be expressed as a percentage of the line's length (e.g. '50%') or in pixels (e.g. '50px'). To disable repeating of the icon, specify '0'. - * @defaultValue 0 + * Size in pixels of the controls appearing on the panorama. This value must be supplied directly when creating the Panorama, updating this value later may bring the controls into an undefined state. Only governs the controls made by the Maps API itself. Does not scale developer created custom controls. */ - repeat?: string; - } - /** - * This object is returned from mouse events on polylines and polygons. - */ - export interface PolyMouseEvent extends google.maps.MapMouseEvent { + controlSize?: number | null; /** - * The index of the edge within the path beneath the cursor when the event occurred, if the event occurred on a mid-point on an editable polygon. + * Enables/disables all default UI. May be overridden individually. */ - edge?: number; + disableDefaultUI?: boolean | null; /** - * The index of the path beneath the cursor when the event occurred, if the event occurred on a vertex and the polygon is editable. Otherwise undefined. + * Enables/disables zoom on double click. + * @defaultValue true */ - path?: number; + disableDoubleClickZoom?: boolean | null; /** - * The index of the vertex beneath the cursor when the event occurred, if the event occurred on a vertex and the polyline or polygon is editable. If the event does not occur on a vertex, the value is undefined. + * If true, the close button is displayed. + * @defaultValue false */ - vertex?: number; - } - /** - * PolygonOptions object used to define the properties that can be set on a Polygon. - */ - export interface PolygonOptions { + enableCloseButton?: boolean | null; /** - * Indicates whether this Polygon handles mouse events. - * @defaultValue true + * The enabled/disabled state of the fullscreen control. */ - clickable?: boolean | null; + fullscreenControl?: boolean | null; /** - * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. - * @defaultValue false + * The display options for the fullscreen control. */ - draggable?: boolean | null; + fullscreenControlOptions?: google.maps.FullscreenControlOptions | null; /** - * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. - * @defaultValue false + * The enabled/disabled state of the imagery acquisition date control. Disabled by default. */ - editable?: boolean | null; + imageDateControl?: boolean | null; /** - * The fill color. All CSS3 colors are supported except for extended named colors. + * The enabled/disabled state of the links control. */ - fillColor?: string | null; + linksControl?: boolean | null; /** - * The fill opacity between 0.0 and 1.0 + * Whether motion tracking is on or off. Enabled by default when the motion tracking control is present and permission is granted by a user or not required, so that the POV (point of view) follows the orientation of the device. This is primarily applicable to mobile devices. If motionTracking is set to false while motionTrackingControl is enabled, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to toggle this option. If motionTracking is set to true while permission is required but not yet requested, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to request permission. If motionTracking is set to true while permission is denied by a user, the motion tracking control appears disabled with tracking turned off. */ - fillOpacity?: number | null; + motionTracking?: boolean | null; /** - * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. Note that the shape of a geodesic polygon may appear to change when dragged, as the dimensions are maintained relative to the surface of the earth. - * @defaultValue false + * The enabled/disabled state of the motion tracking control. Enabled by default when the device has motion data, so that the control appears on the map. This is primarily applicable to mobile devices. */ - geodesic?: boolean | null; + motionTrackingControl?: boolean | null; /** - * Map on which to display Polygon. + * The display options for the motion tracking control. */ - map?: google.maps.Map | null; + motionTrackingControlOptions?: google.maps.MotionTrackingControlOptions | null; /** - * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths. As a result, the paths property may specify one or more arrays of LatLng coordinates. Paths are closed automatically; do not repeat the first vertex of the path as the last vertex. Simple polygons may be defined using a single array of LatLngs. More complex polygons may specify an array of arrays. Any simple arrays are converted into MVCArrays. Inserting or removing LatLngs from the MVCArray will automatically update the polygon on the map. + * The enabled/disabled state of the pan control. */ - paths?: google.maps.MVCArray> | google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[][] | (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; + panControl?: boolean | null; /** - * The stroke color. All CSS3 colors are supported except for extended named colors. + * The display options for the pan control. */ - strokeColor?: string | null; + panControlOptions?: google.maps.PanControlOptions | null; /** - * The stroke opacity between 0.0 and 1.0 + * The panorama ID, which should be set when specifying a custom panorama. */ - strokeOpacity?: number | null; + pano?: string | null; /** - * The stroke position. - * @defaultValue {@link google.maps.StrokePosition.CENTER} + * The LatLng position of the Street View panorama. */ - strokePosition?: google.maps.StrokePosition | null; + position?: google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * The stroke width in pixels. + * The camera orientation, specified as heading and pitch, for the panorama. */ - strokeWeight?: number | null; + pov?: google.maps.StreetViewPov | null; /** - * Whether this polygon is visible on the map. + * If false, disables scrollwheel zooming in Street View. * @defaultValue true */ - visible?: boolean | null; + scrollwheel?: boolean | null; /** - * The zIndex compared to other polys. + * The display of street names on the panorama. If this value is not specified, or is set to true, street names are displayed on the panorama. If set to false, street names are not displayed. + * @defaultValue true */ - zIndex?: number | null; - } - /** - * PolylineOptions object used to define the properties that can be set on a Polyline. - */ - export interface PolylineOptions { + showRoadLabels?: boolean | null; /** - * Indicates whether this Polyline handles mouse events. - * @defaultValue true + * If true, the Street View panorama is visible on load. */ - clickable?: boolean | null; + visible?: boolean | null; /** - * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging. - * @defaultValue false + * The zoom of the panorama, specified as a number. A zoom of 0 gives a 180 degrees Field of View. */ - draggable?: boolean | null; + zoom?: number | null; /** - * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment. - * @defaultValue false + * The enabled/disabled state of the zoom control. */ - editable?: boolean | null; + zoomControl?: boolean | null; /** - * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. Note that the shape of a geodesic polygon may appear to change when dragged, as the dimensions are maintained relative to the surface of the earth. - * @defaultValue false + * The display options for the zoom control. */ - geodesic?: boolean | null; + zoomControlOptions?: google.maps.ZoomControlOptions | null; + } + /** + * A StreetViewPanoRequest is used with the getPanorama to find a panorama with a specified ID. + */ + export interface StreetViewPanoRequest { /** - * The icons to be rendered along the polyline. + * Specifies the pano ID to search for. */ - icons?: google.maps.IconSequence[] | null; + pano?: string | null; + } + /** + * A point of view object which specifies the camera's orientation at the Street View panorama's position. The point of view is defined as heading and pitch. + */ + export interface StreetViewPov { /** - * Map on which to display Polyline. + * The camera heading in degrees relative to true north. True north is 0°, east is 90°, south is 180°, west is 270°. */ - map?: google.maps.Map | null; + heading: number; /** - * The ordered sequence of coordinates of the Polyline. This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs. Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing LatLngs in the MVCArray will automatically update the polyline on the map. + * The camera pitch in degrees, relative to the street view vehicle. Ranges from 90° (directly upwards) to -90° (directly downwards). */ - path?: google.maps.MVCArray | (google.maps.LatLng | google.maps.LatLngLiteral)[] | null; + pitch: number; + } + /** + * Options that bias a search result towards returning a Street View panorama that is nearest to the request location, or a panorama that is considered most likely to be what the user wants to see. Specify these by value, or by using the constant's name. For example, 'best' or google.maps.StreetViewPreference.BEST. + * + * Access by calling `const {StreetViewPreference} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum StreetViewPreference { /** - * The stroke color. All CSS3 colors are supported except for extended named colors. + * Return the Street View panorama that is considered most likely to be what the user wants to see. The best result is determined by algorithms based on user research and parameters such as recognised points of interest, image quality, and distance from the given location. */ - strokeColor?: string | null; + BEST = 'best', /** - * The stroke opacity between 0.0 and 1.0. + * Return the Street View panorama that is the shortest distance from the provided location. This works well only within a limited radius. The recommended radius is 1km or less. */ - strokeOpacity?: number | null; + NEAREST = 'nearest', + } + export type StreetViewPreferenceString = `${google.maps.StreetViewPreference}`; + /** + * The response resolved for a Promise from {@link google.maps.StreetViewService.getPanorama}. + */ + export interface StreetViewResponse { /** - * The stroke width in pixels. + * The representation of a panorama. */ - strokeWeight?: number | null; + data: google.maps.StreetViewPanoramaData; + } + /** + * A StreetViewService object performs searches for Street View data. + * Access by calling `const {StreetViewService} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class StreetViewService { /** - * Whether this polyline is visible on the map. - * @defaultValue true + * Creates a StreetViewService, which provides an interface to the data stored in the Street View service. */ - visible?: boolean | null; + constructor(); /** - * The zIndex compared to other polys. + * Retrieves the StreetViewPanoramaData for a panorama that matches the supplied Street View query request. The StreetViewPanoramaData is passed to the provided callback. */ - zIndex?: number | null; + getPanorama(request: google.maps.StreetViewLocationRequest | google.maps.StreetViewPanoRequest, callback?: ((arg0: google.maps.StreetViewPanoramaData | null, arg1: google.maps.StreetViewStatusString) => void)): Promise; } /** - * RectangleOptions object used to define the properties that can be set on a Rectangle. + * Identifiers to limit Street View searches to selected sources. These values are specified as strings. For example, 'outdoor'. + * + * Access by calling `const {StreetViewSource} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface RectangleOptions { + export enum StreetViewSource { /** - * The bounds. + * Uses the default sources of Street View, searches will not be limited to specific sources. */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + DEFAULT = 'default', /** - * Indicates whether this Rectangle handles mouse events. - * @defaultValue true + * Limits Street View searches to official Google collections. */ - clickable?: boolean | null; + GOOGLE = 'google', /** - * If set to true, the user can drag this rectangle over the map. - * @defaultValue false + * Limits Street View searches to outdoor collections. Indoor collections are not included in search results. Note also that the search only returns panoramas where it's possible to determine whether they're indoors or outdoors. For example, PhotoSpheres are not returned because it's unknown whether they are indoors or outdoors. */ - draggable?: boolean | null; + OUTDOOR = 'outdoor', + } + export type StreetViewSourceString = `${google.maps.StreetViewSource}`; + /** + * The status returned by the StreetViewService on completion of a Street View request. These can be specified by value, or by using the constant's name. For example, 'OK' or google.maps.StreetViewStatus.OK. + * + * Access by calling `const {StreetViewStatus} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum StreetViewStatus { /** - * If set to true, the user can edit this rectangle by dragging the control points shown at the corners and on each edge. - * @defaultValue false + * The request was successful. */ - editable?: boolean | null; + OK = 'OK', /** - * The fill color. All CSS3 colors are supported except for extended named colors. + * The request could not be successfully processed, yet the exact reason for failure is unknown. */ - fillColor?: string | null; + UNKNOWN_ERROR = 'UNKNOWN_ERROR', /** - * The fill opacity between 0.0 and 1.0 + * There are no panoramas found that match the search criteria. */ - fillOpacity?: number | null; + ZERO_RESULTS = 'ZERO_RESULTS', + } + export type StreetViewStatusString = `${google.maps.StreetViewStatus}`; + /** + * The properties of the tile set used in a Street View panorama. + */ + export interface StreetViewTileData { /** - * Map on which to display Rectangle. + * The heading (in degrees) at the center of the panoramic tiles. */ - map?: google.maps.Map | null; + centerHeading: number; /** - * The stroke color. All CSS3 colors are supported except for extended named colors. + * The size (in pixels) at which tiles will be rendered. */ - strokeColor?: string | null; + tileSize: google.maps.Size; /** - * The stroke opacity between 0.0 and 1.0 + * The size (in pixels) of the whole panorama's "world". */ - strokeOpacity?: number | null; + worldSize: google.maps.Size; /** - * The stroke position. - * @defaultValue {@link google.maps.StrokePosition.CENTER} + * Gets the tile image URL for the specified tile.
This is a custom method which you must implement, to supply your custom tiles. The API calls this method, supplying the following parameters:
pano is the panorama ID of the Street View tile.
tileZoom is the zoom level of the tile.
tileX is the x-coordinate of the tile.
tileY is the y-coordinate of the tile.
Your custom method must return the URL for the tile image.
*/ - strokePosition?: google.maps.StrokePosition | null; + getTileUrl(pano: string, tileZoom: number, tileX: number, tileY: number): string; + } + /** + * The possible positions of the stroke on a polygon. + * + * Access by calling `const {StrokePosition} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum StrokePosition { /** - * The stroke width in pixels. + * The stroke is centered on the polygon's path, with half the stroke inside the polygon and half the stroke outside the polygon. */ - strokeWeight?: number | null; + CENTER = 0, /** - * Whether this rectangle is visible on the map. - * @defaultValue true + * The stroke lies inside the polygon. */ - visible?: boolean | null; + INSIDE = 1, /** - * The zIndex compared to other polys. + * The stroke lies outside the polygon. */ - zIndex?: number | null; + OUTSIDE = 2, } /** - * An interface representing a feature with a place ID which includes features of type {@link google.maps.FeatureType.ADMINISTRATIVE_AREA_LEVEL_1}, {@link google.maps.FeatureType.ADMINISTRATIVE_AREA_LEVEL_2}, {@link google.maps.FeatureType.COUNTRY}, {@link google.maps.FeatureType.LOCALITY}, {@link google.maps.FeatureType.POSTAL_CODE}, and {@link google.maps.FeatureType.SCHOOL_DISTRICT}. + * Creates a MapType with a custom style. + * Access by calling `const {StyledMapType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceFeature extends google.maps.Feature { - /** - * The {@link google.maps.places.PlaceResult.place_id}. - */ - placeId: string; + export class StyledMapType extends google.maps.MVCObject implements google.maps.MapType { /** - * Fetches a Place for this PlaceFeature. In the resulting Place object, the id and the displayName properties will be populated. The display name will be in the language the end user sees on the map. (Additional fields can be subsequently requested via Place.fetchFields() subject to normal Places API enablement and billing.) Do not call this from a FeatureStyleFunction since only synchronous FeatureStyleFunctions are supported. The promise is rejected if there was an error fetching the Place. + * Creates a styled MapType with the specified options. The StyledMapType takes an array of MapTypeStyles, where each MapTypeStyle is applied to the map consecutively. A later MapTypeStyle that applies the same MapTypeStylers to the same selectors as an earlier MapTypeStyle will override the earlier MapTypeStyle.

Note that the StyledMapType is not supported when a map ID is set. When using both together, you will receive a console warning. + * @param styles + * @param options */ - fetchPlace(): Promise; + constructor(styles: (google.maps.MapTypeStyle | null)[] | null, options?: google.maps.StyledMapTypeOptions | null); + + alt: string; + + maxZoom: number; + + minZoom: number; + + name: string; + + projection: google.maps.Projection | null; + + radius: number; + + tileSize: google.maps.Size | null; + + getTile(tileCoord: google.maps.Point | null, zoom: number, ownerDocument: Document | null): Element | null; + + releaseTile(tile: Element | null): void; } /** - * Options for the Custom Pano Provider. + * This class is used to specify options when creating a StyledMapType. These options cannot be changed after the StyledMapType is instantiated. */ - export interface PanoProviderOptions { + export interface StyledMapTypeOptions { /** - * If set, the renderer will use technologies (like webgl) that only work when cors headers are appropriately set on the provided images. It is the developer's task to serve the images correctly in combination with this flag, which might otherwise lead to SecurityErrors. + * Text to display when this MapType's button is hovered over in the map type control. */ - cors?: boolean; - } - /** - * A collection of references to adjacent Street View panos. - */ - export interface StreetViewLink { + alt?: string | null; /** - * A localized string describing the link. + * The maximum zoom level for the map when displaying this MapType. Optional. */ - description: string | null; + maxZoom?: number | null; /** - * The heading of the link. + * The minimum zoom level for the map when displaying this MapType. Optional. */ - heading: number | null; + minZoom?: number | null; /** - * A unique identifier for the panorama. This id is stable within a session but unstable across sessions. + * The name to display in the map type control. */ - pano: string | null; + name?: string | null; } /** - * A representation of a location in the Street View panorama. + * Describes a symbol, which consists of a vector path with styling. A symbol can be used as the icon of a marker, or placed on a polyline. */ - export interface StreetViewLocation { + export interface Symbol { /** - * A localized string describing the location. + * The position of the symbol relative to the marker or polyline. The coordinates of the symbol's path are translated left and up by the anchor's x and y coordinates respectively. The position is expressed in the same coordinate system as the symbol's path. + * @defaultValue google.maps.Point(0,0) */ - description?: string | null; + anchor?: google.maps.Point | null; /** - * The latlng of the panorama. + * The symbol's fill color. All CSS3 colors are supported except for extended named colors. For symbol markers, this defaults to 'black'. For symbols on polylines, this defaults to the stroke color of the corresponding polyline. */ - latLng?: google.maps.LatLng | null; + fillColor?: string | null; /** - * A unique identifier for the panorama. This is stable within a session but unstable across sessions. + * The symbol's fill opacity. + * @defaultValue 0 */ - pano: string; + fillOpacity?: number | null; /** - * Short description of the location. + * The origin of the label relative to the origin of the path, if label is supplied by the marker. The origin is expressed in the same coordinate system as the symbol's path. This property is unused for symbols on polylines. + * @defaultValue google.maps.Point(0,0) */ - shortDescription?: string | null; - } - /** - * A Street View request to be sent with getPanorama. StreetViewLocationRequest lets you search for a Street View panoroma at a specified location. - */ - export interface StreetViewLocationRequest { + labelOrigin?: google.maps.Point | null; /** - * Specifies the location where to search for a Street View panorama. + * The symbol's path, which is a built-in symbol path, or a custom path expressed using SVG path notation. Required. */ - location?: google.maps.LatLng | google.maps.LatLngLiteral | null; + path: google.maps.SymbolPath | string; /** - * Sets a preference for which panorama should be found within the radius: the one nearest to the provided location, or the best one within the radius. + * The angle by which to rotate the symbol, expressed clockwise in degrees. A symbol in an IconSequence where fixedRotation is false is rotated relative to the angle of the edge on which it lies. + * @defaultValue 0 */ - preference?: google.maps.StreetViewPreferenceString | null; + rotation?: number | null; /** - * Sets a radius in meters in which to search for a panorama. - * @defaultValue 50 + * The amount by which the symbol is scaled in size. For symbol markers, this defaults to 1; after scaling, the symbol may be of any size. For symbols on a polyline, this defaults to the stroke weight of the polyline; after scaling, the symbol must lie inside a square 22 pixels in size centered at the symbol's anchor. */ - radius?: number | null; + scale?: number | null; /** - * Specifies the sources of panoramas to search. This allows a restriction to search for just outdoor panoramas for example. Setting multiple sources will be evaluated as the intersection of those sources. - * @defaultValue [{@link google.maps.StreetViewSource.DEFAULT}] + * The symbol's stroke color. All CSS3 colors are supported except for extended named colors. For symbol markers, this defaults to 'black'. For symbols on a polyline, this defaults to the stroke color of the polyline. */ - sources?: Iterable | null; + strokeColor?: string | null; /** - * Specifies the source of panoramas to search. This allows a restriction to search for just outdoor panoramas for example. - * @defaultValue {@link google.maps.StreetViewSource.DEFAULT} - * @deprecated Use sources instead. + * The symbol's stroke opacity. For symbol markers, this defaults to 1. For symbols on a polyline, this defaults to the stroke opacity of the polyline. */ - source?: google.maps.StreetViewSourceString | null; - } - /** - * A StreetViewPanoRequest is used with the getPanorama to find a panorama with a specified ID. - */ - export interface StreetViewPanoRequest { + strokeOpacity?: number | null; /** - * Specifies the pano ID to search for. + * The symbol's stroke weight. + * @defaultValue The {@link google.maps.Symbol.scale} of the symbol. */ - pano?: string | null; + strokeWeight?: number | null; } /** - * The representation of a panorama returned from the provider defined using registerPanoProvider. + * Built-in symbol paths. + * + * Access by calling `const {SymbolPath} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface StreetViewPanoramaData { + export enum SymbolPath { /** - * Specifies the copyright text for this panorama. + * A backward-pointing closed arrow. */ - copyright?: string; + BACKWARD_CLOSED_ARROW = 3, /** - * Specifies the year and month in which the imagery in this panorama was acquired. The date string is in the form YYYY-MM. + * A backward-pointing open arrow. */ - imageDate?: string; + BACKWARD_OPEN_ARROW = 4, /** - * Specifies the navigational links to adjacent panoramas. + * A circle. */ - links?: google.maps.StreetViewLink[]; + CIRCLE = 0, /** - * Specifies the location meta-data for this panorama. + * A forward-pointing closed arrow. */ - location?: google.maps.StreetViewLocation; + FORWARD_CLOSED_ARROW = 1, /** - * Specifies the custom tiles for this panorama. + * A forward-pointing open arrow. */ - tiles: google.maps.StreetViewTileData; + FORWARD_OPEN_ARROW = 2, } /** - * Options for the rendering of the pan control. + * A representation of time as a Date object, a localized string, and a time zone. */ - export interface PanControlOptions { + export interface Time { /** - * Position id. Used to specify the position of the control on the map. - * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} + * A string representing the time's value. The time is displayed in the time zone of the transit stop. */ - position?: google.maps.ControlPosition | null; - } - /** - * Options for the rendering of the zoom control. - */ - export interface ZoomControlOptions { + text: string; /** - * Position id. Used to specify the position of the control on the map. - * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} + * The time zone in which this stop lies. The value is the name of the time zone as defined in the IANA Time Zone Database, e.g. "America/New_York". */ - position?: google.maps.ControlPosition | null; - } - /** - * Options for the rendering of the motion tracking control. - */ - export interface MotionTrackingControlOptions { + time_zone: string; /** - * Position id. This is used to specify the position of this control on the panorama. - * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} + * The time of this departure or arrival, specified as a JavaScript Date object. */ - position?: google.maps.ControlPosition | null; + value: Date; } /** - * Options for the rendering of the Street View address control. + * A traffic layer. + * Access by calling `const {TrafficLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface StreetViewAddressControlOptions { + export class TrafficLayer extends google.maps.MVCObject { /** - * Position id. This id is used to specify the position of the control on the map. The default position is TOP_LEFT. + * A layer that displays current road traffic. + * @param opts */ - position?: google.maps.ControlPosition | null; - } - /** - * Options defining the properties of a StreetViewPanorama object. - */ - export interface StreetViewPanoramaOptions { + constructor(opts?: google.maps.TrafficLayerOptions); /** - * The enabled/disabled state of the address control. + * Returns the map on which this layer is displayed. */ - addressControl?: boolean | null; + getMap(): google.maps.Map | null; /** - * The display options for the address control. + * Renders the layer on the specified map. If map is set to null, the layer will be removed. */ - addressControlOptions?: google.maps.StreetViewAddressControlOptions | null; + setMap(map: google.maps.Map | null): void; + + setOptions(options: google.maps.TrafficLayerOptions | null): void; + } + /** + * TrafficLayerOptions object used to define the properties that can be set on a TrafficLayer. + */ + export interface TrafficLayerOptions { /** - * The enabled/disabled state of click-to-go. Not applicable to custom panoramas. + * Whether the traffic layer refreshes with updated information automatically. * @defaultValue true */ - clickToGo?: boolean | null; + autoRefresh?: boolean | null; /** - * Size in pixels of the controls appearing on the panorama. This value must be supplied directly when creating the Panorama, updating this value later may bring the controls into an undefined state. Only governs the controls made by the Maps API itself. Does not scale developer created custom controls. + * Map on which to display the traffic layer. */ - controlSize?: number | null; + map?: google.maps.Map | null; + } + /** + * The assumptions to use when predicting duration in traffic. Specified as part of a DirectionsRequest or DistanceMatrixRequest. Specify these by value, or by using the constant's name. For example, 'bestguess' or google.maps.TrafficModel.BEST_GUESS. + * + * Access by calling `const {TrafficModel} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum TrafficModel { /** - * Enables/disables all default UI. May be overridden individually. + * Use historical traffic data to best estimate the time spent in traffic. */ - disableDefaultUI?: boolean | null; + BEST_GUESS = 'bestguess', /** - * Enables/disables zoom on double click. - * @defaultValue true + * Use historical traffic data to make an optimistic estimate of what the duration in traffic will be. */ - disableDoubleClickZoom?: boolean | null; + OPTIMISTIC = 'optimistic', /** - * If true, the close button is displayed. - * @defaultValue false + * Use historical traffic data to make a pessimistic estimate of what the duration in traffic will be. */ - enableCloseButton?: boolean | null; + PESSIMISTIC = 'pessimistic', + } + export type TrafficModelString = `${google.maps.TrafficModel}`; + /** + * Information about an agency that operates a transit line. + */ + export interface TransitAgency { /** - * The enabled/disabled state of the fullscreen control. + * The name of this transit agency. */ - fullscreenControl?: boolean | null; + name: string; /** - * The display options for the fullscreen control. + * The transit agency's phone number. */ - fullscreenControlOptions?: google.maps.FullscreenControlOptions | null; + phone: string; /** - * The enabled/disabled state of the imagery acquisition date control. Disabled by default. + * The transit agency's URL. */ - imageDateControl?: boolean | null; + url: string; + } + /** + * Details about the departure, arrival, and mode of transit used in this step. + */ + export interface TransitDetails { /** - * The enabled/disabled state of the links control. + * The arrival stop of this transit step. */ - linksControl?: boolean | null; + arrival_stop: google.maps.TransitStop; /** - * Whether motion tracking is on or off. Enabled by default when the motion tracking control is present and permission is granted by a user or not required, so that the POV (point of view) follows the orientation of the device. This is primarily applicable to mobile devices. If motionTracking is set to false while motionTrackingControl is enabled, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to toggle this option. If motionTracking is set to true while permission is required but not yet requested, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to request permission. If motionTracking is set to true while permission is denied by a user, the motion tracking control appears disabled with tracking turned off. + * The arrival time of this step, specified as a Time object. */ - motionTracking?: boolean | null; + arrival_time: google.maps.Time; /** - * The enabled/disabled state of the motion tracking control. Enabled by default when the device has motion data, so that the control appears on the map. This is primarily applicable to mobile devices. + * The departure stop of this transit step. */ - motionTrackingControl?: boolean | null; + departure_stop: google.maps.TransitStop; /** - * The display options for the motion tracking control. + * The departure time of this step, specified as a Time object. */ - motionTrackingControlOptions?: google.maps.MotionTrackingControlOptions | null; + departure_time: google.maps.Time; /** - * The enabled/disabled state of the pan control. + * The direction in which to travel on this line, as it is marked on the vehicle or at the departure stop. */ - panControl?: boolean | null; + headsign: string; /** - * The display options for the pan control. + * The expected number of seconds between equivalent vehicles at this stop. */ - panControlOptions?: google.maps.PanControlOptions | null; + headway: number; /** - * The panorama ID, which should be set when specifying a custom panorama. + * Details about the transit line used in this step. */ - pano?: string | null; + line: google.maps.TransitLine; /** - * The LatLng position of the Street View panorama. + * The number of stops on this step. Includes the arrival stop, but not the departure stop. */ - position?: google.maps.LatLng | google.maps.LatLngLiteral | null; + num_stops: number; /** - * The camera orientation, specified as heading and pitch, for the panorama. + * The text that appears in schedules and sign boards to identify a transit trip to passengers, for example, to identify train numbers for commuter rail trips. The text uniquely identifies a trip within a service day. */ - pov?: google.maps.StreetViewPov | null; + trip_short_name: string; + } + /** + * A fare of a DirectionsRoute consisting of value and currency. + */ + export interface TransitFare { /** - * If false, disables scrollwheel zooming in Street View. - * @defaultValue true + * An ISO 4217 currency code indicating the currency in which the fare is expressed. */ - scrollwheel?: boolean | null; + currency: string; /** - * The display of street names on the panorama. If this value is not specified, or is set to true, street names are displayed on the panorama. If set to false, street names are not displayed. - * @defaultValue true + * The value of the fare, expressed in the given currency, as a string. */ - showRoadLabels?: boolean | null; + text: string; /** - * If true, the Street View panorama is visible on load. + * The numerical value of the fare, expressed in the given currency. */ - visible?: boolean | null; + value: number; + } + /** + * A transit layer. + * Access by calling `const {TransitLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class TransitLayer extends google.maps.MVCObject { /** - * The zoom of the panorama, specified as a number. A zoom of 0 gives a 180 degrees Field of View. + * A layer that displays transit lines. */ - zoom?: number | null; + constructor(); /** - * The enabled/disabled state of the zoom control. + * Returns the map on which this layer is displayed. */ - zoomControl?: boolean | null; + getMap(): google.maps.Map | null; /** - * The display options for the zoom control. + * Renders the layer on the specified map. If map is set to null, the layer will be removed. */ - zoomControlOptions?: google.maps.ZoomControlOptions | null; + setMap(map: google.maps.Map | null): void; } /** - * The properties of the tile set used in a Street View panorama. + * Information about the transit line that operates this transit step. */ - export interface StreetViewTileData { + export interface TransitLine { /** - * The heading (in degrees) at the center of the panoramic tiles. + * The transit agency that operates this transit line. */ - centerHeading: number; + agencies: google.maps.TransitAgency[]; /** - * The size (in pixels) at which tiles will be rendered. + * The color commonly used in signage for this transit line, represented as a hex string. */ - tileSize: google.maps.Size; + color: string; /** - * The size (in pixels) of the whole panorama's "world". + * The URL for an icon associated with this line. */ - worldSize: google.maps.Size; + icon: string; /** - * Gets the tile image URL for the specified tile.
This is a custom method which you must implement, to supply your custom tiles. The API calls this method, supplying the following parameters:
pano is the panorama ID of the Street View tile.
tileZoom is the zoom level of the tile.
tileX is the x-coordinate of the tile.
tileY is the y-coordinate of the tile.
Your custom method must return the URL for the tile image.
+ * The full name of this transit line, e.g. "8 Avenue Local". */ - getTileUrl(pano: string, tileZoom: number, tileX: number, tileY: number): string; + name: string; + /** + * The short name of this transit line, e.g. "E". + */ + short_name: string; + /** + * The text color commonly used in signage for this transit line, represented as a hex string. + */ + text_color: string; + /** + * The agency's URL which is specific to this transit line. + */ + url: string; + /** + * The type of vehicle used, e.g. train or bus. + */ + vehicle: google.maps.TransitVehicle; } /** - * This object is returned from various mouse events on the map and overlays, and contains all the fields shown below. + * The valid transit mode e.g. bus that can be specified in a TransitOptions. Specify these by value, or by using the constant's name. For example, 'BUS' or google.maps.TransitMode.BUS. + * + * Access by calling `const {TransitMode} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface MapMouseEvent { + export enum TransitMode { /** - * The corresponding native DOM event. Developers should not rely on target, currentTarget, relatedTarget and path properties being defined and consistent. Developers should not also rely on the DOM structure of the internal implementation of the Maps API. Due to internal event mapping, the domEvent may have different semantics from the {@link google.maps.MapMouseEvent} (e.g. a {@link google.maps.MapMouseEvent} "click" may have a domEvent of type KeyboardEvent). + * Specifies bus as a preferred mode of transit. */ - domEvent: MouseEvent | TouchEvent | PointerEvent | KeyboardEvent | Event; + BUS = 'BUS', /** - * The latitude/longitude that was below the cursor when the event occurred. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Specifies light rail as a preferred mode of transit. */ - latLng: google.maps.LatLng | null; + LIGHT_RAIL = 'LIGHT_RAIL', /** - * Prevents this event from propagating further. + * Specifies rail as a preferred mode of transit. */ - stop(): void; + RAIL = 'RAIL', + /** + * Specifies subway as a preferred mode of transit. + */ + SUBWAY = 'SUBWAY', + /** + * Specifies train as a preferred mode of transit. + */ + TRAIN = 'TRAIN', + /** + * Specifies tram as a preferred mode of transit. + */ + TRAM = 'TRAM', } + export type TransitModeString = `${google.maps.TransitMode}`; /** - * Object literals are accepted in place of LatLngAltitude objects, as a convenience, in many places. These are converted to LatLngAltitude objects when the Maps API encounters them. + * The TransitOptions object to be included in a DirectionsRequest when the travel mode is set to TRANSIT. */ - export interface LatLngAltitudeLiteral extends google.maps.LatLngLiteral { + export interface TransitOptions { /** - * Distance (in meters) above the ground surface. Negative value means underneath the ground surface. + * The desired arrival time for the route, specified as a Date object. The Date object measures time in milliseconds since 1 January 1970. If arrival time is specified, departure time is ignored. */ - altitude: number; + arrivalTime?: Date | null; /** - * Latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90. + * The desired departure time for the route, specified as a Date object. The Date object measures time in milliseconds since 1 January 1970. If neither departure time nor arrival time is specified, the time is assumed to be "now". */ - lat: number; + departureTime?: Date | null; /** - * Longitude in degrees. Values outside the range [-180, 180] will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe. + * One or more preferred modes of transit, such as bus or train. If no preference is given, the API returns the default best route. */ - lng: number; + modes?: google.maps.TransitModeString[] | null; + /** + * A preference that can bias the choice of transit route, such as less walking. If no preference is given, the API returns the default best route. + */ + routingPreference?: google.maps.TransitRoutePreferenceString | null; } /** - * This interface provides convenience methods for generating matrices to use for rendering WebGL scenes on top of the Google base map.

Note: A reference to this object should not be held outside of the scope of the encapsulating {@link google.maps.WebGLOverlayView.onDraw} call. + * The valid transit route type that can be specified in a TransitOptions. Specify these by value, or by using the constant's name. For example, 'LESS_WALKING' or google.maps.TransitRoutePreference.LESS_WALKING. + * + * Access by calling `const {TransitRoutePreference} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface CoordinateTransformer { - - fromLatLngAltitude(latLngAltitude: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral, rotations?: Float32Array, scale?: Float32Array): Float64Array; - - getCameraParams(): google.maps.CameraParams; + export enum TransitRoutePreference { + /** + * Specifies that the calculated route should prefer a limited number of transfers. + */ + FEWER_TRANSFERS = 'FEWER_TRANSFERS', + /** + * Specifies that the calculated route should prefer limited amounts of walking. + */ + LESS_WALKING = 'LESS_WALKING', } + export type TransitRoutePreferenceString = `${google.maps.TransitRoutePreference}`; /** - * Contains information needed to locate, identify, or describe a place for a {@link google.maps.DirectionsRequest} or {@link google.maps.DistanceMatrixRequest}. In this context, "place" means a business, point of interest, or geographic location. For fetching information about a place, see {@link google.maps.places.PlacesService}. + * Details about a transit stop or station. */ - export interface Place { + export interface TransitStop { /** - * The LatLng of the entity described by this place. + * The location of this stop. */ - location?: google.maps.LatLng | google.maps.LatLngLiteral | null; + location: google.maps.LatLng; /** - * The place ID of the place (such as a business or point of interest). The place ID is a unique identifier of a place in the Google Maps database. Note that the placeId is the most accurate way of identifying a place. If possible, you should specify the placeId rather than a query. A place ID can be retrieved from any request to the Places API, such as a TextSearch. Place IDs can also be retrieved from requests to the Geocoding API. For more information, see the overview of place IDs. + * The name of this transit stop. */ - placeId?: string; + name: string; + } + /** + * Information about the vehicle that operates on a transit line. + */ + export interface TransitVehicle { /** - * A search query describing the place (such as a business or point of interest). An example query is "Quay, Upper Level, Overseas Passenger Terminal 5 Hickson Road, The Rocks NSW". If possible, you should specify the placeId rather than a query. The API does not guarantee the accuracy of resolving the query string to a place. If both the placeId and query are provided, an error occurs. + * A URL for an icon that corresponds to the type of vehicle used on this line. */ - query?: string; + icon: string; + /** + * A URL for an icon that corresponds to the type of vehicle used in this region instead of the more general icon. + */ + local_icon: string; + /** + * A name for this type of TransitVehicle, e.g. "Train" or "Bus". + */ + name: string; + /** + * The type of vehicle used, e.g. train, bus, or ferry. + */ + type: google.maps.VehicleTypeString; } - - export interface AddressValidationLibrary { - - Address: typeof google.maps.addressValidation.Address; - - AddressComponent: typeof google.maps.addressValidation.AddressComponent; - - AddressMetadata: typeof google.maps.addressValidation.AddressMetadata; - - AddressValidation: typeof google.maps.addressValidation.AddressValidation; - - ConfirmationLevel: typeof google.maps.addressValidation.ConfirmationLevel; - - Geocode: typeof google.maps.addressValidation.Geocode; - - Granularity: typeof google.maps.addressValidation.Granularity; + /** + * The valid travel modes that can be specified in a DirectionsRequest as well as the travel modes returned in a DirectionsStep. Specify these by value, or by using the constant's name. For example, 'BICYCLING' or google.maps.TravelMode.BICYCLING. + * + * Access by calling `const {TravelMode} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum TravelMode { + /** + * Specifies a bicycling directions request. + */ + BICYCLING = 'BICYCLING', + /** + * Specifies a driving directions request. + */ + DRIVING = 'DRIVING', + /** + * Specifies a transit directions request. + */ + TRANSIT = 'TRANSIT', /** * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Specifies a two-wheeler directions request. */ - PossibleNextAction: typeof google.maps.addressValidation.PossibleNextAction; - - USPSAddress: typeof google.maps.addressValidation.USPSAddress; - - USPSData: typeof google.maps.addressValidation.USPSData; - - Verdict: typeof google.maps.addressValidation.Verdict; - } - - export interface AirQualityLibrary { - - AirQualityMeterElement: typeof google.maps.airQuality.AirQualityMeterElement; - } - - export interface DrawingLibrary { - - DrawingManager: typeof google.maps.drawing.DrawingManager; - - OverlayType: typeof google.maps.drawing.OverlayType; - } - - export interface ElevationLibrary { - - ElevationService: typeof google.maps.ElevationService; - - ElevationStatus: typeof google.maps.ElevationStatus; + TWO_WHEELER = 'TWO_WHEELER', + /** + * Specifies a walking directions request. + */ + WALKING = 'WALKING', } + export type TravelModeString = `${google.maps.TravelMode}`; /** - * Object literal which represents a circle. + * The valid unit systems that can be specified in a DirectionsRequest. + * + * Access by calling `const {UnitSystem} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface CircleLiteral extends google.maps.CircleOptions { + export enum UnitSystem { /** - * The center of the Circle. + * Specifies that distances in the DirectionsResult should be expressed in imperial units. */ - center: google.maps.LatLng | google.maps.LatLngLiteral; + IMPERIAL = 1, /** - * The radius in meters on the Earth's surface. + * Specifies that distances in the DirectionsResult should be expressed in metric units. */ - radius: number; - } - - export interface GeometryLibrary { - - encoding: typeof google.maps.geometry.encoding; - - poly: typeof google.maps.geometry.poly; - - spherical: typeof google.maps.geometry.spherical; + METRIC = 0, } /** - * This object is made available to the OverlayView from within the draw method. It is not guaranteed to be initialized until draw is called. + * A Vector3D is a three-dimensional vector used for standard mathematical operations such as scaling the bounds of three-dimensional object along local x-, y-, and z-axes.

  • x is a real number.
  • y is a real number.
  • z is a real number.
+ * Access by calling `const {Vector3D} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface MapCanvasProjection { + export class Vector3D implements google.maps.Vector3DLiteral { /** - * Computes the geographical coordinates from pixel coordinates in the map's container. + * + * @param value The initializing value. */ - fromContainerPixelToLatLng(pixel: google.maps.Point | null, noClampNoWrap?: boolean): google.maps.LatLng | null; + constructor(value: google.maps.Vector3D | google.maps.Vector3DLiteral); /** - * Computes the geographical coordinates from pixel coordinates in the div that holds the draggable map. + * X-component of the three-dimensional vector. */ - fromDivPixelToLatLng(pixel: google.maps.Point | null, noClampNoWrap?: boolean): google.maps.LatLng | null; + get x(): number; /** - * Computes the pixel coordinates of the given geographical location in the map's container element. + * Y-component of the three-dimensional vector. */ - fromLatLngToContainerPixel(latLng: google.maps.LatLng | google.maps.LatLngLiteral): google.maps.Point | null; + get y(): number; /** - * Computes the pixel coordinates of the given geographical location in the DOM element that holds the draggable map. + * Z-component of the three-dimensional vector. */ - fromLatLngToDivPixel(latLng: google.maps.LatLng | google.maps.LatLngLiteral | null): google.maps.Point | null; + get z(): number; /** - * The visible region of the map. Returns null if the map has no size. Returns null if the OverlayView is on a StreetViewPanorama. + * Comparison function. */ - getVisibleRegion(): google.maps.VisibleRegion | null; + equals(other: google.maps.Vector3D | google.maps.Vector3DLiteral | null): boolean; /** - * The width of the world in pixels in the current zoom level. For projections with a heading angle of either 90 or 270 degrees, this corresponds to the pixel span in the Y-axis. + * Converts to a plain object. */ - getWorldWidth(): number; + toJSON(key?: string): google.maps.Vector3DLiteral; } - - export interface MarkerLibrary { - - AdvancedMarkerClickEvent: typeof google.maps.marker.AdvancedMarkerClickEvent; - - AdvancedMarkerElement: typeof google.maps.marker.AdvancedMarkerElement; - - Animation: typeof google.maps.Animation; - - CollisionBehavior: typeof google.maps.CollisionBehavior; - - Marker: typeof google.maps.Marker; - - PinElement: typeof google.maps.marker.PinElement; - } - - export interface Maps3DLibrary { - - AltitudeMode: typeof google.maps.maps3d.AltitudeMode; - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - */ - AutofitsCameraAnimation: typeof google.maps.maps3d.AutofitsCameraAnimation; - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - */ - CirclePathElement: typeof google.maps.maps3d.CirclePathElement; - - FlattenerElement: typeof google.maps.maps3d.FlattenerElement; - - GestureHandling: typeof google.maps.maps3d.GestureHandling; - - LocationClickEvent: typeof google.maps.maps3d.LocationClickEvent; - - Map3DElement: typeof google.maps.maps3d.Map3DElement; - - MapMode: typeof google.maps.maps3d.MapMode; - - Marker3DElement: typeof google.maps.maps3d.Marker3DElement; - - Marker3DInteractiveElement: typeof google.maps.maps3d.Marker3DInteractiveElement; - - MarkerElement: typeof google.maps.maps3d.MarkerElement; - - MarkerInteractiveElement: typeof google.maps.maps3d.MarkerInteractiveElement; - - Model3DElement: typeof google.maps.maps3d.Model3DElement; - - Model3DInteractiveElement: typeof google.maps.maps3d.Model3DInteractiveElement; - - PlaceClickEvent: typeof google.maps.maps3d.PlaceClickEvent; - - Polygon3DElement: typeof google.maps.maps3d.Polygon3DElement; - - Polygon3DInteractiveElement: typeof google.maps.maps3d.Polygon3DInteractiveElement; - - Polyline3DElement: typeof google.maps.maps3d.Polyline3DElement; - - Polyline3DInteractiveElement: typeof google.maps.maps3d.Polyline3DInteractiveElement; - - PopoverElement: typeof google.maps.maps3d.PopoverElement; - - SteadyChangeEvent: typeof google.maps.maps3d.SteadyChangeEvent; - } - - export interface PlacesLibrary { - - AccessibilityOptions: typeof google.maps.places.AccessibilityOptions; - - AddressComponent: typeof google.maps.places.AddressComponent; - - AddressDescriptor: typeof google.maps.places.AddressDescriptor; - - Area: typeof google.maps.places.Area; - - Attribution: typeof google.maps.places.Attribution; - - AttributionColor: typeof google.maps.places.AttributionColor; - - AuthorAttribution: typeof google.maps.places.AuthorAttribution; - - Autocomplete: typeof google.maps.places.Autocomplete; - - AutocompleteService: typeof google.maps.places.AutocompleteService; - - AutocompleteSessionToken: typeof google.maps.places.AutocompleteSessionToken; - - AutocompleteSuggestion: typeof google.maps.places.AutocompleteSuggestion; - - BasicPlaceAutocompleteElement: typeof google.maps.places.BasicPlaceAutocompleteElement; - - BusinessStatus: typeof google.maps.places.BusinessStatus; - - ConnectorAggregation: typeof google.maps.places.ConnectorAggregation; - - ConsumerAlert: typeof google.maps.places.ConsumerAlert; - - ConsumerAlertDetails: typeof google.maps.places.ConsumerAlertDetails; - - Containment: typeof google.maps.places.Containment; - - ContentBlock: typeof google.maps.places.ContentBlock; - - EVChargeAmenitySummary: typeof google.maps.places.EVChargeAmenitySummary; - - EVChargeOptions: typeof google.maps.places.EVChargeOptions; - - EVConnectorType: typeof google.maps.places.EVConnectorType; - - FormattableText: typeof google.maps.places.FormattableText; - - FuelOptions: typeof google.maps.places.FuelOptions; - - FuelPrice: typeof google.maps.places.FuelPrice; - - FuelType: typeof google.maps.places.FuelType; - - GenerativeSummary: typeof google.maps.places.GenerativeSummary; - - GoogleMapsLinks: typeof google.maps.places.GoogleMapsLinks; - - Landmark: typeof google.maps.places.Landmark; - - MediaSize: typeof google.maps.places.MediaSize; - - Money: typeof google.maps.places.Money; - - NeighborhoodSummary: typeof google.maps.places.NeighborhoodSummary; - - OpeningHours: typeof google.maps.places.OpeningHours; - - OpeningHoursPeriod: typeof google.maps.places.OpeningHoursPeriod; - - OpeningHoursPoint: typeof google.maps.places.OpeningHoursPoint; - - ParkingOptions: typeof google.maps.places.ParkingOptions; - - PaymentOptions: typeof google.maps.places.PaymentOptions; - - Photo: typeof google.maps.places.Photo; - - Place: typeof google.maps.places.Place; - - PlaceAccessibleEntranceIconElement: typeof google.maps.places.PlaceAccessibleEntranceIconElement; - - PlaceAddressElement: typeof google.maps.places.PlaceAddressElement; - - PlaceAllContentElement: typeof google.maps.places.PlaceAllContentElement; - - PlaceAttributionElement: typeof google.maps.places.PlaceAttributionElement; - - PlaceAutocompleteElement: typeof google.maps.places.PlaceAutocompleteElement; - - PlaceContentConfigElement: typeof google.maps.places.PlaceContentConfigElement; - - PlaceContextualElement: typeof google.maps.places.PlaceContextualElement; - - PlaceContextualListConfigElement: typeof google.maps.places.PlaceContextualListConfigElement; - - PlaceContextualListLayout: typeof google.maps.places.PlaceContextualListLayout; - - PlaceDetailsCompactElement: typeof google.maps.places.PlaceDetailsCompactElement; - - PlaceDetailsElement: typeof google.maps.places.PlaceDetailsElement; - - PlaceDetailsLocationRequestElement: typeof google.maps.places.PlaceDetailsLocationRequestElement; - - PlaceDetailsOrientation: typeof google.maps.places.PlaceDetailsOrientation; - - PlaceDetailsPlaceRequestElement: typeof google.maps.places.PlaceDetailsPlaceRequestElement; - - PlaceFeatureListElement: typeof google.maps.places.PlaceFeatureListElement; - - PlaceMediaElement: typeof google.maps.places.PlaceMediaElement; - - PlaceNearbySearchRequestElement: typeof google.maps.places.PlaceNearbySearchRequestElement; - - PlaceOpeningHoursElement: typeof google.maps.places.PlaceOpeningHoursElement; - - PlaceOpenNowStatusElement: typeof google.maps.places.PlaceOpenNowStatusElement; - - PlacePhoneNumberElement: typeof google.maps.places.PlacePhoneNumberElement; - - PlacePlusCodeElement: typeof google.maps.places.PlacePlusCodeElement; - - PlacePrediction: typeof google.maps.places.PlacePrediction; - - PlacePredictionSelectEvent: typeof google.maps.places.PlacePredictionSelectEvent; - - PlacePriceElement: typeof google.maps.places.PlacePriceElement; - - PlaceRatingElement: typeof google.maps.places.PlaceRatingElement; - - PlaceReviewsElement: typeof google.maps.places.PlaceReviewsElement; - - PlaceReviewSummaryElement: typeof google.maps.places.PlaceReviewSummaryElement; - - PlaceSearchAttributionPosition: typeof google.maps.places.PlaceSearchAttributionPosition; - - PlaceSearchElement: typeof google.maps.places.PlaceSearchElement; - - PlaceSearchOrientation: typeof google.maps.places.PlaceSearchOrientation; - - PlaceSelectEvent: typeof google.maps.places.PlaceSelectEvent; - - PlacesService: typeof google.maps.places.PlacesService; - - PlacesServiceStatus: typeof google.maps.places.PlacesServiceStatus; - - PlaceStandardContentElement: typeof google.maps.places.PlaceStandardContentElement; - - PlaceSummaryElement: typeof google.maps.places.PlaceSummaryElement; - - PlaceTextSearchRequestElement: typeof google.maps.places.PlaceTextSearchRequestElement; - - PlaceTypeElement: typeof google.maps.places.PlaceTypeElement; - - PlaceTypeSpecificHighlightsElement: typeof google.maps.places.PlaceTypeSpecificHighlightsElement; - - PlaceWebsiteElement: typeof google.maps.places.PlaceWebsiteElement; - - PlusCode: typeof google.maps.places.PlusCode; - - PostalAddress: typeof google.maps.places.PostalAddress; - - PriceLevel: typeof google.maps.places.PriceLevel; - - PriceRange: typeof google.maps.places.PriceRange; - - RankBy: typeof google.maps.places.RankBy; - - Review: typeof google.maps.places.Review; - - ReviewSummary: typeof google.maps.places.ReviewSummary; - - SearchBox: typeof google.maps.places.SearchBox; - - SearchByTextRankPreference: typeof google.maps.places.SearchByTextRankPreference; - - SearchNearbyRankPreference: typeof google.maps.places.SearchNearbyRankPreference; - - SecondaryOpeningHours: typeof google.maps.places.SecondaryOpeningHours; - - SpatialRelationship: typeof google.maps.places.SpatialRelationship; - - StringRange: typeof google.maps.places.StringRange; - - TimeZone: typeof google.maps.places.TimeZone; - - TransitAgency: typeof google.maps.places.TransitAgency; - - TransitIcon: typeof google.maps.places.TransitIcon; - - TransitLine: typeof google.maps.places.TransitLine; - - TransitStation: typeof google.maps.places.TransitStation; - - TransitStop: typeof google.maps.places.TransitStop; - - TransitVehicleType: typeof google.maps.places.TransitVehicleType; - } - - export interface RoutesLibrary { - - ComputeRouteMatrixExtraComputation: typeof google.maps.routes.ComputeRouteMatrixExtraComputation; - - ComputeRoutesExtraComputation: typeof google.maps.routes.ComputeRoutesExtraComputation; - - DirectionalLocation: typeof google.maps.routes.DirectionalLocation; - - DirectionsRenderer: typeof google.maps.DirectionsRenderer; - - DirectionsService: typeof google.maps.DirectionsService; - - DirectionsStatus: typeof google.maps.DirectionsStatus; - - DistanceMatrixElementStatus: typeof google.maps.DistanceMatrixElementStatus; - - DistanceMatrixService: typeof google.maps.DistanceMatrixService; - - DistanceMatrixStatus: typeof google.maps.DistanceMatrixStatus; - - FallbackInfo: typeof google.maps.routes.FallbackInfo; - - FallbackReason: typeof google.maps.routes.FallbackReason; - - FallbackRoutingMode: typeof google.maps.routes.FallbackRoutingMode; - - GeocodedWaypoint: typeof google.maps.routes.GeocodedWaypoint; - - GeocodingResults: typeof google.maps.routes.GeocodingResults; - - MultiModalSegment: typeof google.maps.routes.MultiModalSegment; - - PolylineDetailInfo: typeof google.maps.routes.PolylineDetailInfo; - - PolylineDetails: typeof google.maps.routes.PolylineDetails; - - PolylineQuality: typeof google.maps.routes.PolylineQuality; - - ReferenceRoute: typeof google.maps.routes.ReferenceRoute; - - RoadFeatureState: typeof google.maps.routes.RoadFeatureState; - - Route: typeof google.maps.routes.Route; - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - */ - Route3DElement: typeof google.maps.routes.Route3DElement; - - RouteLabel: typeof google.maps.routes.RouteLabel; - - RouteLeg: typeof google.maps.routes.RouteLeg; - - RouteLegLocalizedValues: typeof google.maps.routes.RouteLegLocalizedValues; - - RouteLegStep: typeof google.maps.routes.RouteLegStep; - - RouteLegStepLocalizedValues: typeof google.maps.routes.RouteLegStepLocalizedValues; - - RouteLegTravelAdvisory: typeof google.maps.routes.RouteLegTravelAdvisory; - - RouteLocalizedValues: typeof google.maps.routes.RouteLocalizedValues; - - RouteMatrix: typeof google.maps.routes.RouteMatrix; - - RouteMatrixItem: typeof google.maps.routes.RouteMatrixItem; - - RouteMatrixItemCondition: typeof google.maps.routes.RouteMatrixItemCondition; - - RouteMatrixItemError: typeof google.maps.routes.RouteMatrixItemError; - - RouteMatrixItemLocalizedValues: typeof google.maps.routes.RouteMatrixItemLocalizedValues; - - RouteMatrixRow: typeof google.maps.routes.RouteMatrixRow; - - RouteTravelAdvisory: typeof google.maps.routes.RouteTravelAdvisory; - - RoutingPreference: typeof google.maps.routes.RoutingPreference; - - Speed: typeof google.maps.routes.Speed; - - SpeedReadingInterval: typeof google.maps.routes.SpeedReadingInterval; - - StepsOverview: typeof google.maps.routes.StepsOverview; - - TollInfo: typeof google.maps.routes.TollInfo; - - TrafficModel: typeof google.maps.TrafficModel; - - TransitAgency: typeof google.maps.routes.TransitAgency; - - TransitDetails: typeof google.maps.routes.TransitDetails; - - TransitLine: typeof google.maps.routes.TransitLine; - - TransitMode: typeof google.maps.TransitMode; - - TransitRoutePreference: typeof google.maps.TransitRoutePreference; - - TransitStop: typeof google.maps.routes.TransitStop; - - TransitVehicle: typeof google.maps.routes.TransitVehicle; - - TravelMode: typeof google.maps.TravelMode; - - VehicleEmissionType: typeof google.maps.routes.VehicleEmissionType; - - VehicleType: typeof google.maps.VehicleType; - } - - export interface VisualizationLibrary { - - HeatmapLayer: typeof google.maps.visualization.HeatmapLayer; - } - - export interface MapPanes { - /** - * This pane contains the info window. It is above all map overlays. (Pane 4). - */ - floatPane: Element; - /** - * This pane is the lowest pane and is above the tiles. It does not receive DOM events. (Pane 0). - */ - mapPane: Element; - /** - * This pane contains markers. It does not receive DOM events. (Pane 2). - */ - markerLayer: Element; - /** - * This pane contains polylines, polygons, ground overlays and tile layer overlays. It does not receive DOM events. (Pane 1). - */ - overlayLayer: Element; - /** - * This pane contains elements that receive DOM events. (Pane 3). - */ - overlayMouseTarget: Element; - } - /** - * Loads a library of the Maps JavaScript API, resolving with the direct members of that API (without namespacing). (When loaded, libraries also add themselves to the global google.maps namespace, though using the global namespace is not generally recommended.) - */ - export function importLibrary(libraryName: "core"): Promise; - export function importLibrary(libraryName: "maps"): Promise; - export function importLibrary(libraryName: "geocoding"): Promise; - export function importLibrary(libraryName: "streetView"): Promise; - export function importLibrary(libraryName: "maps3d"): Promise; - export function importLibrary(libraryName: "places"): Promise; - export function importLibrary(libraryName: "routes"): Promise; - export function importLibrary(libraryName: "marker"): Promise; - export function importLibrary(libraryName: "geometry"): Promise; - export function importLibrary(libraryName: "elevation"): Promise; - export function importLibrary(libraryName: "journeySharing"): Promise; - export function importLibrary(libraryName: "drawing"): Promise; - export function importLibrary(libraryName: "visualization"): Promise; - export function importLibrary(libraryName: "addressValidation"): Promise; - export function importLibrary(libraryName: "airQuality"): Promise; - export function importLibrary(libraryName: string): Promise; - /** - * Google Maps JavaScript API version loaded by the browser. See https://developers.google.com/maps/documentation/javascript/versions - */ - export const version: string; -} - -declare namespace google.maps.geometry.poly { - /** - * Computes whether the given point lies inside the specified polygon. - */ - export function containsLocation(point: google.maps.LatLng | google.maps.LatLngLiteral, polygon: google.maps.Polygon): boolean; - /** - * Computes whether the given point lies on or near to a polyline, or the edge of a polygon, within a specified tolerance. Returns true when the difference between the latitude and longitude of the supplied point, and the closest point on the edge, is less than the tolerance. The tolerance defaults to 10-9 degrees. - */ - export function isLocationOnEdge(point: google.maps.LatLng | google.maps.LatLngLiteral, poly: google.maps.Polygon | google.maps.Polyline, tolerance?: number): boolean; -} - -declare namespace google.maps.geometry.spherical { - /** - * Returns the unsigned area of a closed path, in the range [0, 2×pi×radius²]. The computed area uses the same units as the radius. The radiusOfSphere defaults to the Earth's radius in meters, in which case the area is in square meters. Passing a Circle requires the radius to be set to a non-negative value. Additionally, the Circle must not cover more than 100% of the sphere. And when passing a LatLngBounds, the southern LatLng cannot be more north than the northern LatLng. - */ - export function computeArea(path: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray | google.maps.Circle | google.maps.CircleLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, radiusOfSphere?: number): number; - /** - * Returns the distance, in meters, between two LatLngs. You can optionally specify a custom radius. The radius defaults to the radius of the Earth. - */ - export function computeDistanceBetween(from: google.maps.LatLng | google.maps.LatLngLiteral, to: google.maps.LatLng | google.maps.LatLngLiteral, radius?: number): number; - /** - * Returns the heading from one LatLng to another LatLng. Headings are expressed in degrees clockwise from North within the range [-180,180). - */ - export function computeHeading(from: google.maps.LatLng | google.maps.LatLngLiteral, to: google.maps.LatLng | google.maps.LatLngLiteral): number; - /** - * Returns the length of the given path. - */ - export function computeLength(path: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray, radius?: number): number; - /** - * Returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north). - */ - export function computeOffset(from: google.maps.LatLng | google.maps.LatLngLiteral, distance: number, heading: number, radius?: number): google.maps.LatLng; - /** - * Returns the location of origin when provided with a LatLng destination, meters travelled and original heading. Headings are expressed in degrees clockwise from North. This function returns null when no solution is available. - */ - export function computeOffsetOrigin(to: google.maps.LatLng | google.maps.LatLngLiteral, distance: number, heading: number, radius?: number): google.maps.LatLng | null; - /** - * Returns the signed area of a closed path, where counterclockwise is positive, in the range [-2×pi×radius², 2×pi×radius²]. The computed area uses the same units as the radius. The radius defaults to the Earth's radius in meters, in which case the area is in square meters.

The area is computed using the parallel transport method; the parallel transport around a closed path on the unit sphere twists by an angle that is equal to the area enclosed by the path. This is simpler and more accurate and robust than triangulation using Girard, l'Huilier, or Eriksson on each triangle. In particular, since it doesn't triangulate, it suffers no instability except in the unavoidable case when an edge (not a diagonal) of the polygon spans 180 degrees. - */ - export function computeSignedArea(loop: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray, radius?: number): number; - /** - * Returns the LatLng which lies the given fraction of the way between the origin LatLng and the destination LatLng. - */ - export function interpolate(from: google.maps.LatLng | google.maps.LatLngLiteral, to: google.maps.LatLng | google.maps.LatLngLiteral, fraction: number): google.maps.LatLng; - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * Returns the position which lies the given fraction of the way along the given path. If passing LatLngAltitude objects, altitude is currently ignored, but future versions may take altitude into account. - */ - export function traversePath(path: (google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral)[], fraction: number): google.maps.LatLngLiteral; -} - -declare namespace google.maps.geometry.encoding { - /** - * Decodes an encoded path string into a sequence of LatLngs. - */ - export function decodePath(encodedPath: string): google.maps.LatLng[]; - /** - * Encodes a sequence of LatLngs into an encoded path string. - */ - export function encodePath(path: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray): string; -} - -declare namespace google.maps.journeySharing { - /** - * Automatic viewport mode. - * - * Access by calling `const {AutomaticViewportMode} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum AutomaticViewportMode { - /** - * Automatically adjust the viewport to fit markers and any visible anticipated route polylines. This is the default. - */ - FIT_ANTICIPATED_ROUTE = 'FIT_ANTICIPATED_ROUTE', - /** - * Do not automatically adjust the viewport. - */ - NONE = 'NONE', - } - export type AutomaticViewportModeString = `${google.maps.journeySharing.AutomaticViewportMode}`; - /** - * Types of Fleet Engine services. - * - * Access by calling `const {FleetEngineServiceType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum FleetEngineServiceType { - /** - * Fleet Engine service used to access delivery vehicles. - */ - DELIVERY_VEHICLE_SERVICE = 'DELIVERY_VEHICLE_SERVICE', - /** - * Fleet Engine service used to access task information. - */ - TASK_SERVICE = 'TASK_SERVICE', - /** - * Fleet Engine service used to access trip information. - */ - TRIP_SERVICE = 'TRIP_SERVICE', - /** - * Unknown Fleet Engine service. - */ - UNKNOWN_SERVICE = 'UNKNOWN_SERVICE', - } - export type FleetEngineServiceTypeString = `${google.maps.journeySharing.FleetEngineServiceType}`; - /** - * Parent class of all location providers. - */ - export class LocationProvider { - /** - * Adds a {@link google.maps.MapsEventListener} for an event fired by this location provider. Returns an identifier for this listener that can be used with {@link google.maps.event.removeListener}. - */ - addListener(eventName: string, handler: Function): google.maps.MapsEventListener; - } - /** - * Parent class of polling location providers. - */ - export class PollingLocationProvider extends google.maps.journeySharing.LocationProvider { - /** - * True if this location provider is polling. Read only. - */ - isPolling: boolean; - /** - * 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. - */ - pollingIntervalMillis: number; - } - /** - * The event object passed to the event handler when the {@link google.maps.journeySharing.PollingLocationProvider.ispollingchange} event is triggered. - */ - export interface PollingLocationProviderIsPollingChangeEvent { - /** - * 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. - */ - error: Error | null; - } - /** - * Contains additional information needed to mint JSON Web Tokens. - */ - export interface AuthTokenContext { - /** - * When provided, the minted token should have a private DeliveryVehicleId claim for the provided deliveryVehicleId. - */ - deliveryVehicleId?: string | null; - /** - * When provided, the minted token should have a private TaskId claim for the provided taskId. - */ - taskId?: string | null; - /** - * When provided, the minted token should have a private TrackingId claim for the provided trackingId. - */ - trackingId?: string | null; - /** - * When provided, the minted token should have a private TripId claim for the provided tripId. - */ - tripId?: string | null; - /** - * When provided, the minted token should have a private VehicleId claim for the provided vehicleId. - */ - vehicleId?: string | null; - } - /** - * Options for the auth token fetcher. - */ - export interface AuthTokenFetcherOptions { - /** - * The auth token context. IDs specified in the context should be added to the request sent to the JSON Web Token minting endpoint. - */ - context: google.maps.journeySharing.AuthTokenContext; - /** - * The Fleet Engine service type. - */ - serviceType: google.maps.journeySharing.FleetEngineServiceTypeString; - } - /** - * The auth token returned by the token fetcher. - */ - export interface AuthToken { - /** - * The expiration time in seconds. A token expires in this amount of time after fetching. - */ - expiresInSeconds: number; - /** - * The token. - */ - token: string; - } - /** - * Options for the map view. - */ - export interface JourneySharingMapViewOptions { - /** - * 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. - */ - automaticViewportMode?: google.maps.journeySharing.AutomaticViewportModeString | null; - /** - * The DOM element backing the view. Required. - */ - element: Element; - /** - * Sources of tracked locations to be shown in the tracking map view. Optional. - */ - locationProviders: google.maps.journeySharing.LocationProvider[] | null; - /** - * Map options passed into the google.maps.Map constructor. - */ - mapOptions?: google.maps.MapOptions | null; - /** - * A source of tracked locations to be shown in the tracking map view. Optional. - * @deprecated Use {@link google.maps.journeySharing.JourneySharingMapViewOptions.locationProviders} instead. - */ - locationProvider: google.maps.journeySharing.LocationProvider | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - destinationMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - originMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - taskOutcomeMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - unsuccessfulTaskMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - vehicleMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - waypointMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - /** - * 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. - * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - anticipatedRoutePolylineSetup?: google.maps.journeySharing.PolylineSetup | null; - /** - * 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. - * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - takenRoutePolylineSetup?: google.maps.journeySharing.PolylineSetup | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - pingMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - successfulTaskMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; - } - /** - * The map view. - * Access by calling `const {JourneySharingMapView} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class JourneySharingMapView { - /** - * Instantiates a map view. - * @param options Options for the map view. - */ - constructor(options: google.maps.journeySharing.JourneySharingMapViewOptions); - /** - * This Field is read-only. Automatic viewport mode. - */ - automaticViewportMode: google.maps.journeySharing.AutomaticViewportModeString; - /** - * This Field is read-only. The DOM element backing the view. - */ - element: Element; - /** - * Enables or disables the traffic layer. - */ - enableTraffic: boolean; - /** - * This field is read-only. Sources of tracked locations to be shown in the tracking map view. To add or remove location providers, use the {@link google.maps.journeySharing.JourneySharingMapView.addLocationProvider} and {@link google.maps.journeySharing.JourneySharingMapView.removeLocationProvider} methods. - */ - locationProviders: google.maps.journeySharing.LocationProvider[] | null; - /** - * This Field is read-only. The map object contained in the map view. - */ - map: google.maps.Map; - /** - * This Field is read-only. The map options passed into the map via the map view. - */ - mapOptions: google.maps.MapOptions; - /** - * This Field is read-only. A source of tracked locations to be shown in the tracking map view. - * @deprecated Use {@link google.maps.journeySharing.JourneySharingMapView.locationProviders} instead. - */ - locationProvider: google.maps.journeySharing.LocationProvider | null; - /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - destinationMarkerSetup: google.maps.journeySharing.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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - originMarkerSetup: google.maps.journeySharing.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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - taskOutcomeMarkerSetup: google.maps.journeySharing.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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - unsuccessfulTaskMarkerSetup: google.maps.journeySharing.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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. - */ - vehicleMarkerSetup: google.maps.journeySharing.MarkerSetup; + /** + * Object literals are accepted in place of Vector3D objects, as a convenience, in many places. These are converted to Vector3D objects when the Maps API encounters them. + */ + export interface Vector3DLiteral { /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. + * X-component of the three-dimensional vector. */ - waypointMarkerSetup: google.maps.journeySharing.MarkerSetup; + x: number; /** - * 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. - * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. + * Y-component of the three-dimensional vector. */ - anticipatedRoutePolylineSetup: google.maps.journeySharing.PolylineSetup; + y: number; /** - * 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. - * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. + * Z-component of the three-dimensional vector. */ - takenRoutePolylineSetup: google.maps.journeySharing.PolylineSetup; + z: number; + } + /** + * Possible values for vehicle types. + * + * Access by calling `const {VehicleType} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum VehicleType { /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. + * Bus. */ - pingMarkerSetup: google.maps.journeySharing.MarkerSetup; + BUS = 'BUS', /** - * 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. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. + * A vehicle that operates on a cable, usually on the ground. Aerial cable cars may be of the type GONDOLA_LIFT. */ - successfulTaskMarkerSetup: google.maps.journeySharing.MarkerSetup; + CABLE_CAR = 'CABLE_CAR', /** - * Returns the destination markers, if any. - * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. + * Commuter rail. */ - destinationMarkers: google.maps.Marker[]; + COMMUTER_TRAIN = 'COMMUTER_TRAIN', /** - * Returns the origin markers, if any. - * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. + * Ferry. */ - originMarkers: google.maps.Marker[]; + FERRY = 'FERRY', /** - * Returns the successful task markers, if any. - * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. + * A vehicle that is pulled up a steep incline by a cable. */ - successfulTaskMarkers: google.maps.Marker[]; + FUNICULAR = 'FUNICULAR', /** - * Returns the task outcome markers, if any. - * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. + * An aerial cable car. */ - taskOutcomeMarkers: google.maps.Marker[]; + GONDOLA_LIFT = 'GONDOLA_LIFT', /** - * Returns the unsuccessful task markers, if any. - * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. + * Heavy rail. */ - unsuccessfulTaskMarkers: google.maps.Marker[]; + HEAVY_RAIL = 'HEAVY_RAIL', /** - * Returns the vehicle markers, if any. - * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. + * High speed train. */ - vehicleMarkers: google.maps.Marker[]; + HIGH_SPEED_TRAIN = 'HIGH_SPEED_TRAIN', /** - * Returns the waypoint markers, if any. - * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. + * Intercity bus. */ - waypointMarkers: google.maps.Marker[]; + INTERCITY_BUS = 'INTERCITY_BUS', /** - * Returns the anticipated route polylines, if any. - * @deprecated getting a list of polylines via the MapView is deprecated. Use the PolylineCustomizationFunctions for your location provider to receive callbacks when a polyline is added to the map or updated. + * Light rail. */ - anticipatedRoutePolylines: google.maps.Polyline[]; + METRO_RAIL = 'METRO_RAIL', /** - * Returns the taken route polylines, if any. - * @deprecated getting a list of polylines via the MapView is deprecated. Use the PolylineCustomizationFunctions for your location provider to receive callbacks when a polyline is added to the map or updated. + * Monorail. */ - takenRoutePolylines: google.maps.Polyline[]; + MONORAIL = 'MONORAIL', /** - * Adds a location provider to the map view. If the location provider is already added, no action is performed. + * Other vehicles. */ - addLocationProvider(locationProvider: google.maps.journeySharing.LocationProvider): void; + OTHER = 'OTHER', /** - * Removes a location provider from the map view. If the location provider is not already added to the map view, no action is performed. + * Rail. */ - removeLocationProvider(locationProvider: google.maps.journeySharing.LocationProvider): void; - } - /** - * MarkerSetup options. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. - */ - export interface MarkerSetupOptions { + RAIL = 'RAIL', /** - * Marker options. + * Share taxi is a sort of bus transport with ability to drop off and pick up passengers anywhere on its route. Generally share taxi uses minibus vehicles. */ - markerOptions?: google.maps.MarkerOptions | null; - } - /** - * MarkerSetup default options. - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. - */ - export interface DefaultMarkerSetupOptions { + SHARE_TAXI = 'SHARE_TAXI', /** - * Default marker options. + * Underground light rail. */ - defaultMarkerOptions: google.maps.MarkerOptions; - } - /** - * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. - */ - export type MarkerSetup = google.maps.journeySharing.MarkerSetupOptions | ((arg0: google.maps.journeySharing.DefaultMarkerSetupOptions) => google.maps.journeySharing.MarkerSetupOptions); - /** - * PolylineSetup options. - * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. - */ - export interface PolylineSetupOptions { + SUBWAY = 'SUBWAY', /** - * Polyline options. + * Above ground light rail. */ - polylineOptions?: google.maps.PolylineOptions | null; + TRAM = 'TRAM', /** - * Polyline visibility. + * Trolleybus. */ - visible?: boolean | null; + TROLLEYBUS = 'TROLLEYBUS', } + export type VehicleTypeString = `${google.maps.VehicleType}`; /** - * PolylineSetup default options. - * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. + * Contains the four points defining the four-sided polygon that is the visible region of the map. On a vector map this polygon can be a trapezoid instead of a rectangle, when a vector map has tilt. */ - export interface DefaultPolylineSetupOptions { - /** - * Default polyline options. - */ - defaultPolylineOptions: google.maps.PolylineOptions; + export interface VisibleRegion { + + farLeft: google.maps.LatLng; + + farRight: google.maps.LatLng; /** - * Default polyline visibility. + * The smallest bounding box that includes the visible region. */ - defaultVisible: boolean; + latLngBounds: google.maps.LatLngBounds; + + nearLeft: google.maps.LatLng; + + nearRight: google.maps.LatLng; } - /** - * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. - */ - export type PolylineSetup = google.maps.journeySharing.PolylineSetupOptions | ((arg0: google.maps.journeySharing.DefaultPolylineSetupOptions) => google.maps.journeySharing.PolylineSetupOptions); - export type AuthTokenFetcher = (arg0: google.maps.journeySharing.AuthTokenFetcherOptions) => Promise; + export interface VisualizationLibrary { + + HeatmapLayer: typeof google.maps.visualization.HeatmapLayer; + } /** - * The current state of a {@link google.maps.journeySharing.DeliveryVehicleStop}. - * - * Access by calling `const {DeliveryVehicleStopState} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Drawing options. */ - export enum DeliveryVehicleStopState { - /** - * Arrived at stop. Assumes that when the vehicle is routing to the next stop, that all previous stops have been completed. - */ - ARRIVED = 'ARRIVED', - /** - * Assigned and actively routing. - */ - ENROUTE = 'ENROUTE', + export interface WebGLDrawOptions { /** - * Created, but not actively routing. + * The WebGLRenderingContext on which to render this WebGLOverlayView. */ - NEW = 'NEW', + gl: WebGLRenderingContext; /** - * Unknown. + * The matrix transformation from camera space to latitude/longitude coordinates. */ - UNSPECIFIED = 'UNSPECIFIED', + transformer: google.maps.CoordinateTransformer; } - export type DeliveryVehicleStopStateString = `${google.maps.journeySharing.DeliveryVehicleStopState}`; /** - * The current navigation status of a {@link google.maps.journeySharing.Vehicle}. - * - * Access by calling `const {VehicleNavigationStatus} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The WebGL Overlay View provides direct access to the same WebGL rendering context Google Maps Platform uses to render the vector basemap. This use of a shared rendering context provides benefits such as depth occlusion with 3D building geometry, and the ability to sync 2D/3D content with basemap rendering.

With WebGL Overlay View you can add content to your maps using WebGL directly, or popular Graphics libraries like Three.js or deck.gl. To use the overlay, you can extend google.maps.WebGLOverlayView and provide an implementation for each of the following lifecycle hooks: {@link google.maps.WebGLOverlayView.onAdd}, {@link google.maps.WebGLOverlayView.onContextRestored}, {@link google.maps.WebGLOverlayView.onDraw}, {@link google.maps.WebGLOverlayView.onContextLost} and {@link google.maps.WebGLOverlayView.onRemove}.

You must call {@link google.maps.WebGLOverlayView.setMap} with a valid {@link google.maps.Map} object to trigger the call to the onAdd() method and setMap(null) in order to trigger the onRemove() method. The setMap() method can be called at the time of construction or at any point afterward when the overlay should be re-shown after removing. The onDraw() method will then be called whenever a map property changes that could change the position of the element, such as zoom, center, or map type. WebGLOverlayView may only be added to a vector map having a {@link google.maps.MapOptions.mapId} (including maps set to the {@link google.maps.RenderingType.VECTOR} {@link google.maps.MapOptions.renderingType} and using {@link google.maps.Map.DEMO_MAP_ID} as the {@link google.maps.MapOptions.mapId}). + * Access by calling `const {WebGLOverlayView} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum VehicleNavigationStatus { - /** - * The vehicle is within approximately 50m of the destination. - */ - ARRIVED_AT_DESTINATION = 'ARRIVED_AT_DESTINATION', - /** - * Turn-by-turn navigation is available and the Driver app navigation has entered GUIDED_NAV mode. - */ - ENROUTE_TO_DESTINATION = 'ENROUTE_TO_DESTINATION', - /** - * The Driver app's navigation is in FREE_NAV mode. - */ - NO_GUIDANCE = 'NO_GUIDANCE', + export class WebGLOverlayView extends google.maps.MVCObject { /** - * The vehicle has gone off the suggested route. + * Creates a WebGLOverlayView. */ - OFF_ROUTE = 'OFF_ROUTE', + constructor(); + + getMap(): google.maps.Map | null | undefined; /** - * Unspecified navigation status. + * Implement this method to fetch or create intermediate data structures before the overlay is drawn that don’t require immediate access to the WebGL rendering context. This method must be implemented to render. */ - UNKNOWN_NAVIGATION_STATUS = 'UNKNOWN_NAVIGATION_STATUS', - } - export type VehicleNavigationStatusString = `${google.maps.journeySharing.VehicleNavigationStatus}`; - /** - * The current state of a {@link google.maps.journeySharing.Vehicle}. - * - * Access by calling `const {VehicleState} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum VehicleState { + onAdd(): void; /** - * The vehicle is not accepting new trips. + * This method is called when the rendering context is lost for any reason, and is where you should clean up any pre-existing GL state, since it is no longer needed. */ - OFFLINE = 'OFFLINE', + onContextLost(): void; /** - * The vehicle is accepting new trips. + * This method is called once the rendering context is available. Use it to initialize or bind any WebGL state such as shaders or buffer objects. */ - ONLINE = 'ONLINE', + onContextRestored(options: google.maps.WebGLStateOptions): void; /** - * Unknown vehicle state. + * Implement this method to draw WebGL content directly on the map. Note that if the overlay needs a new frame drawn then call {@link google.maps.WebGLOverlayView.requestRedraw}. */ - UNKNOWN_VEHICLE_STATE = 'UNKNOWN_VEHICLE_STATE', - } - export type VehicleStateString = `${google.maps.journeySharing.VehicleState}`; - /** - * The type of {@link google.maps.journeySharing.Vehicle}. - * - * Access by calling `const {VehicleType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum VehicleType { + onDraw(options: google.maps.WebGLDrawOptions): void; /** - * An automobile. + * This method is called when the overlay is removed from the map with WebGLOverlayView.setMap(null), and is where you should remove all intermediate objects. This method must be implemented to render. */ - AUTO = 'AUTO', + onRemove(): void; /** - * Any vehicle that acts as a taxi (typically licensed or regulated). + * Implement this method to handle any GL state updates outside of the render animation frame. */ - TAXI = 'TAXI', + onStateUpdate(options: google.maps.WebGLStateOptions): void; /** - * A vehicle with a large storage capacity. + * Triggers the map to redraw a frame. */ - TRUCK = 'TRUCK', + requestRedraw(): void; /** - * A motorcycle, moped, or other two-wheeled vehicle. + * Triggers the map to update GL state. */ - TWO_WHEELER = 'TWO_WHEELER', + requestStateUpdate(): void; /** - * Unknown vehicle type. + * Adds the overlay to the map. */ - UNKNOWN = 'UNKNOWN', + setMap(map?: google.maps.Map | null): void; } - export type VehicleTypeString = `${google.maps.journeySharing.VehicleType}`; /** - * Trip types supported by a {@link google.maps.journeySharing.Vehicle}. - * - * Access by calling `const {TripType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * GL state options. */ - export enum TripType { - /** - * The trip is exclusive to a vehicle. - */ - EXCLUSIVE = 'EXCLUSIVE', + export interface WebGLStateOptions { /** - * The trip may share a vehicle with other trips. + * The WebGLRenderingContext on which to render this WebGLOverlayView. */ - SHARED = 'SHARED', + gl: WebGLRenderingContext; + } + /** + * This event is created from monitoring zoom change. + * Access by calling `const {ZoomChangeEvent} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class ZoomChangeEvent extends Event { + } + /** + * Options for the rendering of the zoom control. + */ + export interface ZoomControlOptions { /** - * Unknown trip type. + * Position id. Used to specify the position of the control on the map. + * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END} */ - UNKNOWN_TRIP_TYPE = 'UNKNOWN_TRIP_TYPE', + position?: google.maps.ControlPosition | null; } - export type TripTypeString = `${google.maps.journeySharing.TripType}`; /** - * Waypoint types supported by {@link google.maps.journeySharing.Vehicle}. - * - * Access by calling `const {WaypointType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Loads a library of the Maps JavaScript API, resolving with the direct members of that API (without namespacing). (When loaded, libraries also add themselves to the global google.maps namespace, though using the global namespace is not generally recommended.) */ - export enum WaypointType { + export function importLibrary(libraryName: K): Promise; + export function importLibrary(libraryName: string): Promise; + export interface ImportLibraryMap { + "core": google.maps.CoreLibrary; + "maps": google.maps.MapsLibrary; + "geocoding": google.maps.GeocodingLibrary; + "streetView": google.maps.StreetViewLibrary; + "maps3d": google.maps.Maps3DLibrary; + "places": google.maps.PlacesLibrary; + "routes": google.maps.RoutesLibrary; + "marker": google.maps.MarkerLibrary; + "geometry": google.maps.GeometryLibrary; + "elevation": google.maps.ElevationLibrary; + "journeySharing": google.maps.JourneySharingLibrary; + "drawing": google.maps.DrawingLibrary; + "visualization": google.maps.VisualizationLibrary; + "addressValidation": google.maps.AddressValidationLibrary; + "airQuality": google.maps.AirQualityLibrary; + } + /** + * Google Maps JavaScript API version loaded by the browser. See https://developers.google.com/maps/documentation/javascript/versions + */ + export const version: string; +} + +declare namespace google.maps.addressValidation { + /** + * Details of the post-processed address. Post-processing includes correcting misspelled parts of the address, replacing incorrect parts, and inferring missing parts. + * Access by calling `const {Address} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Address { /** - * Waypoints for dropping off riders. + * The individual address components of the formatted and corrected address, along with validation information. This provides information on the validation status of the individual components. */ - DROP_OFF_WAYPOINT_TYPE = 'DROP_OFF_WAYPOINT_TYPE', + get components(): google.maps.addressValidation.AddressComponent[]; /** - * Waypoints for intermediate destinations in a multi-destination trip. + * The post-processed address, formatted as a single-line address following the address-formatting rules of the region where the address is located. */ - INTERMEDIATE_DESTINATION_WAYPOINT_TYPE = 'INTERMEDIATE_DESTINATION_WAYPOINT_TYPE', + get formattedAddress(): string | null; /** - * Waypoints for picking up riders. + * The types of components that were expected to be present in a correctly formatted mailing address but were not found in the input AND could not be inferred. Components of this type are not present in formatted_address, postal_address, or address_components. An example might be ['street_number', 'route'] for an input like "Boulder, Colorado, 80301, USA". The list of possible types can be found here. */ - PICKUP_WAYPOINT_TYPE = 'PICKUP_WAYPOINT_TYPE', + get missingComponentTypes(): string[]; /** - * Unknown waypoint type. + * The post-processed address represented as a postal address. */ - UNKNOWN_WAYPOINT_TYPE = 'UNKNOWN_WAYPOINT_TYPE', - } - export type WaypointTypeString = `${google.maps.journeySharing.WaypointType}`; - /** - * TaskInfo type, used by {@link google.maps.journeySharing.DeliveryVehicleStop}. - */ - export interface TaskInfo { + get postalAddress(): google.maps.places.PostalAddress | null; /** - * The extra time it takes to perform the task, in milliseconds. + * The types of the components that are present in the address_components but could not be confirmed to be correct. This field is provided for the sake of convenience: its contents are equivalent to iterating through the address_components to find the types of all the components where the {@link google.maps.addressValidation.AddressComponent.confirmationLevel} is not {@link google.maps.addressValidation.ConfirmationLevel.CONFIRMED} or the {@link google.maps.addressValidation.AddressComponent.inferred} flag is not set to true. The list of possible types can be found here. */ - extraDurationMillis: number | null; + get unconfirmedComponentTypes(): string[]; /** - * The ID of the task. + * Any tokens in the input that could not be resolved. This might be an input that was not recognized as a valid part of an address (for example in an input like "123235253253 Main St, San Francisco, CA, 94105", the unresolved tokens may look like ["123235253253"] since that does not look like a valid street number. */ - id: string | null; + get unresolvedTokens(): string[]; /** - * The time window during which the task should be completed. + * Converts to a plain object. */ - targetTimeWindow: google.maps.journeySharing.TimeWindow | null; + toJSON(key?: string): unknown; } /** - * DeliveryVehicleStop type + * Represents a single component of an address (ex. street name, city). + * Access by calling `const {AddressComponent} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface DeliveryVehicleStop { + export class AddressComponent { /** - * The location of the stop. + * The component name text. For example, "5th Avenue" for a street name or "1253" for a street number, */ - plannedLocation: google.maps.LatLngLiteral | null; + get componentName(): string | null; /** - * The state of the stop. + * The BCP-47 language code. This will not be present if the component name is not associated with a language, such as a street number. */ - state: google.maps.journeySharing.DeliveryVehicleStopStateString | null; + get componentNameLanguageCode(): string | null; /** - * The list of Tasks to be performed at this stop.
  • id: the ID of the task.
  • extraDurationMillis: the extra time it takes to perform the task, in milliseconds.
+ * The type of the address component. See Table 2: Additional types returned by the Places service for a list of possible types. */ - tasks: google.maps.journeySharing.TaskInfo[]; - } - /** - * VehicleJourneySegment type - */ - export interface VehicleJourneySegment { + get componentType(): string | null; /** - * The travel distance from the previous stop to this stop, in meters. + * Indicates the level of certainty that the component is correct. */ - drivingDistanceMeters: number | null; + get confirmationLevel(): google.maps.addressValidation.ConfirmationLevelString | null; /** - * The travel time from the previous stop this stop, in milliseconds. + * If true, this component was not part of the input, but was inferred for the address location. Including this component is recommended for a complete address. */ - drivingDurationMillis: number | null; + get inferred(): boolean; /** - * The path from the previous stop (or the vehicle's current location, if this stop is the first in the list of stops) to this stop. + * Indicates the name of the component was replaced with a completely different one. For example, replacing a wrong postal code being with one that is correct for the address. This is not a cosmetic change; the input component has been changed to a different one. */ - path: google.maps.LatLngLiteral[] | null; + get replaced(): boolean; /** - * Information about the stop. + * Indicates a correction to a misspelling in the component name. The API does not always flag changes from one spelling variant to another, such as "centre" to "center". */ - stop: google.maps.journeySharing.DeliveryVehicleStop | null; + get spellCorrected(): boolean; + /** + * If true, this component is not expected to be present in a postal address for the given region. It has been retained only because it was part of the input. + */ + get unexpected(): boolean; } /** - * VehicleLocationUpdate type + * The metadata for the address. AddressMetadata is not guaranteed to be fully populated for every address sent to the Address Validation API. + * Access by calling `const {AddressMetadata} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface VehicleLocationUpdate { + export class AddressMetadata { + + get business(): boolean; + + get poBox(): boolean; + + get residential(): boolean; /** - * The heading of the update. 0 corresponds to north, 180 to south. + * Converts to a plain object. */ - heading: number | null; + toJSON(key?: string): unknown; + } + /** + * Static class for accessing the AddressValidation APIs. + * Access by calling `const {AddressValidation} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class AddressValidation { /** - * The location of the update. + * Information about the address itself as opposed to the geocode. */ - location: google.maps.LatLngLiteral | google.maps.LatLng | null; + get address(): google.maps.addressValidation.Address | null; /** - * The speed in kilometers per hour. + * Information about the location and place that the address geocoded to. */ - speedKilometersPerHour: number | null; + get geocode(): google.maps.addressValidation.Geocode | null; /** - * The time this update was received from the vehicle. + * Other information relevant to deliverability. metadata is not guaranteed to be fully populated for every address sent to the Address Validation API. */ - time: Date | null; - } - /** - * VehicleWaypoint type. - */ - export interface VehicleWaypoint { + get metadata(): google.maps.addressValidation.AddressMetadata | null; /** - * The path distance between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in meters. + * The UUID that identifies this response. If the address needs to be re-validated, this UUID must accompany the new request. */ - distanceMeters: number | null; + get responseId(): string | null; /** - * Travel time between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in milliseconds. + * Extra deliverability flags provided by USPS. Only provided in region US and PR. */ - durationMillis: number | null; + get uspsData(): google.maps.addressValidation.USPSData | null; /** - * The location of the waypoint. + * Overall verdict flags */ - location: google.maps.LatLngLiteral | null; + get verdict(): google.maps.addressValidation.Verdict | null; /** - * The path from the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint. + * Validates an address. See https://developers.google.com/maps/documentation/javascript/address-validation/validate-address. */ - path: google.maps.LatLngLiteral[] | null; + static fetchAddressValidation(request: google.maps.addressValidation.AddressValidationRequest): Promise; /** - * The list of traffic speeds along the path from the previous waypoint (or vehicle location) to the current waypoint. Each interval in the list describes the traffic on a contiguous segment on the path; the interval defines the starting and ending points of the segment via their indices. See the definition of {@link google.maps.journeySharing.SpeedReadingInterval} for more details. + * Converts to a plain object. */ - speedReadingIntervals: google.maps.journeySharing.SpeedReadingInterval[] | null; + toJSON(key?: string): unknown; } /** - * TripWaypoint type. + * Request interface for {@link google.maps.addressValidation.AddressValidation.fetchAddressValidation}. */ - export interface TripWaypoint { - /** - * The path distance between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in meters. - */ - distanceMeters: number | null; - /** - * Travel time between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in milliseconds. - */ - durationMillis: number | null; + export interface AddressValidationRequest { /** - * The location of the waypoint. + * The address being validated. Unformatted addresses should be submitted via {@link google.maps.places.PostalAddress.addressLines}. */ - location: google.maps.LatLng | null; + address: google.maps.places.PostalAddressLiteral; /** - * The path from the previous stop (or the vehicle's current location, if this stop is the first in the list of stops) to this stop. + * If using a PlaceAutocompleteElement, include it here to link the AddressValidation API calls with the autocomplete session token. */ - path: google.maps.LatLng[] | null; + placeAutocompleteElement?: google.maps.places.PlaceAutocompleteElement; /** - * The list of traffic speeds along the path from the previous waypoint (or vehicle location) to the current waypoint. Each interval in the list describes the traffic on a contiguous segment on the path; the interval defines the starting and ending points of the segment via their indices. See the definition of {@link google.maps.journeySharing.SpeedReadingInterval} for more details. + * This field must not be set for the first address validation request. If more requests are necessary to fully validate a single address (for example if the changes the user makes after the initial validation need to be re-validated), then each followup request must populate this field with the {@link google.maps.addressValidation.AddressValidation.responseId} from the very first response in the validation sequence. */ - speedReadingIntervals: google.maps.journeySharing.SpeedReadingInterval[] | null; + previousResponseId?: string; /** - * The trip associated with this waypoint. + * A token which identifies an Autocomplete session for billing purposes. */ - tripId: string | null; + sessionToken?: google.maps.places.AutocompleteSessionToken; /** - * The role this waypoint plays in this trip, such as pickup or dropoff. + * Enables USPS CASS compatible mode. This affects only the {@link google.maps.addressValidation.AddressValidation.uspsData} field of {@link google.maps.addressValidation.AddressValidation}. Note: for USPS CASS enabled requests for addresses in Puerto Rico, a {@link google.maps.places.PostalAddress.regionCode} of the address must be provided as "PR", or an {@link google.maps.places.PostalAddress.administrativeArea} of the address must be provided as "Puerto Rico" (case-insensitive) or "PR". */ - waypointType: google.maps.journeySharing.WaypointTypeString | null; + uspsCASSEnabled?: boolean; } /** - * The classification of polyline speed based on traffic data. + * The different possible values indicating the level of certainty that the component is correct. * - * Access by calling `const {Speed} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {ConfirmationLevel} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum Speed { - /** - * Normal speed, no slowdown is detected. - */ - NORMAL = 'NORMAL', + export enum ConfirmationLevel { + + CONFIRMED = 'CONFIRMED', + + UNCONFIRMED_AND_SUSPICIOUS = 'UNCONFIRMED_AND_SUSPICIOUS', + + UNCONFIRMED_BUT_PLAUSIBLE = 'UNCONFIRMED_BUT_PLAUSIBLE', + } + export type ConfirmationLevelString = `${google.maps.addressValidation.ConfirmationLevel}`; + /** + * Contains information about the place the input was geocoded to. + * Access by calling `const {Geocode} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Geocode { /** - * Slowdown detected, but no traffic jam formed. + * The bounds of the geocoded place. */ - SLOW = 'SLOW', + get bounds(): google.maps.LatLngBounds | null; /** - * Traffic jam detected. + * The size of the geocoded place, in meters. This is another measure of the coarseness of the geocoded location, but in physical size rather than in semantic meaning. */ - TRAFFIC_JAM = 'TRAFFIC_JAM', - } - export type SpeedString = `${google.maps.journeySharing.Speed}`; - /** - * Traffic density indicator on a contiguous path segment. The interval defines the starting and ending points of the segment via their indices. - */ - export interface SpeedReadingInterval { + get featureSizeMeters(): number | null; /** - * The zero-based index of the ending point of the interval in the path. + * The geocoded location of the input. */ - endPolylinePointIndex: number; + get location(): google.maps.LatLngAltitude | null; /** - * Traffic speed in this interval. + * The Place ID of the geocoded place. Using Place is preferred over using addresses, latitude/longitude coordinates, or plus codes. Using coordinates for routing or calculating driving directions will always result in the point being snapped to the road nearest to those coordinates. This may not be a road that will quickly or safely lead to the destination and may not be near an access point to the property. Additionally, when a location is reverse geocoded, there is no guarantee that the returned address will match the original. */ - speed: google.maps.journeySharing.SpeedString; + get placeId(): string | null; /** - * The zero-based index of the starting point of the interval in the path. + * The type(s) of place that the input geocoded to. For example, ['locality', 'political']. The full list of types can be found in the Geocoding API documentation. */ - startPolylinePointIndex: number; - } - /** - * Options for shipment location provider. - */ - export interface FleetEngineShipmentLocationProviderOptions { + get placeTypes(): string[]; /** - * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * The plus code corresponding to the location. */ - activePolylineCustomization?: ((arg0: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + get plusCode(): google.maps.places.PlusCode | null; /** - * Provides JSON Web Tokens for authenticating the client to Fleet Engine. + * Returns a Place representation of this Geocode. To get full place details, a call to place.fetchFields() should be made. */ - authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; + fetchPlace(): void; /** - * 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 {@link google.maps.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 {@link google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Converts to a plain object. */ - deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + toJSON(key?: string): unknown; + } + /** + * The various granularities that an address or a geocode can have. When used to indicate granularity for an address, these values indicate with how fine a granularity the address identifies a mailing destination. For example, an address such as "123 Main Street, Redwood City, CA, 94061" identifies a PREMISE while something like "Redwood City, CA, 94061" identifies a LOCALITY. However, if we are unable to find a geocode for "123 Main Street" in Redwood City, the geocode returned might be of LOCALITY granularity even though the address is more granular. + * + * Access by calling `const {Granularity} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum Granularity { /** - * 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 {@link google.maps.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 {@link google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * The address or geocode indicates a block. Only used in regions which have block-level addressing, such as Japan. */ - destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + BLOCK = 'BLOCK', /** - * 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. + * All other granularities, which are bucketed together since they are not deliverable. */ - pollingIntervalMillis: number | null; + OTHER = 'OTHER', /** - * The consumer's project ID from Google Cloud Console. + * Building-level result. */ - projectId: string; + PREMISE = 'PREMISE', /** - * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * A geocode that approximates the building-level location of the address. */ - remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + PREMISE_PROXIMITY = 'PREMISE_PROXIMITY', /** - * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * The geocode or address is granular to route, such as a street, road, or highway. */ - takenPolylineCustomization?: ((arg0: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + ROUTE = 'ROUTE', /** - * 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 {@link google.maps.journeySharing.FleetEngineShipmentLocationProvider.trackingId} to set the tracking ID and begin tracking. + * Below-building level result, such as an apartment. */ - trackingId: string | null; + SUB_PREMISE = 'SUB_PREMISE', } + export type GranularityString = `${google.maps.addressValidation.Granularity}`; /** - * Shipment location provider. - * Access by calling `const {FleetEngineShipmentLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Offers an interpretive summary of the API response, intended to assist in determining a potential subsequent action to take. This field is derived from other fields in the API response and should not be considered as a guarantee of address accuracy or deliverability. + * + * Access by calling `const {PossibleNextAction} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class FleetEngineShipmentLocationProvider extends google.maps.journeySharing.PollingLocationProvider { + export enum PossibleNextAction { /** - * Creates a new location provider for Fleet Engine shipment tracking. - * @param options Options for the location provider. + * The API response does not contain signals that warrant one of the other PossibleNextAction values. You might consider using the post-processed address without further prompting your customer, though this does not guarantee the address is valid, and the address might still contain corrections. It is your responsibility to determine if and how to prompt your customer, depending on your own risk assessment. */ - constructor(options: google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions); + ACCEPT = 'ACCEPT', /** - * The tracking ID for the task that this location provider observes. Set this field to begin tracking. + * One or more fields of the API response indicate potential minor issues with the post-processed address, for example the postal_code address component was replaced. Prompting your customer to review the address could help improve the quality of the address. */ - trackingId: string; + CONFIRM = 'CONFIRM', /** - * Explicitly refreshes the tracked location. + * The API response indicates the post-processed address might be missing a subpremises. Prompting your customer to review the address and consider adding a unit number could help improve the quality of the address. The post-processed address might also have other minor issues. Note: this enum value can only be returned for US addresses. */ - refresh(): void; - } - /** - * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineShipmentLocationProvider.update} event is triggered. - */ - export interface FleetEngineShipmentLocationProviderUpdateEvent { + CONFIRM_ADD_SUBPREMISES = 'CONFIRM_ADD_SUBPREMISES', /** - * The task tracking info structure returned by the update. Unmodifiable. + * One or more fields of the API response indicate a potential issue with the post-processed address, for example the verdict.validation_granularity is OTHER. Prompting your customer to edit the address could help improve the quality of the address. */ - taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo | null; + FIX = 'FIX', } + export type PossibleNextActionString = `${google.maps.addressValidation.PossibleNextAction}`; /** - * A time range. + * USPS representation of a US address. + * Access by calling `const {USPSAddress} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface TimeWindow { + export class USPSAddress { /** - * The end time of the time window (inclusive). + * The city name. */ - endTime: Date; + get city(): string | null; /** - * The start time of the time window (inclusive). + * The address line containing the city, state, and zip code. */ - startTime: Date; - } - /** - * The details for a task tracking info object returned by Fleet Engine. - */ - export interface TaskTrackingInfo { + get cityStateZipAddressLine(): string | null; /** - * Attributes assigned to the task. + * The name of the firm. */ - attributes: { [key: string]: unknown }; + get firm(): string | null; /** - * The estimated arrival time to the stop location. + * The first line of the address. */ - estimatedArrivalTime: Date | null; + get firstAddressLine(): string | null; /** - * The estimated completion time of a Task. + * The second line of the address. */ - estimatedTaskCompletionTime: Date | null; + get secondAddressLine(): string | null; /** - * Information specific to the last location update. + * The 2-letter state code. */ - latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; + get state(): string | null; /** - * The name in the format "providers/{provider_id}/taskTrackingInfo/{tracking_id}", where tracking_id represents the tracking ID. + * The Puerto Rican urbanization name. */ - name: string; + get urbanization(): string | null; /** - * The location where the Task will be completed. + * The Postal code, e.g. "10009". */ - plannedLocation: google.maps.LatLng | null; + get zipCode(): string | null; /** - * The total remaining distance in meters to the VehicleStop of interest. + * The 4-digit postal code extension, e.g. "5023". */ - remainingDrivingDistanceMeters: number | null; + get zipCodeExtension(): string | null; /** - * Indicates the number of stops the vehicle remaining until the task stop is reached, including the task stop. For example, if the vehicle's next stop is the task stop, the value will be 1. + * Converts to a plain object. */ - remainingStopCount: number | null; + toJSON(key?: string): unknown; + } + /** + * The USPS data for the address. USPSData is not guaranteed to be fully populated for every US or PR address sent to the Address Validation API. It's recommended to integrate the backup address fields in the response if you utilize uspsData as the primary part of the response. + * Access by calling `const {USPSData} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class USPSData { /** - * A list of points which when connected forms a polyline of the vehicle's expected route to the location of this task. + * Abbreviated city. */ - routePolylinePoints: google.maps.LatLng[] | null; + get abbreviatedCity(): string | null; /** - * The current execution state of the Task. + * Type of the address record that matches the input address. */ - state: string | null; + get addressRecordType(): string | null; /** - * The time window during which the task should be completed. + * The carrier route code. A four character code consisting of a one letter prefix and a three digit route designator. */ - targetTimeWindow: google.maps.journeySharing.TimeWindow | null; + get carrierRoute(): string | null; /** - * The outcome of attempting to execute a Task. + * Carrier route rate sort indicator. */ - taskOutcome: string | null; + get carrierRouteIndicator(): string | null; /** - * The time when the Task's outcome was set by the provider. + * Indicator that the request has been CASS processed. */ - taskOutcomeTime: Date | null; + get cassProcessed(): boolean; /** - * The tracking ID of a Task.
  • Must be a valid Unicode string.
  • Limited to a maximum length of 64 characters.
  • Normalized according to Unicode Normalization Form C.
  • May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
+ * County name. */ - trackingId: string; - } - /** - * The details for a task returned by Fleet Engine. - */ - export interface Task { + get county(): string | null; /** - * Attributes assigned to the task. + * The delivery point check digit. This number is added to the end of the delivery_point_barcode for mechanically scanned mail. Adding all the digits of the delivery_point_barcode, delivery_point_check_digit, postal code, and ZIP+4 together should yield a number divisible by 10. */ - attributes: { [key: string]: unknown }; + get deliveryPointCheckDigit(): string | null; /** - * The timestamp of the estimated completion time of the task. + * The 2-digit delivery point code. */ - estimatedCompletionTime: Date | null; + get deliveryPointCode(): string | null; /** - * Information specific to the last location update. + * Indicates if the address is a CMRA (Commercial Mail Receiving Agency)--a private business receiving mail for clients. Returns a single character. */ - latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; + get dpvCMRA(): string | null; /** - * The task name in the format "providers/{provider_id}/tasks/{task_id}". The task_id must be a unique identifier and not a tracking ID. To store a tracking ID of a shipment, use the tracking_id field. Multiple tasks can have the same tracking_id. + * The possible values for DPV confirmation. Returns a single character or returns no value. */ - name: string; + get dpvConfirmation(): string | null; /** - * The outcome of the task. + * Flag indicates addresses where USPS cannot knock on a door to deliver mail. Returns a single character. */ - outcome: string | null; + get dpvDoorNotAccessible(): string | null; /** - * The location where the task was completed (from provider). + * Flag indicates mail is delivered to a single receptable at a site. Returns a single character. */ - outcomeLocation: google.maps.LatLngLiteral | null; + get dpvDrop(): string | null; /** - * The setter of the task outcome location ('PROVIDER' or 'LAST_VEHICLE_LOCATION'). + * Indicates that more than one DPV return code is valid for the address. Returns a single character. */ - outcomeLocationSource: string | null; + get dpvEnhancedDeliveryCode(): string | null; /** - * The timestamp of when the task's outcome was set (from provider). + * The footnotes from delivery point validation. Multiple footnotes may be strung together in the same string. */ - outcomeTime: Date | null; + get dpvFootnote(): string | null; /** - * The location where the task is to be completed. + * Flag indicates mail delivery is not performed every day of the week. Returns a single character. */ - plannedLocation: google.maps.LatLngLiteral | null; + get dpvNonDeliveryDays(): string | null; /** - * Information about the segments left to be completed for this task. + * Integer identifying non-delivery days. It can be interrogated using bit flags: 0x40 – Sunday is a non-delivery day 0x20 – Monday is a non-delivery day 0x10 – Tuesday is a non-delivery day 0x08 – Wednesday is a non-delivery day 0x04 – Thursday is a non-delivery day 0x02 – Friday is a non-delivery day 0x01 – Saturday is a non-delivery day */ - remainingVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[]; + get dpvNonDeliveryDaysValues(): number | null; /** - * The current execution state of the task. + * Flag indicates door is accessible, but package will not be left due to security concerns. Returns a single character. */ - status: string; + get dpvNoSecureLocation(): string | null; /** - * The time window during which the task should be completed. + * Indicates whether the address is a no stat address or an active address. No stat addresses are ones which are not continuously occupied or addresses that the USPS does not service. Returns a single character. */ - targetTimeWindow: google.maps.journeySharing.TimeWindow | null; + get dpvNoStat(): string | null; /** - * The tracking ID of the shipment. + * Indicates the NoStat type. Returns a reason code as int. */ - trackingId: string | null; + get dpvNoStatReasonCode(): number | null; /** - * The task type; for example, a break or shipment. + * Indicates the address was matched to PBSA record. Returns a single character. */ - type: string; + get dpvPBSA(): string | null; /** - * The ID of the vehicle performing this task. + * Indicates that mail is not delivered to the street address. Returns a single character. */ - vehicleId: string | null; - } - /** - * Options for trip location provider. - */ - export interface FleetEngineTripLocationProviderOptions { + get dpvThrowback(): string | null; /** - * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.TripPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Indicates whether the address is vacant. Returns a single character. */ - activePolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + get dpvVacant(): string | null; /** - * Provides JSON Web Tokens for authenticating the client to Fleet Engine. + * eLOT Ascending/Descending Flag (A/D). */ - authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; + get elotFlag(): string | null; /** - * 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 {@link google.maps.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 {@link google.maps.journeySharing.TripMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Enhanced Line of Travel (eLOT) number. */ - destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + get elotNumber(): string | null; /** - * Customization applied to the origin marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TripMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Error message for USPS data retrieval. This is populated when USPS processing is suspended because of the detection of artificially created addresses. */ - originMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + get errorMessage(): string | null; /** - * 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. + * FIPS county code. */ - pollingIntervalMillis: number | null; + get fipsCountyCode(): string | null; /** - * The consumer's project ID from Google Cloud Console. + * Indicator that a default address was found, but more specific addresses exist. */ - projectId: string; + get hasDefaultAddress(): boolean; /** - * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.TripPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * The delivery address is matchable, but the EWS file indicates that an exact match will be available soon. */ - remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + get hasNoEWSMatch(): boolean; /** - * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.TripPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * LACSLink indicator. */ - takenPolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + get lacsLinkIndicator(): string | null; /** - * The trip ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any trip; use {@link google.maps.journeySharing.FleetEngineTripLocationProvider.tripId} to set the ID and begin tracking. + * LACSLink return code. */ - tripId: string | null; + get lacsLinkReturnCode(): string | null; /** - * Customization applied to the vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TripMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * PMB (Private Mail Box) unit designator. */ - vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + get pmbDesignator(): string | null; /** - * Customization applied to a waypoint marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TripWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * PMB (Private Mail Box) number. */ - waypointMarkerCustomization?: ((arg0: google.maps.journeySharing.TripWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; - } - /** - * Trip location provider. - * Access by calling `const {FleetEngineTripLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class FleetEngineTripLocationProvider extends google.maps.journeySharing.PollingLocationProvider { + get pmbNumber(): string | null; /** - * Creates a new location provider for a Fleet Engine trip. - * @param options Options for the location provider. + * PO Box only postal code. */ - constructor(options: google.maps.journeySharing.FleetEngineTripLocationProviderOptions); + get poBoxOnlyPostalCode(): boolean; /** - * The ID for the trip that this location provider observes. Set this field to begin tracking. + * Main post office city. */ - tripId: string; + get postOfficeCity(): string | null; /** - * Polyline customization function that colors the active polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.activePolylineCustomization} to render a traffic-aware polyline for the active polyline. + * Main post office state. */ - static TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.TripPolylineCustomizationFunctionParams): void; + get postOfficeState(): string | null; /** - * Polyline customization function that colors the remaining polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.remainingPolylineCustomization} to render a traffic-aware polyline for the remaining polyline. + * USPS standardized address. */ - static TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.TripPolylineCustomizationFunctionParams): void; + get standardizedAddress(): google.maps.addressValidation.USPSAddress | null; /** - * Explicitly refreshes the tracked location. + * Footnotes from matching a street or highrise record to suite information. If business name match is found, the secondary number is returned. */ - refresh(): void; - } - /** - * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineTripLocationProvider.update} event is triggered. - */ - export interface FleetEngineTripLocationProviderUpdateEvent { + get suiteLinkFootnote(): string | null; /** - * The trip structure returned by the update. Unmodifiable. + * Converts to a plain object. */ - trip: google.maps.journeySharing.Trip | null; + toJSON(key?: string): unknown; } /** - * The details for a trip returned by Fleet Engine. + * Represents the post-processed address for the supplied address. + * Access by calling `const {Verdict} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface Trip { - /** - * Location where the customer was dropped off. - */ - actualDropOffLocation: google.maps.LatLngLiteral | null; + export class Verdict { /** - * Location where the customer was picked up. + * The address is considered complete if there are no unresolved tokens, no unexpected or missing address components. If unset, indicates that the value is false. See {@link google.maps.addressValidation.Address.missingComponentTypes}, {@link google.maps.addressValidation.Address.unresolvedTokens} or {@link google.maps.addressValidation.AddressComponent.unexpected} fields for more details. */ - actualPickupLocation: google.maps.LatLngLiteral | null; + get addressComplete(): boolean; /** - * The estimated future time when the passengers will be dropped off, or the actual time when they were dropped off. + * Information about the granularity of the {@link google.maps.addressValidation.Geocode}. This can be understood as the semantic meaning of how coarse or fine the geocoded location is. */ - dropOffTime: Date | null; + get geocodeGranularity(): google.maps.addressValidation.GranularityString | null; /** - * Information specific to the last location update. + * At least one address component was inferred (i.e. added) that wasn't in the input, see {@link google.maps.addressValidation.AddressComponent} for details. */ - latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; + get hasInferredComponents(): boolean; /** - * In the format "providers/{provider_id}/trips/{trip_id}". The trip_id must be a unique identifier. + * At least one address component was replaced - see {@link google.maps.addressValidation.AddressComponent} for details. */ - name: string; + get hasReplacedComponents(): boolean | null; /** - * Number of passengers on this trip; does not include the driver. + * At least one address component cannot be categorized or validated, see {@link google.maps.addressValidation.AddressComponent} for details. */ - passengerCount: number; + get hasUnconfirmedComponents(): boolean; /** - * The estimated future time when the passengers will be picked up, or the actual time when they were picked up. + * The granularity of the input address. This is the result of parsing the input address and does not give any validation signals. For validation signals, refer to validationGranularity. */ - pickupTime: Date | null; + get inputGranularity(): google.maps.addressValidation.GranularityString | null; /** - * Location where the customer indicates they will be dropped off. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * A possible next action to take based on other fields in the API response. See {@link google.maps.addressValidation.PossibleNextAction} for details. */ - plannedDropOffLocation: google.maps.LatLngLiteral | null; + get possibleNextAction(): google.maps.addressValidation.PossibleNextActionString | null; /** - * Location where customer indicates they will be picked up. + * The granularity level that the API can fully validate the address to. For example, a validationGranularity of PREMISE indicates all address components at the level of PREMISE and broader can be validated. */ - plannedPickupLocation: google.maps.LatLngLiteral | null; + get validationGranularity(): google.maps.addressValidation.GranularityString | null; + } +} + +declare namespace google.maps.airQuality { + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Displays air quality information for a given location. + * Access by calling `const {AirQualityMeterElement} = await google.maps.importLibrary("airQuality");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class AirQualityMeterElement extends HTMLElement implements google.maps.airQuality.AirQualityMeterElementOptions { /** - * An array of waypoints indicating the path from the current location to the drop-off point. + * + * @param options */ - remainingWaypoints: google.maps.journeySharing.VehicleWaypoint[]; + constructor(options?: google.maps.airQuality.AirQualityMeterElementOptions); /** - * Current status of the trip. Possible values are UNKNOWN_TRIP_STATUS, NEW, ENROUTE_TO_PICKUP, ARRIVED_AT_PICKUP, ARRIVED_AT_INTERMEDIATE_DESTINATION, ENROUTE_TO_INTERMEDIATE_DESTINATION, ENROUTE_TO_DROPOFF, COMPLETE, or CANCELED. + * The location to render the air quality meter for. Normalizes to a LatLngAltitude. + * @defaultValue null */ - status: string; + get location(): google.maps.LatLngAltitude | null; /** - * The type of the trip. Possible values are UNKNOWN_TRIP_TYPE, SHARED or EXCLUSIVE. + * The location to render the air quality meter for. Normalizes to a LatLngAltitude. + * @defaultValue null */ - type: string; + set location(value: google.maps.LatLngLiteral | google.maps.LatLng | google.maps.LatLngAltitudeLiteral | google.maps.LatLngAltitude | null | undefined); /** - * ID of the vehicle making this trip. + * An override for the language to request from the Air Quality API. See the list of supported languages. + * @defaultValue null */ - vehicleId: string; + requestedLanguage: string | null; + addEventListener(type: K, listener: (this: AirQualityMeterElement, ev: AirQualityMeterElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface AirQualityMeterElementEventMap extends HTMLElementEventMap { + "gmp-error": Event; + "gmp-load": Event; } /** - * Filtering options for tasks in the Delivery Vehicle Location Provider. + * AirQualityMeterElement options. */ - export interface FleetEngineTaskFilterOptions { + export interface AirQualityMeterElementOptions { /** - * Exclusive lower bound for the completion time of the task. Used to filter for tasks that were completed after the specified time. + * See {@link google.maps.airQuality.AirQualityMeterElement.location} */ - completionTimeFrom: Date | null; + location?: google.maps.LatLngLiteral | google.maps.LatLng | google.maps.LatLngAltitudeLiteral | google.maps.LatLngAltitude | null; /** - * Exclusive upper bound for the completion time of the task. Used to filter for tasks that were completed before the specified time. + * See {@link google.maps.airQuality.AirQualityMeterElement.requestedLanguage} */ - completionTimeTo: Date | null; + requestedLanguage?: string | null; + } +} + +declare namespace google.maps.Data { + /** + * The properties of a addfeature event. + */ + export interface AddFeatureEvent { /** - * The state of the task. Valid values are OPEN or CLOSED. + * The feature that was added to the FeatureCollection. */ - state: string | null; + feature: google.maps.Data.Feature; } /** - * Options for delivery vehicle location provider. + * DataOptions object used to define the properties that a developer can set on a Data object. */ - export interface FleetEngineDeliveryVehicleLocationProviderOptions { + export interface DataOptions { /** - * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * The position of the drawing controls on the map. + * @defaultValue {@link google.maps.ControlPosition.TOP_LEFT} */ - activePolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + controlPosition?: google.maps.ControlPosition; /** - * Provides JSON Web Tokens for authenticating the client to Fleet Engine. + * Describes which drawing modes are available for the user to select, in the order they are displayed. This should not include the null drawing mode, which is added by default. If null, drawing controls are disabled and not displayed. Possible drawing modes are "Point", "LineString" or "Polygon". + * @defaultValue null */ - authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; + controls?: string[] | null; /** - * The delivery vehicle ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any vehicle; use {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider.deliveryVehicleId} to set the ID and begin tracking. + * The current drawing mode of the given Data layer. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything. Possible drawing modes are null, "Point", "LineString" or "Polygon". + * @defaultValue null */ - deliveryVehicleId: string | null; + drawingMode?: string | null; /** - * 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 {@link google.maps.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 {@link google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * When drawing is enabled and a user draws a Geometry (a Point, Line String or Polygon), this function is called with that Geometry and should return a Feature that is to be added to the Data layer. If a featureFactory is not supplied, a Feature with no id and no properties will be created from that Geometry instead. Defaults to null. */ - deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + featureFactory?: ((arg0: google.maps.Data.Geometry) => google.maps.Data.Feature) | null; /** - * Customization applied to a planned stop marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.PlannedStopMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Map on which to display the features in the collection. */ - plannedStopMarkerCustomization?: ((arg0: google.maps.journeySharing.PlannedStopMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + map: google.maps.Map; /** - * 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. + * Style for all features in the collection. For more details, see the setStyle() method above. */ - pollingIntervalMillis: number | null; + style?: google.maps.Data.StylingFunction | google.maps.Data.StyleOptions; + } + /** + * A feature has a geometry, an id, and a set of properties. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Feature { /** - * The consumer's project ID from Google Cloud Console. + * Constructs a Feature with the given options. + * @param options */ - projectId: string; + constructor(options?: google.maps.Data.FeatureOptions | null); /** - * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Repeatedly invokes the given function, passing a property value and name on each invocation. The order of iteration through the properties is undefined. */ - remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + forEachProperty(callback: (arg0: unknown, arg1: string) => void): void; /** - * Boolean to show or hide outcome locations for the fetched tasks. + * Returns the feature's geometry. */ - shouldShowOutcomeLocations: boolean | null; + getGeometry(): google.maps.Data.Geometry | null; /** - * Boolean to show or hide tasks. Setting this to false will prevent the ListTasks endpoint from being called to fetch the tasks. Only the upcoming vehicle stops will be displayed. + * Returns the feature ID. */ - shouldShowTasks: boolean | null; + getId(): number | string | undefined; /** - * Threshold for stale vehicle location. If the last updated location for the vehicle is older this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than 0, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. + * Returns the value of the requested property, or undefined if the property does not exist. */ - staleLocationThresholdMillis: number | null; + getProperty(name: string): unknown; /** - * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Removes the property with the given name. */ - takenPolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + removeProperty(name: string): void; /** - * Filter options to apply when fetching tasks. The options can include specific vehicle, time, and task status. + * Sets the feature's geometry. */ - taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions | null; + setGeometry(newGeometry: google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral | null): void; /** - * Customization applied to a task marker. A task marker is rendered at the planned location of each task assigned to the delivery vehicle.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TaskMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Sets the value of the specified property. If newValue is undefined this is equivalent to calling removeProperty. */ - taskMarkerCustomization?: ((arg0: google.maps.journeySharing.TaskMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + setProperty(name: string, newValue: unknown): void; /** - * Customization applied to a task outcome marker. A task outcome marker is rendered at the actual outcome location of each task assigned to the delivery vehicle.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TaskMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Exports the feature to a GeoJSON object. */ - taskOutcomeMarkerCustomization?: ((arg0: google.maps.journeySharing.TaskMarkerCustomizationFunctionParams) => void) | null; + toGeoJson(callback: (arg0: object) => void): void; } /** - * Delivery Vehicle Location Provider. - * Access by calling `const {FleetEngineDeliveryVehicleLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Optional parameters for creating Data.Feature objects. */ - export class FleetEngineDeliveryVehicleLocationProvider extends google.maps.journeySharing.PollingLocationProvider { + export interface FeatureOptions { /** - * Creates a new location provider for a Fleet Engine delivery vehicle. - * @param options Options to pass to the location provider. + * The feature geometry. If none is specified when a feature is constructed, the feature's geometry will be null. If a LatLng object or LatLngLiteral is given, this will be converted to a Data.Point geometry. */ - constructor(options: google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions); + geometry?: google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral | null; /** - * ID for the vehicle that this location provider observes. Set this field to track a vehicle. + * Feature ID is optional. If provided, it can be used to look up the feature in a Data object using the getFeatureById() method. Note that a feature's ID cannot be subsequently changed. */ - deliveryVehicleId: string; + id?: number | string; /** - * Optionally allow users to display the task's outcome location. + * The feature properties. This is an arbitrary mapping of property names to values. */ - shouldShowOutcomeLocations: boolean | null; + properties?: object | null; + } + /** + * Optional parameters for importing GeoJSON. + */ + export interface GeoJsonOptions { /** - * Optionally allow users to display fetched tasks. + * The name of the Feature property to use as the feature ID. If not specified, the GeoJSON Feature id will be used. */ - shouldShowTasks: boolean | null; + idPropertyName?: string | null; + } + /** + * A superclass for the various geometry objects. + */ + export interface Geometry { /** - * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. + * Repeatedly invokes the given function, passing a point from the geometry to the function on each invocation. */ - staleLocationThresholdMillis: number; + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * Returns the filter options to apply when fetching tasks. + * Returns the type of the geometry object. Possibilities are "Point", "MultiPoint", "LineString", "MultiLineString", "LinearRing", "Polygon", "MultiPolygon", or "GeometryCollection". */ - taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions; + getType(): string; } /** - * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider.update} event is triggered. + * A GeometryCollection contains a number of geometry objects. Any LatLng or LatLngLiteral objects are automatically converted to Data.Point geometry objects. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface FleetEngineDeliveryVehicleLocationProviderUpdateEvent { + export class GeometryCollection implements google.maps.Data.Geometry { /** - * The journey segments that have been completed by this vehicle. Unmodifiable. + * Constructs a Data.GeometryCollection from the given geometry objects or LatLngs. + * @param elements */ - completedVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[] | null; + constructor(elements: (google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral)[]); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * The delivery vehicle data structure returned by the update. Unmodifiable. + * Returns an array of the contained geometry objects. A new array is returned each time getArray() is called. */ - deliveryVehicle: google.maps.journeySharing.DeliveryVehicle | null; + getArray(): google.maps.Data.Geometry[]; /** - * The list of tasks served by this delivery vehicle. Unmodifiable. + * Returns the n-th contained geometry object. */ - tasks: google.maps.journeySharing.Task[] | null; + getAt(n: number): google.maps.Data.Geometry; + /** + * Returns the number of contained geometry objects. + */ + getLength(): number; + /** + * Returns the string "GeometryCollection". + */ + getType(): string; } /** - * Options for delivery fleet location provider. + * A LinearRing geometry contains a number of LatLngs, representing a closed LineString. There is no need to make the first LatLng equal to the last LatLng. The LinearRing is closed implicitly. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface FleetEngineDeliveryFleetLocationProviderOptions { - /** - * Provides JSON Web Tokens for authenticating the client to Fleet Engine. - */ - authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; + export class LinearRing implements google.maps.Data.Geometry { /** - * A filter query to apply when fetching delivery vehicles. This filter is passed directly to Fleet Engine.

See ListDeliveryVehiclesRequest.filter for supported formats.

Note that valid filters for attributes must have the "attributes" prefix. For example, attributes.x = "y" or attributes."x y" = "z". + * Constructs a Data.LinearRing from the given LatLngs or LatLngLiterals. + * @param elements */ - deliveryVehicleFilter: string | null; + constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * Customization applied to a delivery vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called. */ - deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams) => void) | null; + getArray(): google.maps.LatLng[]; /** - * The latitude/longitude bounds within which to track vehicles immediately after the location provider is instantiated. If not set, the location provider does not start tracking any vehicles; use {@link google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider.locationRestriction} to set the bounds and begin tracking. To track all delivery vehicles regardless of location, set bounds equivalent to the entire earth. + * Returns the n-th contained LatLng. */ - locationRestriction: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + getAt(n: number): google.maps.LatLng; /** - * The consumer's project ID from Google Cloud Console. + * Returns the number of contained LatLngs. */ - projectId: string; + getLength(): number; /** - * Threshold for stale vehicle location. If the last updated location for the vehicle is older this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than zero, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. + * Returns the string "LinearRing". */ - staleLocationThresholdMillis: number | null; + getType(): string; } /** - * Delivery Fleet Location Provider. - * Access by calling `const {FleetEngineDeliveryFleetLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A LineString geometry contains a number of LatLngs. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class FleetEngineDeliveryFleetLocationProvider extends google.maps.journeySharing.PollingLocationProvider { + export class LineString implements google.maps.Data.Geometry { /** - * Creates a new location provider for vehicles tracked by Fleet Engine. - * @param options Options to pass to the location provider. + * Constructs a Data.LineString from the given LatLngs or LatLngLiterals. + * @param elements */ - constructor(options: google.maps.journeySharing.FleetEngineDeliveryFleetLocationProviderOptions); + constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * The filter applied when fetching the delivery vehicles. + * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called. */ - deliveryVehicleFilter?: string | null; + getArray(): google.maps.LatLng[]; /** - * The bounds within which to track delivery vehicles. If no bounds are set, no delivery vehicles will be tracked. To track all delivery vehicles regardless of location, set bounds equivalent to the entire earth. + * Returns the n-th contained LatLng. */ - locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + getAt(n: number): google.maps.LatLng; /** - * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. + * Returns the number of contained LatLngs. */ - staleLocationThresholdMillis: number; + getLength(): number; + /** + * Returns the string "LineString". + */ + getType(): string; } /** - * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider.update} event is triggered. + * This object is passed to mouse event handlers on a Data object. */ - export interface FleetEngineDeliveryFleetLocationProviderUpdateEvent { + export interface MouseEvent extends google.maps.MapMouseEvent { /** - * The list of delivery vehicles returned by the query. Unmodifiable. + * The feature which generated the mouse event. */ - deliveryVehicles: google.maps.journeySharing.DeliveryVehicle[] | null; + feature: google.maps.Data.Feature; } /** - * The details for a delivery vehicle returned by Fleet Engine. + * A MultiLineString geometry contains a number of LineStrings. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface DeliveryVehicle { - /** - * Custom delivery vehicle attributes. - */ - attributes: { [key: string]: string | null }; - /** - * The location where the current route segment ends. - */ - currentRouteSegmentEndPoint: google.maps.LatLngLiteral | null; - /** - * The last reported location of the delivery vehicle. - */ - latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; + export class MultiLineString implements google.maps.Data.Geometry { /** - * In the format "providers/{provider_id}/deliveryVehicles/{delivery_vehicle_id}". The delivery_vehicle_id must be a unique identifier. + * Constructs a Data.MultiLineString from the given Data.LineStrings or arrays of positions. + * @param elements */ - name: string; + constructor(elements: (google.maps.Data.LineString | (google.maps.LatLng | google.maps.LatLngLiteral)[])[]); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * The current navigation status of the vehicle. + * Returns an array of the contained Data.LineStrings. A new array is returned each time getArray() is called. */ - navigationStatus: string; + getArray(): google.maps.Data.LineString[]; /** - * The remaining driving distance in the current route segment, in meters. + * Returns the n-th contained Data.LineString. */ - remainingDistanceMeters: number; + getAt(n: number): google.maps.Data.LineString; /** - * The remaining driving duration in the current route segment, in milliseconds. + * Returns the number of contained Data.LineStrings. */ - remainingDurationMillis: number | null; + getLength(): number; /** - * The journey segments assigned to this delivery vehicle, starting from the vehicle's most recently reported location. This is only populated when the {@link google.maps.journeySharing.DeliveryVehicle} data object is provided through {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider}. + * Returns the string "MultiLineString". */ - remainingVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[]; + getType(): string; } /** - * Options for vehicle location provider. + * A MultiPoint geometry contains a number of LatLngs. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface FleetEngineVehicleLocationProviderOptions { + export class MultiPoint implements google.maps.Data.Geometry { /** - * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Constructs a Data.MultiPoint from the given LatLngs or LatLngLiterals. + * @param elements */ - activePolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * Provides JSON Web Tokens for authenticating the client to Fleet Engine. + * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called. */ - authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; + getArray(): google.maps.LatLng[]; /** - * Customization applied to the vehicle trip destination marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Returns the n-th contained LatLng. */ - destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + getAt(n: number): google.maps.LatLng; /** - * Customization applied to the vehicle trip intermediate destination markers.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Returns the number of contained LatLngs. */ - intermediateDestinationMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + getLength(): number; /** - * Customization applied to the vehicle trip origin marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Returns the string "MultiPoint". */ - originMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + getType(): string; + } + /** + * A MultiPolygon geometry contains a number of Data.Polygons. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class MultiPolygon implements google.maps.Data.Geometry { + /** + * Constructs a Data.MultiPolygon from the given Data.Polygons or arrays of positions. + * @param elements + */ + constructor(elements: (google.maps.Data.Polygon | (google.maps.Data.LinearRing | (google.maps.LatLng | google.maps.LatLngLiteral)[])[])[]); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * 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. + * Returns an array of the contained Data.Polygons. A new array is returned each time getArray() is called. */ - pollingIntervalMillis: number | null; + getArray(): google.maps.Data.Polygon[]; /** - * The consumer's project ID from Google Cloud Console. + * Returns the n-th contained Data.Polygon. */ - projectId: string; + getAt(n: number): google.maps.Data.Polygon; /** - * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Returns the number of contained Data.Polygons. */ - remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + getLength(): number; /** - * Threshold for stale vehicle location. If the last updated location for the vehicle is older this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than 0, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. + * Returns the string "MultiPolygon". */ - staleLocationThresholdMillis: number | null; + getType(): string; + } + /** + * A Point geometry contains a single LatLng. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Point implements google.maps.Data.Geometry { /** - * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Constructs a Data.Point from the given LatLng or LatLngLiteral. + * @param latLng */ - takenPolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + constructor(latLng: google.maps.LatLng | google.maps.LatLngLiteral); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * The vehicle ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any vehicle; use {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider.vehicleId} to set the ID and begin tracking. + * Returns the contained LatLng. */ - vehicleId: string | null; + get(): google.maps.LatLng; /** - * Customization applied to the vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * Returns the string "Point". */ - vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + getType(): string; } /** - * Vehicle Location Provider. - * Access by calling `const {FleetEngineVehicleLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A Polygon geometry contains a number of Data.LinearRings. The first linear-ring must be the polygon exterior boundary and subsequent linear-rings must be interior boundaries, also known as holes. See the sample polygon with a hole. + * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class FleetEngineVehicleLocationProvider extends google.maps.journeySharing.PollingLocationProvider { + export class Polygon implements google.maps.Data.Geometry { /** - * Creates a new location provider for a Fleet Engine vehicle. - * @param options Options to pass to the location provider. + * Constructs a Data.Polygon from the given Data.LinearRings or arrays of positions. + * @param elements */ - constructor(options: google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions); + constructor(elements: (google.maps.Data.LinearRing | (google.maps.LatLng | google.maps.LatLngLiteral)[])[]); + + forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; /** - * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. + * Returns an array of the contained Data.LinearRings. A new array is returned each time getArray() is called. */ - staleLocationThresholdMillis: number; + getArray(): google.maps.Data.LinearRing[]; /** - * ID for the vehicle that this location provider observes. Set this field to track a vehicle. + * Returns the n-th contained Data.LinearRing. */ - vehicleId: string; + getAt(n: number): google.maps.Data.LinearRing; /** - * Polyline customization function that colors the active polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.activePolylineCustomization} to render a traffic-aware polyline for the active polyline. + * Returns the number of contained Data.LinearRings. */ - static TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams): void; + getLength(): number; /** - * Polyline customization function that colors the remaining polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.remainingPolylineCustomization} to render a traffic-aware polyline for the remaining polyline. + * Returns the string "Polygon". */ - static TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams): void; + getType(): string; } /** - * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider.update} event is triggered. + * The properties of a removefeature event. */ - export interface FleetEngineVehicleLocationProviderUpdateEvent { - /** - * The list of trips completed by this vehicle. Unmodifiable. - */ - trips: google.maps.journeySharing.Trip[] | null; + export interface RemoveFeatureEvent { /** - * The vehicle data structure returned by the update. Unmodifiable. + * The feature that was removed from the FeatureCollection. */ - vehicle: google.maps.journeySharing.Vehicle | null; + feature: google.maps.Data.Feature; } /** - * Options for fleet location provider. + * The properties of a removeproperty event. */ - export interface FleetEngineFleetLocationProviderOptions { + export interface RemovePropertyEvent { /** - * Provides JSON Web Tokens for authenticating the client to Fleet Engine. + * The feature whose property was removed. */ - authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; + feature: google.maps.Data.Feature; /** - * The latitude/longitude bounds within which to track vehicles immediately after the location provider is instantiated. If not set, the location provider does not start tracking any vehicles; use {@link google.maps.journeySharing.FleetEngineFleetLocationProvider.locationRestriction} to set the bounds and begin tracking. To track all vehicles regardless of location, set bounds equivalent to the entire earth. + * The property name. */ - locationRestriction: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + name: string; /** - * The consumer's project ID from Google Cloud Console. + * The previous value. */ - projectId: string; + oldValue: unknown; + } + /** + * The properties of a setgeometry event. + */ + export interface SetGeometryEvent { /** - * Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than zero, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. + * The feature whose geometry was set. */ - staleLocationThresholdMillis: number | null; + feature: google.maps.Data.Feature; /** - * A filter query to apply when fetching vehicles. This filter is passed directly to Fleet Engine.

See ListVehiclesRequest.filter for supported formats.

Note that valid filters for attributes must have the "attributes" prefix. For example, attributes.x = "y" or attributes."x y" = "z". + * The new feature geometry. */ - vehicleFilter: string | null; + newGeometry?: google.maps.Data.Geometry; /** - * Customization applied to a vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ * The previous feature geometry. */ - vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams) => void) | null; + oldGeometry?: google.maps.Data.Geometry; } /** - * Fleet Location Provider. - * Access by calling `const {FleetEngineFleetLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The properties of a setproperty event. */ - export class FleetEngineFleetLocationProvider extends google.maps.journeySharing.PollingLocationProvider { + export interface SetPropertyEvent { /** - * Creates a new location provider for vehicles tracked by Fleet Engine. - * @param options Options to pass to the location provider. + * The feature whose property was set. */ - constructor(options: google.maps.journeySharing.FleetEngineFleetLocationProviderOptions); + feature: google.maps.Data.Feature; /** - * The bounds within which to track vehicles. If no bounds are set, no vehicles will be tracked. To track all vehicles regardless of location, set bounds equivalent to the entire earth. + * The property name. */ - locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + name: string; /** - * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. + * The new value. */ - staleLocationThresholdMillis: number; + newValue: unknown; /** - * The filter applied when fetching the vehicles. + * The previous value. Will be undefined if the property was added. */ - vehicleFilter?: string | null; + oldValue: unknown; } /** - * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineFleetLocationProvider.update} event is triggered. + * These options specify the way a Feature should appear when displayed on a map. */ - export interface FleetEngineFleetLocationProviderUpdateEvent { + export interface StyleOptions { /** - * The list of vehicles returned by the query. Unmodifiable. + * The animation to play when marker is added to a map. Only applies to point geometries. */ - vehicles: google.maps.journeySharing.Vehicle[] | null; - } - /** - * The details for a vehicle returned by Fleet Engine. - */ - export interface Vehicle { + animation?: google.maps.Animation; /** - * Custom vehicle attributes. + * If true, the marker receives mouse and touch events. + * @defaultValue true */ - attributes: { [key: string]: unknown }; + clickable?: boolean; /** - * The waypoint where current route segment ends. + * Mouse cursor to show on hover. Only applies to point geometries. */ - currentRouteSegmentEndPoint: google.maps.journeySharing.TripWaypoint | null; + cursor?: string; /** - * Time when the current route segment was set. + * If true, the object can be dragged across the map and the underlying feature will have its geometry updated. + * @defaultValue false */ - currentRouteSegmentVersion: Date | null; + draggable?: boolean; /** - * List of trip IDs for trips currently assigned to this vehicle. + * If true, the object can be edited by dragging control points and the underlying feature will have its geometry updated. Only applies to LineString and Polygon geometries. + * @defaultValue false */ - currentTrips: string[] | null; + editable?: boolean; /** - * The ETA to the first entry in the waypoints field. + * The fill color. All CSS3 colors are supported except for extended named colors. Only applies to polygon geometries. */ - etaToFirstWaypoint: Date | null; + fillColor?: string; /** - * The last reported location of the vehicle. + * The fill opacity between 0.0 and 1.0. Only applies to polygon geometries. */ - latestLocation: google.maps.journeySharing.VehicleLocationUpdate | null; + fillOpacity?: number; /** - * The total numbers of riders this vehicle can carry. The driver is not considered in this value. + * Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url. Only applies to point geometries. */ - maximumCapacity: number | null; + icon?: string | google.maps.Icon | google.maps.Symbol; /** - * In the format "providers/{provider_id}/vehicles/{vehicle_id}". The vehicle_id must be a unique identifier. + * The icons to be rendered along a polyline. Only applies to line geometries. */ - name: string; + icons?: google.maps.IconSequence[]; /** - * The current navigation status of the vehicle. + * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. Only applies to point geometries. */ - navigationStatus: google.maps.journeySharing.VehicleNavigationStatusString; + label?: string | google.maps.MarkerLabel; /** - * The remaining driving distance in the current route segment, in meters. + * The marker's opacity between 0.0 and 1.0. Only applies to point geometries. */ - remainingDistanceMeters: number; + opacity?: number; /** - * Trip types supported by this vehicle. + * Defines the image map used for hit detection. Only applies to point geometries. */ - supportedTripTypes: google.maps.journeySharing.TripTypeString[] | null; + shape?: google.maps.MarkerShape; /** - * The vehicle state. + * The stroke color. All CSS3 colors are supported except for extended named colors. Only applies to line and polygon geometries. */ - vehicleState: google.maps.journeySharing.VehicleStateString; + strokeColor?: string; /** - * The type of this vehicle. + * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon geometries. */ - vehicleType: google.maps.journeySharing.VehicleTypeString; + strokeOpacity?: number; /** - * The remaining waypoints assigned to this Vehicle. + * The stroke width in pixels. Only applies to line and polygon geometries. */ - waypoints: google.maps.journeySharing.TripWaypoint[] | null; + strokeWeight?: number; /** - * Last time the waypoints field was updated. + * Rollover text. Only applies to point geometries. */ - waypointsVersion: Date | null; + title?: string; + /** + * Whether the feature is visible. + * @defaultValue true + */ + visible?: boolean; + /** + * All features are displayed on the map in order of their zIndex, with higher values displaying in front of features with lower values. Markers are always displayed in front of line-strings and polygons. + */ + zIndex?: number; + } + + export type StylingFunction = (arg0: google.maps.Data.Feature) => google.maps.Data.StyleOptions; +} + +declare namespace google.maps.drawing { + /** + * Allows users to draw markers, polygons, polylines, rectangles, and circles on the map. The DrawingManager's drawing mode defines the type of overlay that will be created by the user. Adds a control to the map, allowing the user to switch drawing mode. + * Access by calling `const {DrawingManager} = await google.maps.importLibrary("drawing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated The DrawingManager functionality in the Maps JavaScript API is no longer available in the Maps JavaScript API as of version 3.65. For more info, see https://developers.google.com/maps/deprecations. + */ + export class DrawingManager extends google.maps.MVCObject { } /** - * Parameters that are common to all marker customization functions. No object of this class is provided directly to any marker customization function; an object of one of its descendent classes is provided instead. + * The types of overlay that may be created by the DrawingManager. Specify these by value, or by using the constant's name. For example, 'polygon' or google.maps.drawing.OverlayType.POLYGON. + * + * Access by calling `const {OverlayType} = await google.maps.importLibrary("drawing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface MarkerCustomizationFunctionParams { + export enum OverlayType { /** - * The default options used to create this marker. + * Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete event is a circle. */ - defaultOptions: google.maps.MarkerOptions; + CIRCLE = 'circle', /** - * If true, the marker was newly created, and the marker customization function is being called for the first time, before the marker has been added to the map view. False otherwise. + * Specifies that the DrawingManager creates markers, and that the overlay given in the overlaycomplete event is a marker. */ - isNew: boolean; + MARKER = 'marker', /** - * The marker. Any customizations should be made to this object directly. + * Specifies that the DrawingManager creates polygons, and that the overlay given in the overlaycomplete event is a polygon. + */ + POLYGON = 'polygon', + /** + * Specifies that the DrawingManager creates polylines, and that the overlay given in the overlaycomplete event is a polyline. + */ + POLYLINE = 'polyline', + /** + * Specifies that the DrawingManager creates rectangles, and that the overlay given in the overlaycomplete event is a rectangle. */ - marker: google.maps.Marker; + RECTANGLE = 'rectangle', } + export type OverlayTypeString = `${google.maps.drawing.OverlayType}`; +} + +declare namespace google.maps.event { /** - * Parameters specific to marker customization functions that apply options to delivery vehicle markers. Used by {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.deliveryVehicleMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineDeliveryFleetLocationProviderOptions.deliveryVehicleMarkerCustomization}. + * Adds the given listener function to the given event name for the given object instance. Returns an identifier for this listener that can be used with removeListener(). */ - export interface DeliveryVehicleMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { - /** - * The delivery vehicle represented by this marker. - */ - vehicle: google.maps.journeySharing.DeliveryVehicle; - } + export function addListener(instance: object, eventName: string, handler: Function): google.maps.MapsEventListener; /** - * Parameters specific to marker customization functions that apply options to markers representing planned stops. Used by {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.plannedStopMarkerCustomization}. + * Like addListener, but the handler removes itself after handling the first event. */ - export interface PlannedStopMarkerCustomizationFunctionParams extends google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams { - /** - * The 0-based index of this stop in the list of remaining stops. - */ - stopIndex: number; - } + export function addListenerOnce(instance: object, eventName: string, handler: Function): google.maps.MapsEventListener; /** - * Parameters specific to marker customization functions that apply options to markers representing planned or actual task locations. Used by {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.taskMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.taskOutcomeMarkerCustomization}. + * Removes all listeners for all events for the given instance. */ - export interface TaskMarkerCustomizationFunctionParams extends google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams { - /** - * The task location represented by this marker. - */ - task: google.maps.journeySharing.Task; - } + export function clearInstanceListeners(instance: object): void; /** - * Parameters specific to marker customization functions that apply options to markers representing shipment delivery vehicle and destination locations. Used by {@link google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions.deliveryVehicleMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions.destinationMarkerCustomization}. + * Removes all listeners for the given event for the given instance. */ - export interface ShipmentMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { - /** - * Information for the task associated with this marker. - */ - taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo; - } + export function clearListeners(instance: object, eventName: string): void; /** - * Parameters specific to marker customization functions that apply options to markers representing trip vehicle, origin and destination locations. Used by {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.vehicleMarkerCustomization}, {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.originMarkerCustomization}, and {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.destinationMarkerCustomization}. + * Returns if there are listeners for the given event on the given instance. Can be used to save the computation of expensive event details. */ - export interface TripMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { - /** - * The trip associated with this marker.

For information about the vehicle servicing this trip, use {@link google.maps.journeySharing.Trip.latestVehicleLocationUpdate} and {@link google.maps.journeySharing.Trip.remainingWaypoints}. - */ - trip: google.maps.journeySharing.Trip; - } + export function hasListeners(instance: object, eventName: string): boolean; /** - * Parameters specific to marker customization functions that apply options to markers representing trip waypoint locations. Used by {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.waypointMarkerCustomization}. + * Removes the given listener, which should have been returned by addListener above. Equivalent to calling listener.remove(). */ - export interface TripWaypointMarkerCustomizationFunctionParams extends google.maps.journeySharing.TripMarkerCustomizationFunctionParams { - /** - * The 0-based waypoint index associated with this marker. Use this index on {@link google.maps.journeySharing.Trip.remainingWaypoints} to retrieve information about the waypoint. - */ - waypointIndex: number; - } + export function removeListener(listener: google.maps.MapsEventListener): void; /** - * Parameters specific to marker customization functions that apply options to vehicle markers. Used by {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.vehicleMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineFleetLocationProviderOptions.vehicleMarkerCustomization}. + * Triggers the given event. All arguments after eventName are passed as arguments to the listeners. */ - export interface VehicleMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { - /** - * The vehicle represented by this marker. - */ - vehicle: google.maps.journeySharing.Vehicle; - } + export function trigger(instance: object, eventName: string, ...eventArgs: unknown[]): void; /** - * Parameters specific to marker customization functions that apply options to vehicle waypoint markers. Used by {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.originMarkerCustomization}, {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.destinationMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.intermediateDestinationMarkerCustomization} + * Cross browser event handler registration. This listener is removed by calling removeListener(handle) for the handle that is returned by this function. + * @deprecated google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead. The feature will continue to work and there is no plan to decommission it. */ - export interface VehicleWaypointMarkerCustomizationFunctionParams extends google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams { - /** - * The 0-based waypoint index associated with this marker. Use this index on {@link google.maps.journeySharing.Vehicle.waypoints} to retrieve information about the waypoint. - */ - waypointIndex: number; - } + export function addDomListener(instance: object, eventName: string, handler: Function, capture?: boolean): google.maps.MapsEventListener; /** - * Parameters that are common to all polyline customization functions. No object of this class is provided directly to any polyline customization function; an object of one of its descendent classes is provided instead. + * Wrapper around addDomListener that removes the listener after the first event. + * @deprecated google.maps.event.addDomListenerOnce() is deprecated, use the standard addEventListener() method instead. The feature will continue to work and there is no plan to decommission it. */ - export interface PolylineCustomizationFunctionParams { - /** - * The default options used to create this set of polylines. - */ - defaultOptions: google.maps.PolylineOptions; - /** - * If true, the list of polylines was newly created, and the polyline customization function is being called for the first time. False otherwise. - */ - isNew: boolean; - /** - * The list of polylines created. They are arranged sequentially to form the rendered route. - */ - polylines: google.maps.Polyline[]; - } + export function addDomListenerOnce(instance: object, eventName: string, handler: Function, capture?: boolean): google.maps.MapsEventListener; +} + +declare namespace google.maps.geometry.encoding { /** - * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineShipmentLocationProvider}. + * Decodes an encoded path string into a sequence of LatLngs. */ - export interface ShipmentPolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { - /** - * Information for the task associated with this polyline. - */ - taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo; - } + export function decodePath(encodedPath: string): google.maps.LatLng[]; /** - * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineTripLocationProvider}. + * Encodes a sequence of LatLngs into an encoded path string. */ - export interface TripPolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { - /** - * The trip associated with this polyline. - */ - trip: google.maps.journeySharing.Trip; - } + export function encodePath(path: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray): string; +} + +declare namespace google.maps.geometry.poly { /** - * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider}. + * Computes whether the given point lies inside the specified polygon. */ - export interface VehiclePolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { - /** - * The vehicle traversing through this polyline. - */ - vehicle: google.maps.journeySharing.Vehicle; - } + export function containsLocation(point: google.maps.LatLng | google.maps.LatLngLiteral, polygon: google.maps.Polygon): boolean; /** - * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider}. + * Computes whether the given point lies on or near to a polyline, or the edge of a polygon, within a specified tolerance. Returns true when the difference between the latitude and longitude of the supplied point, and the closest point on the edge, is less than the tolerance. The tolerance defaults to 10-9 degrees. */ - export interface DeliveryVehiclePolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { - /** - * The delivery vehicle traversing through this polyline. - */ - deliveryVehicle: google.maps.journeySharing.DeliveryVehicle; - } + export function isLocationOnEdge(point: google.maps.LatLng | google.maps.LatLngLiteral, poly: google.maps.Polygon | google.maps.Polyline, tolerance?: number): boolean; } -declare namespace google.maps.places { +declare namespace google.maps.geometry.spherical { /** - * The options that can be set on an Autocomplete object. + * Returns the unsigned area of a closed path, in the range [0, 2×pi×radius²]. The computed area uses the same units as the radius. The radiusOfSphere defaults to the Earth's radius in meters, in which case the area is in square meters. Passing a Circle requires the radius to be set to a non-negative value. Additionally, the Circle must not cover more than 100% of the sphere. And when passing a LatLngBounds, the southern LatLng cannot be more north than the northern LatLng. */ - export interface AutocompleteOptions { - /** - * The area in which to search for places. - */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; - /** - * The component restrictions. Component restrictions are used to restrict predictions to only those within the parent component. For example, the country. - */ - componentRestrictions?: google.maps.places.ComponentRestrictions; - /** - * Fields to be included for the Place in the details response when the details are successfully retrieved, which will be billed for. If ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). The default is ['ALL']. - */ - fields?: string[]; - /** - * A boolean value, indicating that the Autocomplete widget should only return those places that are inside the bounds of the Autocomplete widget at the time the query is sent. Setting strictBounds to false (which is the default) will make the results biased towards, but not restricted to, places contained within the bounds. - */ - strictBounds?: boolean; + export function computeArea(path: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray | google.maps.Circle | google.maps.CircleLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, radiusOfSphere?: number): number; + /** + * Returns the distance, in meters, between two LatLngs. You can optionally specify a custom radius. The radius defaults to the radius of the Earth. + */ + export function computeDistanceBetween(from: google.maps.LatLng | google.maps.LatLngLiteral, to: google.maps.LatLng | google.maps.LatLngLiteral, radius?: number): number; + /** + * Returns the heading from one LatLng to another LatLng. Headings are expressed in degrees clockwise from North within the range [-180,180). + */ + export function computeHeading(from: google.maps.LatLng | google.maps.LatLngLiteral, to: google.maps.LatLng | google.maps.LatLngLiteral): number; + /** + * Returns the length of the given path. + */ + export function computeLength(path: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray, radius?: number): number; + /** + * Returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north). + */ + export function computeOffset(from: google.maps.LatLng | google.maps.LatLngLiteral, distance: number, heading: number, radius?: number): google.maps.LatLng; + /** + * Returns the location of origin when provided with a LatLng destination, meters travelled and original heading. Headings are expressed in degrees clockwise from North. This function returns null when no solution is available. + */ + export function computeOffsetOrigin(to: google.maps.LatLng | google.maps.LatLngLiteral, distance: number, heading: number, radius?: number): google.maps.LatLng | null; + /** + * Returns the signed area of a closed path, where counterclockwise is positive, in the range [-2×pi×radius², 2×pi×radius²]. The computed area uses the same units as the radius. The radius defaults to the Earth's radius in meters, in which case the area is in square meters.

The area is computed using the parallel transport method; the parallel transport around a closed path on the unit sphere twists by an angle that is equal to the area enclosed by the path. This is simpler and more accurate and robust than triangulation using Girard, l'Huilier, or Eriksson on each triangle. In particular, since it doesn't triangulate, it suffers no instability except in the unavoidable case when an edge (not a diagonal) of the polygon spans 180 degrees. + */ + export function computeSignedArea(loop: (google.maps.LatLng | google.maps.LatLngLiteral)[] | google.maps.MVCArray, radius?: number): number; + /** + * Returns the LatLng which lies the given fraction of the way between the origin LatLng and the destination LatLng. + */ + export function interpolate(from: google.maps.LatLng | google.maps.LatLngLiteral, to: google.maps.LatLng | google.maps.LatLngLiteral, fraction: number): google.maps.LatLng; + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Returns the position which lies the given fraction of the way along the given path. If passing LatLngAltitude objects, altitude is currently ignored, but future versions may take altitude into account. + */ + export function traversePath(path: (google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral)[], fraction: number): google.maps.LatLngLiteral; +} + +declare namespace google.maps.journeySharing { + /** + * The auth token returned by the token fetcher. + */ + export interface AuthToken { /** - * The types of predictions to be returned. For supported types, see the developer's guide. If no types are specified, all types will be returned. + * The expiration time in seconds. A token expires in this amount of time after fetching. */ - types?: string[]; + expiresInSeconds: number; /** - * Whether to retrieve only Place IDs. The PlaceResult made available when the place_changed event is fired will only have the place_id, types and name fields, with the place_id, types and description returned by the Autocomplete service. Disabled by default. - * @deprecated placeIdOnly is deprecated as of January 15, 2019, and will be turned off on January 15, 2020. Use {@link google.maps.places.AutocompleteOptions.fields} instead: fields: ['place_id', 'name', 'types']. + * The token. */ - placeIdOnly?: boolean; + token: string; } /** - * Represents a single autocomplete prediction. + * Contains additional information needed to mint JSON Web Tokens. */ - export interface AutocompletePrediction { - /** - * This is the unformatted version of the query suggested by the Places service. - */ - description: string; - /** - * The distance in meters of the place from the {@link google.maps.places.AutocompletionRequest.origin}. - */ - distance_meters?: number; + export interface AuthTokenContext { /** - * A set of substrings in the place's description that match elements in the user's input, suitable for use in highlighting those substrings. Each substring is identified by an offset and a length, expressed in unicode characters. + * When provided, the minted token should have a private DeliveryVehicleId claim for the provided deliveryVehicleId. */ - matched_substrings: google.maps.places.PredictionSubstring[]; + deliveryVehicleId?: string | null; /** - * A place ID that can be used to retrieve details about this place using the place details service (see {@link google.maps.places.PlacesService.getDetails}). + * When provided, the minted token should have a private TaskId claim for the provided taskId. */ - place_id: string; + taskId?: string | null; /** - * Structured information about the place's description, divided into a main text and a secondary text, including an array of matched substrings from the autocomplete input, identified by an offset and a length, expressed in unicode characters. + * When provided, the minted token should have a private TrackingId claim for the provided trackingId. */ - structured_formatting: google.maps.places.StructuredFormatting; + trackingId?: string | null; /** - * Information about individual terms in the above description, from most to least specific. For example, "Taco Bell", "Willitis", and "CA". + * When provided, the minted token should have a private TripId claim for the provided tripId. */ - terms: google.maps.places.PredictionTerm[]; + tripId?: string | null; /** - * An array of types that the prediction belongs to, for example 'establishment' or 'geocode'. + * When provided, the minted token should have a private VehicleId claim for the provided vehicleId. */ - types: string[]; + vehicleId?: string | null; } + + export type AuthTokenFetcher = (arg0: google.maps.journeySharing.AuthTokenFetcherOptions) => Promise; /** - * Represents a prediction term. + * Options for the auth token fetcher. */ - export interface PredictionTerm { + export interface AuthTokenFetcherOptions { /** - * The offset, in unicode characters, of the start of this term in the description of the place. + * The auth token context. IDs specified in the context should be added to the request sent to the JSON Web Token minting endpoint. */ - offset: number; + context: google.maps.journeySharing.AuthTokenContext; /** - * The value of this term, for example, "Taco Bell". + * The Fleet Engine service type. */ - value: string; + serviceType: google.maps.journeySharing.FleetEngineServiceTypeString; } /** - * Represents a prediction substring. + * Automatic viewport mode. + * + * Access by calling `const {AutomaticViewportMode} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PredictionSubstring { + export enum AutomaticViewportMode { /** - * The length of the substring. + * Automatically adjust the viewport to fit markers and any visible anticipated route polylines. This is the default. */ - length: number; + FIT_ANTICIPATED_ROUTE = 'FIT_ANTICIPATED_ROUTE', /** - * The offset to the substring's start within the description string. + * Do not automatically adjust the viewport. */ - offset: number; + NONE = 'NONE', } + export type AutomaticViewportModeString = `${google.maps.journeySharing.AutomaticViewportMode}`; /** - * Contains structured information about the place's description, divided into a main text and a secondary text, including an array of matched substrings from the autocomplete input, identified by an offset and a length, expressed in unicode characters. + * MarkerSetup default options. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. */ - export interface StructuredFormatting { + export interface DefaultMarkerSetupOptions { /** - * This is the main text part of the unformatted description of the place suggested by the Places service. Usually the name of the place. + * Default marker options. */ - main_text: string; + defaultMarkerOptions: google.maps.MarkerOptions; + } + /** + * PolylineSetup default options. + * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. + */ + export interface DefaultPolylineSetupOptions { /** - * A set of substrings in the main text that match elements in the user's input, suitable for use in highlighting those substrings. Each substring is identified by an offset and a length, expressed in unicode characters. + * Default polyline options. */ - main_text_matched_substrings: google.maps.places.PredictionSubstring[]; + defaultPolylineOptions: google.maps.PolylineOptions; /** - * This is the secondary text part of the unformatted description of the place suggested by the Places service. Usually the location of the place. + * Default polyline visibility. */ - secondary_text: string; + defaultVisible: boolean; } /** - * An Autocompletion request to be sent to {@link google.maps.places.AutocompleteService.getPlacePredictions}. + * The details for a delivery vehicle returned by Fleet Engine. */ - export interface AutocompletionRequest { + export interface DeliveryVehicle { /** - * The component restrictions. Component restrictions are used to restrict predictions to only those within the parent component. For example, the country. + * Custom delivery vehicle attributes. */ - componentRestrictions?: google.maps.places.ComponentRestrictions; + attributes: { [key: string]: string | null }; /** - * The user entered input string. + * The location where the current route segment ends. */ - input: string; + currentRouteSegmentEndPoint: google.maps.LatLngLiteral | null; /** - * A language identifier for the language in which the results should be returned, if possible. Results in the selected language may be given a higher ranking, but suggestions are not restricted to this language. See the list of supported languages. + * The last reported location of the delivery vehicle. */ - language?: string | null; + latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; /** - * A soft boundary or hint to use when searching for places. + * In the format "providers/{provider_id}/deliveryVehicles/{delivery_vehicle_id}". The delivery_vehicle_id must be a unique identifier. */ - locationBias?: google.maps.places.LocationBias | null; + name: string; /** - * Bounds to constrain search results. + * The current navigation status of the vehicle. */ - locationRestriction?: google.maps.places.LocationRestriction | null; + navigationStatus: string; /** - * The character position in the input term at which the service uses text for predictions (the position of the cursor in the input field). + * The remaining driving distance in the current route segment, in meters. */ - offset?: number; + remainingDistanceMeters: number; /** - * The location where {@link google.maps.places.AutocompletePrediction.distance_meters} is calculated from. + * The remaining driving duration in the current route segment, in milliseconds. */ - origin?: google.maps.LatLng | google.maps.LatLngLiteral; + remainingDurationMillis: number | null; /** - * A region code which is used for result formatting and for result filtering. It does not restrict the suggestions to this country. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * The journey segments assigned to this delivery vehicle, starting from the vehicle's most recently reported location. This is only populated when the {@link google.maps.journeySharing.DeliveryVehicle} data object is provided through {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider}. */ - region?: string | null; + remainingVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[]; + } + /** + * Parameters specific to marker customization functions that apply options to delivery vehicle markers. Used by {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.deliveryVehicleMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineDeliveryFleetLocationProviderOptions.deliveryVehicleMarkerCustomization}. + */ + export interface DeliveryVehicleMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { /** - * Unique reference used to bundle individual requests into sessions. + * The delivery vehicle represented by this marker. */ - sessionToken?: google.maps.places.AutocompleteSessionToken; + vehicle: google.maps.journeySharing.DeliveryVehicle; + } + /** + * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider}. + */ + export interface DeliveryVehiclePolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { /** - * The types of predictions to be returned. For supported types, see the developer's guide. If no types are specified, all types will be returned. + * The delivery vehicle traversing through this polyline. */ - types?: string[]; + deliveryVehicle: google.maps.journeySharing.DeliveryVehicle; + } + /** + * DeliveryVehicleStop type + */ + export interface DeliveryVehicleStop { /** - * Bounds for prediction biasing. Predictions will be biased towards, but not restricted to, the given bounds. Both location and radius will be ignored if bounds is set. - * @deprecated bounds is deprecated as of May 2023. Use {@link google.maps.places.AutocompletionRequest.locationBias} and {@link google.maps.places.AutocompletionRequest.locationRestriction} instead. + * The location of the stop. */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; + plannedLocation: google.maps.LatLngLiteral | null; /** - * Location for prediction biasing. Predictions will be biased towards the given location and radius. Alternatively, bounds can be used. - * @deprecated location is deprecated as of May 2023. Use {@link google.maps.places.AutocompletionRequest.locationBias} and {@link google.maps.places.AutocompletionRequest.locationRestriction} instead. + * The state of the stop. */ - location?: google.maps.LatLng; + state: google.maps.journeySharing.DeliveryVehicleStopStateString | null; /** - * The radius of the area used for prediction biasing. The radius is specified in meters, and must always be accompanied by a location property. Alternatively, bounds can be used. - * @deprecated radius is deprecated as of May 2023. Use {@link google.maps.places.AutocompletionRequest.locationBias} and {@link google.maps.places.AutocompletionRequest.locationRestriction} instead. + * The list of Tasks to be performed at this stop.
  • id: the ID of the task.
  • extraDurationMillis: the extra time it takes to perform the task, in milliseconds.
*/ - radius?: number; + tasks: google.maps.journeySharing.TaskInfo[]; } /** - * The operational status of the Place, if it is a business, returned in a PlaceResult (indicates whether the place is operational, or closed either temporarily or permanently). Specify these by value, or the constant's name (example: 'OPERATIONAL' or google.maps.places.BusinessStatus.OPERATIONAL). + * The current state of a {@link google.maps.journeySharing.DeliveryVehicleStop}. * - * Access by calling `const {BusinessStatus} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {DeliveryVehicleStopState} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum BusinessStatus { - /** - * The business is closed permanently. - */ - CLOSED_PERMANENTLY = 'CLOSED_PERMANENTLY', + export enum DeliveryVehicleStopState { /** - * The business is closed temporarily. + * Arrived at stop. Assumes that when the vehicle is routing to the next stop, that all previous stops have been completed. */ - CLOSED_TEMPORARILY = 'CLOSED_TEMPORARILY', + ARRIVED = 'ARRIVED', /** - * The business will open in the future. + * Assigned and actively routing. */ - FUTURE_OPENING = 'FUTURE_OPENING', + ENROUTE = 'ENROUTE', /** - * The business is operating normally. + * Created, but not actively routing. */ - OPERATIONAL = 'OPERATIONAL', - } - export type BusinessStatusString = `${google.maps.places.BusinessStatus}`; - /** - * Defines the component restrictions that can be used with the autocomplete service. - */ - export interface ComponentRestrictions { + NEW = 'NEW', /** - * Restricts predictions to the specified country (ISO 3166-1 Alpha-2 country code, case insensitive). For example, 'us', 'br', or 'au'. You can provide a single one, or an array of up to five country code strings. + * Unknown. */ - country: string | string[] | null; + UNSPECIFIED = 'UNSPECIFIED', } + export type DeliveryVehicleStopStateString = `${google.maps.journeySharing.DeliveryVehicleStopState}`; /** - * A Place details query to be sent to the PlacesService. + * Delivery Fleet Location Provider. + * Access by calling `const {FleetEngineDeliveryFleetLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceDetailsRequest { - /** - * Fields to be included in the details response, which will be billed for. If no fields are specified or ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). - */ - fields?: string[]; + export class FleetEngineDeliveryFleetLocationProvider extends google.maps.journeySharing.PollingLocationProvider { /** - * A language identifier for the language in which details should be returned. See the list of supported languages. + * Creates a new location provider for vehicles tracked by Fleet Engine. + * @param options Options to pass to the location provider. */ - language?: string | null; + constructor(options: google.maps.journeySharing.FleetEngineDeliveryFleetLocationProviderOptions); /** - * The Place ID of the Place for which details are being requested. + * The filter applied when fetching the delivery vehicles. */ - placeId: string; + deliveryVehicleFilter?: string | null; /** - * A region code of the user's region. This can affect which photos may be returned, and possibly other things. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * The bounds within which to track delivery vehicles. If no bounds are set, no delivery vehicles will be tracked. To track all delivery vehicles regardless of location, set bounds equivalent to the entire earth. */ - region?: string | null; + locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * Unique reference used to bundle the details request with an autocomplete session. + * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. */ - sessionToken?: google.maps.places.AutocompleteSessionToken; + staleLocationThresholdMillis: number; } /** - * Represents a photo element of a Place. + * Options for delivery fleet location provider. */ - export interface PlacePhoto { + export interface FleetEngineDeliveryFleetLocationProviderOptions { /** - * The height of the photo in pixels. + * Provides JSON Web Tokens for authenticating the client to Fleet Engine. */ - height: number; + authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; /** - * Attribution text to be displayed for this photo. + * A filter query to apply when fetching delivery vehicles. This filter is passed directly to Fleet Engine.

See ListDeliveryVehiclesRequest.filter for supported formats.

Note that valid filters for attributes must have the "attributes" prefix. For example, attributes.x = "y" or attributes."x y" = "z". */ - html_attributions: string[]; + deliveryVehicleFilter: string | null; /** - * The width of the photo in pixels. + * Customization applied to a delivery vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - width: number; + deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams) => void) | null; /** - * Returns the image URL corresponding to the specified options. + * The latitude/longitude bounds within which to track vehicles immediately after the location provider is instantiated. If not set, the location provider does not start tracking any vehicles; use {@link google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider.locationRestriction} to set the bounds and begin tracking. To track all delivery vehicles regardless of location, set bounds equivalent to the entire earth. */ - getUrl(opts?: google.maps.places.PhotoOptions): string; - } - /** - * Defines photo-requesting options. - */ - export interface PhotoOptions { + locationRestriction: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * The maximum height in pixels of the returned image. + * The consumer's project ID from Google Cloud Console. */ - maxHeight?: number | null; + projectId: string; /** - * The maximum width in pixels of the returned image. + * Threshold for stale vehicle location. If the last updated location for the vehicle is older this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than zero, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. */ - maxWidth?: number | null; + staleLocationThresholdMillis: number | null; } /** - * Represents a single review of a place. + * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider.update} event is triggered. */ - export interface PlaceReview { - /** - * The name of the reviewer. - */ - author_name: string; - /** - * A URL to the reviewer's profile. This will be undefined when the reviewer's profile is unavailable. - */ - author_url?: string; - /** - * An IETF language code indicating the language in which this review is written. Note that this code includes only the main language tag without any secondary tag indicating country or region. For example, all the English reviews are tagged as 'en' rather than 'en-AU' or 'en-UK'. - */ - language: string; - /** - * A URL to the reviwer's profile image. - */ - profile_photo_url: string; + export interface FleetEngineDeliveryFleetLocationProviderUpdateEvent { /** - * The rating of this review, a number between 1.0 and 5.0 (inclusive). + * The list of delivery vehicles returned by the query. Unmodifiable. */ - rating?: number; + deliveryVehicles: google.maps.journeySharing.DeliveryVehicle[] | null; + } + /** + * Delivery Vehicle Location Provider. + * Access by calling `const {FleetEngineDeliveryVehicleLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class FleetEngineDeliveryVehicleLocationProvider extends google.maps.journeySharing.PollingLocationProvider { /** - * A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. For example "a month ago". + * Creates a new location provider for a Fleet Engine delivery vehicle. + * @param options Options to pass to the location provider. */ - relative_time_description: string; + constructor(options: google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions); /** - * The text of a review. + * ID for the vehicle that this location provider observes. Set this field to track a vehicle. */ - text: string; + deliveryVehicleId: string; /** - * Timestamp for the review, expressed in seconds since epoch. + * Optionally allow users to display the task's outcome location. */ - time: number; + shouldShowOutcomeLocations: boolean | null; /** - * The aspects rated by the review. The ratings on a scale of 0 to 3. - * @deprecated This field is no longer available. + * Optionally allow users to display fetched tasks. */ - aspects?: google.maps.places.PlaceAspectRating[]; - } - /** - * Defines information about an aspect of the place that users have reviewed. - * @deprecated This interface is no longer used. - */ - export interface PlaceAspectRating { + shouldShowTasks: boolean | null; /** - * The rating of this aspect. For individual reviews this is an integer from 0 to 3. For aggregated ratings of a place this is an integer from 0 to 30. + * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. */ - rating: number; + staleLocationThresholdMillis: number; /** - * The aspect type. For example, "food", "decor", "service", or "overall". + * Returns the filter options to apply when fetching tasks. */ - type: string; + taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions; } /** - * Defines information about a Place. + * Options for delivery vehicle location provider. */ - export interface PlaceResult { + export interface FleetEngineDeliveryVehicleLocationProviderOptions { /** - * The collection of address components for this Place’s location. Only available with {@link google.maps.places.PlacesService.getDetails}. + * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - address_components?: google.maps.GeocoderAddressComponent[]; + activePolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * The representation of the Place’s address in the adr microformat. Only available with {@link google.maps.places.PlacesService.getDetails}. + * Provides JSON Web Tokens for authenticating the client to Fleet Engine. */ - adr_address?: string; + authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; /** - * The rated aspects of this Place, based on Google and Zagat user reviews. The ratings are on a scale of 0 to 30. + * The delivery vehicle ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any vehicle; use {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider.deliveryVehicleId} to set the ID and begin tracking. */ - aspects?: google.maps.places.PlaceAspectRating[]; + deliveryVehicleId: string | null; /** - * A flag indicating the operational status of the Place, if it is a business (indicates whether the place is operational, or closed either temporarily or permanently). If no data is available, the flag is not present in search or details responses. + * 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 {@link google.maps.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 {@link google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - business_status?: google.maps.places.BusinessStatusString; + deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * The Place’s full address. + * Customization applied to a planned stop marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.PlannedStopMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - formatted_address?: string; + plannedStopMarkerCustomization?: ((arg0: google.maps.journeySharing.PlannedStopMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * The Place’s phone number, formatted according to the number's regional convention. Only available with {@link google.maps.places.PlacesService.getDetails}. + * 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. */ - formatted_phone_number?: string; + pollingIntervalMillis: number | null; /** - * The Place’s geometry-related information. + * The consumer's project ID from Google Cloud Console. */ - geometry?: google.maps.places.PlaceGeometry; + projectId: string; /** - * Attribution text to be displayed for this Place result. Available html_attributions are always returned regardless of what fields have been requested, and must be displayed. + * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - html_attributions?: string[]; + remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * URL to an image resource that can be used to represent this Place’s category. + * Boolean to show or hide outcome locations for the fetched tasks. */ - icon?: string; + shouldShowOutcomeLocations: boolean | null; /** - * Background color for use with a Place's icon. See also {@link google.maps.places.PlaceResult.icon_mask_base_uri}. + * Boolean to show or hide tasks. Setting this to false will prevent the ListTasks endpoint from being called to fetch the tasks. Only the upcoming vehicle stops will be displayed. */ - icon_background_color?: string; + shouldShowTasks: boolean | null; /** - * A truncated URL to an icon mask. Access different icon types by appending a file extension to the end (i.e. .svg or .png). + * Threshold for stale vehicle location. If the last updated location for the vehicle is older this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than 0, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. */ - icon_mask_base_uri?: string; + staleLocationThresholdMillis: number | null; /** - * The Place’s phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign. Only available with {@link google.maps.places.PlacesService.getDetails}. + * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - international_phone_number?: string; + takenPolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * The Place’s name. Note: In the case of user entered Places, this is the raw text, as typed by the user. Please exercise caution when using this data, as malicious users may try to use it as a vector for code injection attacks (See http://en.wikipedia.org/wiki/Code_injection). + * Filter options to apply when fetching tasks. The options can include specific vehicle, time, and task status. */ - name?: string; + taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions | null; /** - * Defines when the Place opens or closes. + * Customization applied to a task marker. A task marker is rendered at the planned location of each task assigned to the delivery vehicle.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TaskMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - opening_hours?: google.maps.places.PlaceOpeningHours; + taskMarkerCustomization?: ((arg0: google.maps.journeySharing.TaskMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * Photos of this Place. The collection will contain up to ten {@link google.maps.places.PlacePhoto} objects. + * Customization applied to a task outcome marker. A task outcome marker is rendered at the actual outcome location of each task assigned to the delivery vehicle.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TaskMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - photos?: google.maps.places.PlacePhoto[]; + taskOutcomeMarkerCustomization?: ((arg0: google.maps.journeySharing.TaskMarkerCustomizationFunctionParams) => void) | null; + } + /** + * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider.update} event is triggered. + */ + export interface FleetEngineDeliveryVehicleLocationProviderUpdateEvent { /** - * A unique identifier for the Place. + * The journey segments that have been completed by this vehicle. Unmodifiable. */ - place_id?: string; + completedVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[] | null; /** - * Defines Open Location Codes or "plus codes" for the Place. + * The delivery vehicle data structure returned by the update. Unmodifiable. */ - plus_code?: google.maps.places.PlacePlusCode; + deliveryVehicle: google.maps.journeySharing.DeliveryVehicle | null; /** - * The price level of the Place, on a scale of 0 to 4. Price levels are interpreted as follows:
  • 0: Free
  • 1: Inexpensive
  • 2: Moderate
  • 3: Expensive
  • 4: Very Expensive
+ * The list of tasks served by this delivery vehicle. Unmodifiable. */ - price_level?: number; + tasks: google.maps.journeySharing.Task[] | null; + } + /** + * Fleet Location Provider. + * Access by calling `const {FleetEngineFleetLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class FleetEngineFleetLocationProvider extends google.maps.journeySharing.PollingLocationProvider { /** - * A rating, between 1.0 to 5.0, based on user reviews of this Place. + * Creates a new location provider for vehicles tracked by Fleet Engine. + * @param options Options to pass to the location provider. */ - rating?: number; + constructor(options: google.maps.journeySharing.FleetEngineFleetLocationProviderOptions); /** - * A list of reviews of this Place. Only available with {@link google.maps.places.PlacesService.getDetails}. + * The bounds within which to track vehicles. If no bounds are set, no vehicles will be tracked. To track all vehicles regardless of location, set bounds equivalent to the entire earth. */ - reviews?: google.maps.places.PlaceReview[]; + locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * An array of types for this Place (for example, ["political", "locality"] or ["restaurant", "establishment"]). + * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. */ - types?: string[]; + staleLocationThresholdMillis: number; /** - * URL of the official Google page for this place. This is the Google-owned page that contains the best available information about the Place. Only available with {@link google.maps.places.PlacesService.getDetails}. + * The filter applied when fetching the vehicles. */ - url?: string; + vehicleFilter?: string | null; + } + /** + * Options for fleet location provider. + */ + export interface FleetEngineFleetLocationProviderOptions { /** - * The number of user ratings which contributed to this Place’s {@link google.maps.places.PlaceResult.rating}. + * Provides JSON Web Tokens for authenticating the client to Fleet Engine. */ - user_ratings_total?: number; + authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; /** - * The offset from UTC of the Place’s current timezone, in minutes. For example, Sydney, Australia in daylight savings is 11 hours ahead of UTC, so the utc_offset_minutes will be 660. For timezones behind UTC, the offset is negative. For example, the utc_offset_minutes is -60 for Cape Verde. Only available with {@link google.maps.places.PlacesService.getDetails}. + * The latitude/longitude bounds within which to track vehicles immediately after the location provider is instantiated. If not set, the location provider does not start tracking any vehicles; use {@link google.maps.journeySharing.FleetEngineFleetLocationProvider.locationRestriction} to set the bounds and begin tracking. To track all vehicles regardless of location, set bounds equivalent to the entire earth. */ - utc_offset_minutes?: number; + locationRestriction: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * The simplified address for the Place, including the street name, street number, and locality, but not the province/state, postal code, or country. For example, Google's Sydney, Australia office has a vicinity value of "48 Pirrama Road, Pyrmont". Only available with {@link google.maps.places.PlacesService.getDetails}. + * The consumer's project ID from Google Cloud Console. */ - vicinity?: string; + projectId: string; /** - * The authoritative website for this Place, such as a business' homepage. Only available with {@link google.maps.places.PlacesService.getDetails}. + * Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than zero, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. */ - website?: string; + staleLocationThresholdMillis: number | null; /** - * The offset from UTC of the Place’s current timezone, in minutes. For example, Sydney, Australia in daylight savings is 11 hours ahead of UTC, so the utc_offset will be 660. For timezones behind UTC, the offset is negative. For example, the utc_offset is -60 for Cape Verde. Only available with {@link google.maps.places.PlacesService.getDetails}. - * @deprecated utc_offset is deprecated as of November 2019. Use {@link google.maps.places.PlaceResult.utc_offset_minutes} instead. See https://goo.gle/js-open-now + * A filter query to apply when fetching vehicles. This filter is passed directly to Fleet Engine.

See ListVehiclesRequest.filter for supported formats.

Note that valid filters for attributes must have the "attributes" prefix. For example, attributes.x = "y" or attributes."x y" = "z". */ - utc_offset?: number; + vehicleFilter: string | null; /** - * A flag indicating whether the Place is closed, either permanently or temporarily. If the place is operational, or if no data is available, the flag is absent from the response. - * @deprecated permanently_closed is deprecated as of May 2020 and will be turned off in May 2021. Use {@link google.maps.places.PlaceResult.business_status} instead as permanently_closed does not distinguish between temporary and permanent closures. + * Customization applied to a vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - permanently_closed?: boolean; + vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams) => void) | null; } /** - * Defines information about the geometry of a Place. + * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineFleetLocationProvider.update} event is triggered. */ - export interface PlaceGeometry { - /** - * The Place’s position. - */ - location?: google.maps.LatLng; + export interface FleetEngineFleetLocationProviderUpdateEvent { /** - * The preferred viewport when displaying this Place on a map. This property will be null if the preferred viewport for the Place is not known. Only available with {@link google.maps.places.PlacesService.getDetails}. + * The list of vehicles returned by the query. Unmodifiable. */ - viewport?: google.maps.LatLngBounds; + vehicles: google.maps.journeySharing.Vehicle[] | null; } /** - * Defines information about the opening hours of a Place. + * Types of Fleet Engine services. + * + * Access by calling `const {FleetEngineServiceType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceOpeningHours { + export enum FleetEngineServiceType { /** - * Opening periods covering for each day of the week, starting from Sunday, in chronological order. Days in which the Place is not open are not included. Only available with {@link google.maps.places.PlacesService.getDetails}. + * Fleet Engine service used to access delivery vehicles. */ - periods?: google.maps.places.PlaceOpeningHoursPeriod[]; + DELIVERY_VEHICLE_SERVICE = 'DELIVERY_VEHICLE_SERVICE', /** - * An array of seven strings representing the formatted opening hours for each day of the week. The Places Service will format and localize the opening hours appropriately for the current language. The ordering of the elements in this array depends on the language. Some languages start the week on Monday while others start on Sunday. Only available with {@link google.maps.places.PlacesService.getDetails}. Other calls may return an empty array. + * Fleet Engine service used to access task information. */ - weekday_text?: string[]; + TASK_SERVICE = 'TASK_SERVICE', /** - * Whether the Place is open at the current time. - * @deprecated open_now is deprecated as of November 2019. Use the {@link google.maps.places.PlaceOpeningHours.isOpen} method from a {@link google.maps.places.PlacesService.getDetails} result instead. See https://goo.gle/js-open-now + * Fleet Engine service used to access trip information. */ - open_now?: boolean; + TRIP_SERVICE = 'TRIP_SERVICE', /** - * Check whether the place is open now (when no date is passed), or at the given date. If this place does not have {@link google.maps.places.PlaceResult.utc_offset_minutes} or {@link google.maps.places.PlaceOpeningHours.periods} then undefined is returned ({@link google.maps.places.PlaceOpeningHours.periods} is only available via {@link google.maps.places.PlacesService.getDetails}). This method does not take exceptional hours, such as holiday hours, into consideration. + * Unknown Fleet Engine service. */ - isOpen(date?: Date): boolean | undefined; + UNKNOWN_SERVICE = 'UNKNOWN_SERVICE', } + export type FleetEngineServiceTypeString = `${google.maps.journeySharing.FleetEngineServiceType}`; /** - * Defines structured information about the opening hours of a Place. Note: If a Place is always open, the close section will be missing from the response. Clients can rely on always-open being represented as an open period containing day with value 0 and time with value "0000", and no close. + * Shipment location provider. + * Access by calling `const {FleetEngineShipmentLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceOpeningHoursPeriod { + export class FleetEngineShipmentLocationProvider extends google.maps.journeySharing.PollingLocationProvider { /** - * The closing time for the Place. + * Creates a new location provider for Fleet Engine shipment tracking. + * @param options Options for the location provider. */ - close?: google.maps.places.PlaceOpeningHoursTime; + constructor(options: google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions); /** - * The opening time for the Place. + * The tracking ID for the task that this location provider observes. Set this field to begin tracking. */ - open: google.maps.places.PlaceOpeningHoursTime; + trackingId: string; + /** + * Explicitly refreshes the tracked location. + */ + refresh(): void; } /** - * Defines when a Place opens or closes. + * Options for shipment location provider. */ - export interface PlaceOpeningHoursTime { + export interface FleetEngineShipmentLocationProviderOptions { /** - * The days of the week, as a number in the range [0, 6], starting on Sunday. For example, 2 means Tuesday. + * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - day: number; + activePolylineCustomization?: ((arg0: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * The hours of the {@link google.maps.places.PlaceOpeningHoursTime.time} as a number, in the range [0, 23]. This will be reported in the Place’s time zone. + * Provides JSON Web Tokens for authenticating the client to Fleet Engine. */ - hours: number; + authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; /** - * The minutes of the {@link google.maps.places.PlaceOpeningHoursTime.time} as a number, in the range [0, 59]. This will be reported in the Place’s time zone. + * 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 {@link google.maps.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 {@link google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - minutes: number; + deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * The timestamp (as milliseconds since the epoch, suitable for use with new Date()) representing the next occurrence of this PlaceOpeningHoursTime. It is calculated from the {@link google.maps.places.PlaceOpeningHoursTime.day} of week, the {@link google.maps.places.PlaceOpeningHoursTime.time}, and the {@link google.maps.places.PlaceResult.utc_offset_minutes}. If the {@link google.maps.places.PlaceResult.utc_offset_minutes} is undefined, then nextDate will be undefined. + * 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 {@link google.maps.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 {@link google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - nextDate?: number; + destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; + /** + * 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. + */ + pollingIntervalMillis: number | null; + /** + * The consumer's project ID from Google Cloud Console. + */ + projectId: string; + /** + * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ */ + remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + /** + * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
+ */ + takenPolylineCustomization?: ((arg0: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; + /** + * 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 {@link google.maps.journeySharing.FleetEngineShipmentLocationProvider.trackingId} to set the tracking ID and begin tracking. + */ + trackingId: string | null; + } + /** + * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineShipmentLocationProvider.update} event is triggered. + */ + export interface FleetEngineShipmentLocationProviderUpdateEvent { + /** + * The task tracking info structure returned by the update. Unmodifiable. + */ + taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo | null; + } + /** + * Filtering options for tasks in the Delivery Vehicle Location Provider. + */ + export interface FleetEngineTaskFilterOptions { + /** + * Exclusive lower bound for the completion time of the task. Used to filter for tasks that were completed after the specified time. + */ + completionTimeFrom: Date | null; + /** + * Exclusive upper bound for the completion time of the task. Used to filter for tasks that were completed before the specified time. + */ + completionTimeTo: Date | null; /** - * The time of day in 24-hour "hhmm" format. Values are in the range ["0000", "2359"]. The time will be reported in the Place’s time zone. + * The state of the task. Valid values are OPEN or CLOSED. */ - time: string; + state: string | null; } /** - * Defines Open Location Codes or "plus codes" for a Place. Plus codes can be used as a replacement for street addresses in places where they do not exist (where buildings are not numbered or streets are not named). + * Trip location provider. + * Access by calling `const {FleetEngineTripLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlacePlusCode { + export class FleetEngineTripLocationProvider extends google.maps.journeySharing.PollingLocationProvider { /** - * A plus code with a 1/8000th of a degree by 1/8000th of a degree area where the first four characters (the area code) are dropped and replaced with a locality description. For example, "9G8F+5W Zurich, Switzerland". If no suitable locality that can be found to shorten the code then this field is omitted. + * Creates a new location provider for a Fleet Engine trip. + * @param options Options for the location provider. */ - compound_code?: string; + constructor(options: google.maps.journeySharing.FleetEngineTripLocationProviderOptions); /** - * A plus code with a 1/8000th of a degree by 1/8000th of a degree area. For example, "8FVC9G8F+5W". + * The ID for the trip that this location provider observes. Set this field to begin tracking. */ - global_code: string; - } - /** - * An object used to fetch additional pages of Places results. - */ - export interface PlaceSearchPagination { + tripId: string; /** - * Indicates if further results are available. true when there is an additional results page. + * Polyline customization function that colors the active polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.activePolylineCustomization} to render a traffic-aware polyline for the active polyline. */ - hasNextPage: boolean; + static TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.TripPolylineCustomizationFunctionParams): void; /** - * Fetches the next page of results. Uses the same callback function that was provided to the first search request. + * Polyline customization function that colors the remaining polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.remainingPolylineCustomization} to render a traffic-aware polyline for the remaining polyline. */ - nextPage(): void; + static TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.TripPolylineCustomizationFunctionParams): void; + /** + * Explicitly refreshes the tracked location. + */ + refresh(): void; } /** - * A Place search query to be sent to the PlacesService. + * Options for trip location provider. */ - export interface PlaceSearchRequest { + export interface FleetEngineTripLocationProviderOptions { /** - * The bounds within which to search for Places. Both location and radius will be ignored if bounds is set. + * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.TripPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; + activePolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * A term to be matched against all available fields, including but not limited to name, type, and address, as well as customer reviews and other third-party content. + * Provides JSON Web Tokens for authenticating the client to Fleet Engine. */ - keyword?: string; + authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; /** - * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. + * 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 {@link google.maps.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 {@link google.maps.journeySharing.TripMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - language?: string | null; + destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * The location around which to search for Places. + * Customization applied to the origin marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TripMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - location?: google.maps.LatLng | google.maps.LatLngLiteral; + originMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * Restricts results to only those places at the specified price level or lower. Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive. Must be greater than or equal to minPrice , if specified. + * 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. */ - maxPriceLevel?: number; + pollingIntervalMillis: number | null; /** - * Restricts results to only those places at the specified price level or higher. Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive. Must be less than or equal to maxPrice, if specified. + * The consumer's project ID from Google Cloud Console. */ - minPriceLevel?: number; + projectId: string; /** - * Restricts results to only those places that are open right now. + * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.TripPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - openNow?: boolean; + remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * The distance from the given location within which to search for Places, in meters. The maximum allowed value is 50 000. + * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.TripPolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - radius?: number; + takenPolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * Specifies the ranking method to use when returning results. Note that when rankBy is set to DISTANCE, you must specify a location but you cannot specify a radius or bounds. - * @defaultValue {@link google.maps.places.RankBy.PROMINENCE} + * The trip ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any trip; use {@link google.maps.journeySharing.FleetEngineTripLocationProvider.tripId} to set the ID and begin tracking. */ - rankBy?: google.maps.places.RankBy; + tripId: string | null; /** - * Searches for places of the given type. The type is translated to the local language of the request's target location and used as a query string. If a query is also provided, it is concatenated to the localized type string. Results of a different type are dropped from the response. Use this field to perform language and region independent categorical searches. Valid types are given here. + * Customization applied to the vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TripMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - type?: string; + vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * Equivalent to keyword. Values in this field are combined with values in the keyword field and passed as part of the same search string. - * @deprecated Use keyword instead. + * Customization applied to a waypoint marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.TripWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - name?: string; + waypointMarkerCustomization?: ((arg0: google.maps.journeySharing.TripWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; } /** - * Represents a single Query Autocomplete prediction. + * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineTripLocationProvider.update} event is triggered. */ - export interface QueryAutocompletePrediction { + export interface FleetEngineTripLocationProviderUpdateEvent { /** - * This is the unformatted version of the query suggested by the Places service. + * The trip structure returned by the update. Unmodifiable. */ - description: string; + trip: google.maps.journeySharing.Trip | null; + } + /** + * Vehicle Location Provider. + * Access by calling `const {FleetEngineVehicleLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class FleetEngineVehicleLocationProvider extends google.maps.journeySharing.PollingLocationProvider { /** - * A set of substrings in the place's description that match elements in the user's input, suitable for use in highlighting those substrings. Each substring is identified by an offset and a length, expressed in unicode characters. + * Creates a new location provider for a Fleet Engine vehicle. + * @param options Options to pass to the location provider. */ - matched_substrings: google.maps.places.PredictionSubstring[]; + constructor(options: google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions); /** - * Only available if prediction is a place. A place ID that can be used to retrieve details about this place using the place details service (see {@link google.maps.places.PlacesService.getDetails}). + * This Field is read-only. Threshold for stale vehicle location. If the last updated location for the vehicle is older than this threshold, the vehicle will not be displayed. */ - place_id?: string; + staleLocationThresholdMillis: number; /** - * Information about individual terms in the above description. Categorical terms come first (for example, "restaurant"). Address terms appear from most to least specific. For example, "San Francisco", and "CA". + * ID for the vehicle that this location provider observes. Set this field to track a vehicle. */ - terms: google.maps.places.PredictionTerm[]; + vehicleId: string; + /** + * Polyline customization function that colors the active polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.activePolylineCustomization} to render a traffic-aware polyline for the active polyline. + */ + static TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams): void; + /** + * Polyline customization function that colors the remaining polyline according to its speed reading. Specify this function as the {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.remainingPolylineCustomization} to render a traffic-aware polyline for the remaining polyline. + */ + static TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams): void; } /** - * A QueryAutocompletion request to be sent to the QueryAutocompleteService. + * Options for vehicle location provider. */ - export interface QueryAutocompletionRequest { - /** - * Bounds for prediction biasing. Predictions will be biased towards, but not restricted to, the given bounds. Both location and radius will be ignored if bounds is set. - */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; + export interface FleetEngineVehicleLocationProviderOptions { /** - * The user entered input string. + * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - input: string; + activePolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * Location for prediction biasing. Predictions will be biased towards the given location and radius. Alternatively, bounds can be used. + * Provides JSON Web Tokens for authenticating the client to Fleet Engine. */ - location?: google.maps.LatLng; + authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher; /** - * The character position in the input term at which the service uses text for predictions (the position of the cursor in the input field). + * Customization applied to the vehicle trip destination marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - offset?: number; + destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * The radius of the area used for prediction biasing. The radius is specified in meters, and must always be accompanied by a location property. Alternatively, bounds can be used. + * Customization applied to the vehicle trip intermediate destination markers.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - radius?: number; - } - /** - * A find place from text search request to be sent to {@link google.maps.places.PlacesService.findPlaceFromPhoneNumber}. - */ - export interface FindPlaceFromPhoneNumberRequest { + intermediateDestinationMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * Fields to be included in the response, which will be billed for. If ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). + * Customization applied to the vehicle trip origin marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - fields: string[]; + originMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; /** - * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. + * 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. */ - language?: string | null; + pollingIntervalMillis: number | null; /** - * The bias used when searching for Place. The result will be biased towards, but not restricted to, the given {@link google.maps.places.LocationBias}. + * The consumer's project ID from Google Cloud Console. */ - locationBias?: google.maps.places.LocationBias; + projectId: string; /** - * The phone number of the place to look up. Format must be E.164. + * Customization applied to the remaining polyline. A remaining polyline corresponds to a portion of the route the vehicle has not yet started traversing through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - phoneNumber: string; - } - /** - * A find place from text search request to be sent to {@link google.maps.places.PlacesService.findPlaceFromQuery}. - */ - export interface FindPlaceFromQueryRequest { + remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * Fields to be included in the response, which will be billed for. If ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). + * Threshold for stale vehicle location. If the last updated location for the vehicle is older this threshold, the vehicle will not be displayed. Defaults to 24 hours in milliseconds. If the threshold is less than 0, or Infinity, the threshold will be ignored and the vehicle location will not be considered stale. */ - fields: string[]; + staleLocationThresholdMillis: number | null; /** - * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. + * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through.

Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
  • If a {@link google.maps.PolylineOptions} object is specified, the changes specified in it are applied to the polyline after the polyline has been created, overwriting its default options if they exist.
  • If a function is specified, it is invoked once when the polyline is created. (On this invocation, the isNew parameter in the function parameters object is set to true.) Additionally, this function is invoked when the polyline's coordinates change, or when the location provider receives data from Fleet Engine, regardless of whether the data corresponding to this polyline have changed.

    See {@link google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - language?: string | null; + takenPolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null; /** - * The bias used when searching for Place. The result will be biased towards, but not restricted to, the given {@link google.maps.places.LocationBias}. + * The vehicle ID to track immediately after the location provider is instantiated. If not specified, the location provider does not start tracking any vehicle; use {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider.vehicleId} to set the ID and begin tracking. */ - locationBias?: google.maps.places.LocationBias; + vehicleId: string | null; /** - * The request's query. For example, the name or address of a place. + * Customization applied to the vehicle marker.

Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
  • If a {@link google.maps.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 {@link google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams} for a list of supplied parameters and their uses.
*/ - query: string; + vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null; } /** - * The options that can be set on a SearchBox object. + * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider.update} event is triggered. */ - export interface SearchBoxOptions { + export interface FleetEngineVehicleLocationProviderUpdateEvent { /** - * The area towards which to bias query predictions. Predictions are biased towards, but not restricted to, queries targeting these bounds. + * The list of trips completed by this vehicle. Unmodifiable. */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + trips: google.maps.journeySharing.Trip[] | null; + /** + * The vehicle data structure returned by the update. Unmodifiable. + */ + vehicle: google.maps.journeySharing.Vehicle | null; } /** - * A text search request to be sent to the PlacesService. + * The map view. + * Access by calling `const {JourneySharingMapView} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface TextSearchRequest { + export class JourneySharingMapView { /** - * Bounds used to bias results when searching for Places (optional). Both location and radius will be ignored if bounds is set. Results will not be restricted to those inside these bounds; but, results inside it will rank higher. + * Instantiates a map view. + * @param options Options for the map view. */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; + constructor(options: google.maps.journeySharing.JourneySharingMapViewOptions); /** - * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. + * This Field is read-only. Automatic viewport mode. */ - language?: string | null; + automaticViewportMode: google.maps.journeySharing.AutomaticViewportModeString; /** - * The center of the area used to bias results when searching for Places. + * This Field is read-only. The DOM element backing the view. */ - location?: google.maps.LatLng | google.maps.LatLngLiteral; + element: Element; /** - * The request's query term. For example, the name of a place ('Eiffel Tower'), a category followed by the name of a location ('pizza in New York'), or the name of a place followed by a location disambiguator ('Starbucks in Sydney'). + * Enables or disables the traffic layer. */ - query?: string; + enableTraffic: boolean; /** - * The radius of the area used to bias results when searching for Places, in meters. + * This field is read-only. Sources of tracked locations to be shown in the tracking map view. To add or remove location providers, use the {@link google.maps.journeySharing.JourneySharingMapView.addLocationProvider} and {@link google.maps.journeySharing.JourneySharingMapView.removeLocationProvider} methods. */ - radius?: number; + locationProviders: google.maps.journeySharing.LocationProvider[] | null; /** - * A region code to bias results towards. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * This Field is read-only. The map object contained in the map view. */ - region?: string | null; + map: google.maps.Map; /** - * Searches for places of the given type. The type is translated to the local language of the request's target location and used as a query string. If a query is also provided, it is concatenated to the localized type string. Results of a different type are dropped from the response. Use this field to perform language and region independent categorical searches. Valid types are given here. + * This Field is read-only. The map options passed into the map via the map view. */ - type?: string; - } - /** - * Represents a postal address (e.g. for a postal service to deliver items to). Note: PostalAddress is used by the JavaScript API to instantiate objects that represent data returned by the Web Service. - * Access by calling `const {PostalAddress} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PostalAddress implements google.maps.places.PostalAddressLiteral { + mapOptions: google.maps.MapOptions; /** - * Unstructured address lines describing the lower levels of an address. + * This Field is read-only. A source of tracked locations to be shown in the tracking map view. + * @deprecated Use {@link google.maps.journeySharing.JourneySharingMapView.locationProviders} instead. */ - get addressLines(): string[]; + locationProvider: google.maps.journeySharing.LocationProvider | null; /** - * The highest administrative subdivision which is used for postal addresses of a country or region. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get administrativeArea(): string | null; + destinationMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * BCP-47 language code of the contents of this address. Examples: "zh-Hant", "ja", "ja-Latn", "en". + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get languageCode(): string | null; + originMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * Generally refers to the city/town portion of the address. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get locality(): string | null; + taskOutcomeMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * The name of the organization at the address. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get organization(): string | null; + unsuccessfulTaskMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * Postal code of the address. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get postalCode(): string | null; + vehicleMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * The recipient at the address. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get recipients(): string[]; + waypointMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * CLDR region code of the country/region of the address. Example: "CH" for Switzerland. See https://cldr.unicode.org/ and https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. + * 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. + * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get regionCode(): string; + anticipatedRoutePolylineSetup: google.maps.journeySharing.PolylineSetup; /** - * Sorting code of the address. + * 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. + * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get sortingCode(): string | null; + takenRoutePolylineSetup: google.maps.journeySharing.PolylineSetup; /** - * Sublocality of the address such as neighborhoods, boroughs, or districts. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - get sublocality(): string | null; + pingMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * Converts to a plain object. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - toJSON(key?: string): unknown; - } - /** - * Data for hydrating a PostalAddress. - */ - export interface PostalAddressLiteral { + successfulTaskMarkerSetup: google.maps.journeySharing.MarkerSetup; /** - * See {@link google.maps.places.PostalAddress.addressLines}. + * Returns the destination markers, if any. + * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. */ - addressLines?: Iterable; + destinationMarkers: google.maps.Marker[]; /** - * See {@link google.maps.places.PostalAddress.administrativeArea}. + * Returns the origin markers, if any. + * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. */ - administrativeArea?: string | null; + originMarkers: google.maps.Marker[]; /** - * See {@link google.maps.places.PostalAddress.languageCode}. + * Returns the successful task markers, if any. + * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. */ - languageCode?: string | null; + successfulTaskMarkers: google.maps.Marker[]; /** - * See {@link google.maps.places.PostalAddress.locality}. + * Returns the task outcome markers, if any. + * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. */ - locality?: string | null; + taskOutcomeMarkers: google.maps.Marker[]; /** - * See {@link google.maps.places.PostalAddress.organization}. + * Returns the unsuccessful task markers, if any. + * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. */ - organization?: string | null; + unsuccessfulTaskMarkers: google.maps.Marker[]; /** - * See {@link google.maps.places.PostalAddress.postalCode}. + * Returns the vehicle markers, if any. + * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. */ - postalCode?: string | null; + vehicleMarkers: google.maps.Marker[]; /** - * See {@link google.maps.places.PostalAddress.recipients}. + * Returns the waypoint markers, if any. + * @deprecated getting a list of markers via the MapView is deprecated. Use the MarkerCustomizationFunctions for your location provider to receive callbacks when a marker is added to the map or updated. */ - recipients?: Iterable; + waypointMarkers: google.maps.Marker[]; /** - * See {@link google.maps.places.PostalAddress.regionCode}. + * Returns the anticipated route polylines, if any. + * @deprecated getting a list of polylines via the MapView is deprecated. Use the PolylineCustomizationFunctions for your location provider to receive callbacks when a polyline is added to the map or updated. */ - regionCode: string; + anticipatedRoutePolylines: google.maps.Polyline[]; /** - * See {@link google.maps.places.PostalAddress.sortingCode}. + * Returns the taken route polylines, if any. + * @deprecated getting a list of polylines via the MapView is deprecated. Use the PolylineCustomizationFunctions for your location provider to receive callbacks when a polyline is added to the map or updated. */ - sortingCode?: string | null; + takenRoutePolylines: google.maps.Polyline[]; /** - * See {@link google.maps.places.PostalAddress.sublocality}. + * Adds a location provider to the map view. If the location provider is already added, no action is performed. */ - sublocality?: string | null; - } - /** - * Represents a session token used for tracking an autocomplete session. - * Access by calling `const {AutocompleteSessionToken} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AutocompleteSessionToken { + addLocationProvider(locationProvider: google.maps.journeySharing.LocationProvider): void; /** - * Creates a new instance of AutocompleteSessionToken. + * Removes a location provider from the map view. If the location provider is not already added to the map view, no action is performed. */ - constructor(); + removeLocationProvider(locationProvider: google.maps.journeySharing.LocationProvider): void; } /** - * Plus code for the Place. See https://plus.codes/ for more information. - * Access by calling `const {PlusCode} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Options for the map view. */ - export class PlusCode { + export interface JourneySharingMapViewOptions { /** - * A plus code with a 1/8000th of a degree by 1/8000th of a degree area where the first four characters (the area code) are dropped and replaced with a locality description. For example, "9G8F+5W Zurich, Switzerland". + * 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. */ - get compoundCode(): string | null; + automaticViewportMode?: google.maps.journeySharing.AutomaticViewportModeString | null; /** - * A plus code with a 1/8000th of a degree by 1/8000th of a degree area. For example, "8FVC9G8F+5W". + * The DOM element backing the view. Required. */ - get globalCode(): string | null; + element: Element; /** - * Converts to a plain object. + * Sources of tracked locations to be shown in the tracking map view. Optional. */ - toJSON(key?: string): unknown; - } - /** - * A widget that provides Place predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered. - * Access by calling `const {Autocomplete} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated As of March 1st, 2025, google.maps.places.Autocomplete is not available to new customers. Please use {@link google.maps.places.PlaceAutocompleteElement} instead. At this time, google.maps.places.Autocomplete is not scheduled to be discontinued, but {@link google.maps.places.PlaceAutocompleteElement} is recommended over google.maps.places.Autocomplete. While google.maps.places.Autocomplete will continue to receive bug fixes for any major regressions, existing bugs in google.maps.places.Autocomplete will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details and https://developers.google.com/maps/documentation/javascript/places-migration-overview for the migration guide. - */ - export class Autocomplete extends google.maps.MVCObject { + locationProviders: google.maps.journeySharing.LocationProvider[] | null; /** - * Creates a new instance of Autocomplete that attaches to the specified input text field with the given options. - * @param inputField The <input> text field to which the Autocomplete should be attached. - * @param opts Options. + * Map options passed into the google.maps.Map constructor. */ - constructor(inputField: HTMLInputElement, opts?: google.maps.places.AutocompleteOptions | null); + mapOptions?: google.maps.MapOptions | null; /** - * Returns the bounds to which predictions are biased. + * A source of tracked locations to be shown in the tracking map view. Optional. + * @deprecated Use {@link google.maps.journeySharing.JourneySharingMapViewOptions.locationProviders} instead. */ - getBounds(): google.maps.LatLngBounds | undefined; + locationProvider: google.maps.journeySharing.LocationProvider | null; /** - * Returns the fields to be included for the Place in the details response when the details are successfully retrieved. For a list of fields see {@link google.maps.places.PlaceResult}. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - getFields(): string[] | undefined; + destinationMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; /** - * Returns the details of the Place selected by user if the details were successfully retrieved. Otherwise returns a stub Place object, with the name property set to the current value of the input field. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - getPlace(): google.maps.places.PlaceResult; + originMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; /** - * Sets the preferred area within which to return Place results. Results are biased towards, but not restricted to, this area. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | undefined): void; + taskOutcomeMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; /** - * Sets the component restrictions. Component restrictions are used to restrict predictions to only those within the parent component. For example, the country. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - setComponentRestrictions(restrictions: google.maps.places.ComponentRestrictions | null): void; + unsuccessfulTaskMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; /** - * Sets the fields to be included for the Place in the details response when the details are successfully retrieved. For a list of fields see {@link google.maps.places.PlaceResult}. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - setFields(fields: string[] | undefined): void; - - setOptions(options: google.maps.places.AutocompleteOptions | null): void; + vehicleMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; /** - * Sets the types of predictions to be returned. For supported types, see the developer's guide. If no types are specified, all types will be returned. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - setTypes(types: string[] | null): void; - } - /** - * An Autocomplete response returned by the call to {@link google.maps.places.AutocompleteService.getPlacePredictions} containing a list of {@link google.maps.places.AutocompletePrediction}s. - */ - export interface AutocompleteResponse { + waypointMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; /** - * The list of {@link google.maps.places.AutocompletePrediction}s. + * 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. + * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - predictions: google.maps.places.AutocompletePrediction[]; - } - /** - * Contains methods related to retrieving Autocomplete predictions. - * Access by calling `const {AutocompleteService} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated As of March 1st, 2025, google.maps.places.AutocompleteService is not available to new customers. Please use {@link google.maps.places.AutocompleteSuggestion} instead. At this time, google.maps.places.AutocompleteService is not scheduled to be discontinued, but {@link google.maps.places.AutocompleteSuggestion} is recommended over google.maps.places.AutocompleteService. While google.maps.places.AutocompleteService will continue to receive bug fixes for any major regressions, existing bugs in google.maps.places.AutocompleteService will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details and https://developers.google.com/maps/documentation/javascript/places-migration-overview for the migration guide. - */ - export class AutocompleteService { + anticipatedRoutePolylineSetup?: google.maps.journeySharing.PolylineSetup | null; /** - * Creates a new instance of the AutocompleteService. + * 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. + * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - constructor(); + takenRoutePolylineSetup?: google.maps.journeySharing.PolylineSetup | null; /** - * Retrieves place autocomplete predictions based on the supplied autocomplete request. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - getPlacePredictions(request: google.maps.places.AutocompletionRequest, callback?: ((arg0: google.maps.places.AutocompletePrediction[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void)): Promise; + pingMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; /** - * Retrieves query autocomplete predictions based on the supplied query autocomplete request. + * 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. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. This field will be removed in the future. */ - getQueryPredictions(request: google.maps.places.QueryAutocompletionRequest, callback: (arg0: google.maps.places.QueryAutocompletePrediction[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; + successfulTaskMarkerSetup?: google.maps.journeySharing.MarkerSetup | null; } - - export type LocationBias = google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | google.maps.Circle | google.maps.CircleLiteral | string; - - export type LocationRestriction = google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * Ranking options for a PlaceSearchRequest. - * - * Access by calling `const {RankBy} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Parent class of all location providers. */ - export enum RankBy { - /** - * Ranks place results by distance from the location. - */ - DISTANCE = 0, + export class LocationProvider { /** - * Ranks place results by their prominence. + * Adds a {@link google.maps.MapsEventListener} for an event fired by this location provider. Returns an identifier for this listener that can be used with {@link google.maps.event.removeListener}. */ - PROMINENCE = 0, + addListener(eventName: string, handler: Function): google.maps.MapsEventListener; } /** - * Contains methods related to searching for places and retrieving details about a place. - * Access by calling `const {PlacesService} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated As of March 1st, 2025, google.maps.places.PlacesService is not available to new customers. Please use {@link google.maps.places.Place} instead. At this time, google.maps.places.PlacesService is not scheduled to be discontinued, but {@link google.maps.places.Place} is recommended over google.maps.places.PlacesService. While google.maps.places.PlacesService will continue to receive bug fixes for any major regressions, existing bugs in google.maps.places.PlacesService will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details and https://developers.google.com/maps/documentation/javascript/places-migration-overview for the migration guide. + * Parameters that are common to all marker customization functions. No object of this class is provided directly to any marker customization function; an object of one of its descendent classes is provided instead. */ - export class PlacesService { - /** - * Creates a new instance of the PlacesService that renders attributions in the specified container. - * @param attrContainer - */ - constructor(attrContainer: HTMLDivElement | google.maps.Map); - /** - * Retrieves a list of places based on a phone number. In most cases there should be just one item in the result list, however if the request is ambiguous more than one result may be returned. The {@link google.maps.places.PlaceResult}s passed to the callback are subsets of a full {@link google.maps.places.PlaceResult}. Your app can get a more detailed {@link google.maps.places.PlaceResult} for each place by calling {@link google.maps.places.PlacesService.getDetails} and passing the {@link google.maps.places.PlaceResult.place_id} for the desired place. - */ - findPlaceFromPhoneNumber(request: google.maps.places.FindPlaceFromPhoneNumberRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; + export interface MarkerCustomizationFunctionParams { /** - * Retrieves a list of places based on a query string. In most cases there should be just one item in the result list, however if the request is ambiguous more than one result may be returned. The {@link google.maps.places.PlaceResult}s passed to the callback are subsets of a full {@link google.maps.places.PlaceResult}. Your app can get a more detailed {@link google.maps.places.PlaceResult} for each place by calling {@link google.maps.places.PlacesService.getDetails} and passing the {@link google.maps.places.PlaceResult.place_id} for the desired place. + * The default options used to create this marker. */ - findPlaceFromQuery(request: google.maps.places.FindPlaceFromQueryRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; + defaultOptions: google.maps.MarkerOptions; /** - * Retrieves details about the place identified by the given placeId. + * If true, the marker was newly created, and the marker customization function is being called for the first time, before the marker has been added to the map view. False otherwise. */ - getDetails(request: google.maps.places.PlaceDetailsRequest, callback: (arg0: google.maps.places.PlaceResult | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; + isNew: boolean; /** - * Retrieves a list of places near a particular location, based on keyword or type. Location must always be specified, either by passing a LatLngBounds, or location and radius parameters. The {@link google.maps.places.PlaceResult}s passed to the callback are subsets of the full {@link google.maps.places.PlaceResult}. Your app can get a more detailed {@link google.maps.places.PlaceResult} for each place by sending a Place Details request passing the {@link google.maps.places.PlaceResult.place_id} for the desired place. The {@link google.maps.places.PlaceSearchPagination} object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results). + * The marker. Any customizations should be made to this object directly. */ - nearbySearch(request: google.maps.places.PlaceSearchRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString, arg2: google.maps.places.PlaceSearchPagination | null) => void): void; + marker: google.maps.Marker; + } + /** + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. + */ + export type MarkerSetup = google.maps.journeySharing.MarkerSetupOptions | ((arg0: google.maps.journeySharing.DefaultMarkerSetupOptions) => google.maps.journeySharing.MarkerSetupOptions); + /** + * MarkerSetup options. + * @deprecated Marker setup is deprecated. Use the MarkerCustomizationFunction methods for your location provider instead. + */ + export interface MarkerSetupOptions { /** - * Retrieves a list of places based on a query string (for example, "pizza in New York", or "shoe stores near Ottawa"). Location parameters are optional; when the location is specified, results are only biased toward nearby results rather than restricted to places inside the area. Use textSearch when you want to search for places using an arbitrary string, and in cases where you may not want to restrict search results to a particular location. The PlaceSearchPagination object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results). + * Marker options. */ - textSearch(request: google.maps.places.TextSearchRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString, arg2: google.maps.places.PlaceSearchPagination | null) => void): void; + markerOptions?: google.maps.MarkerOptions | null; } /** - * The status returned by the PlacesService on the completion of its searches. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.places.PlacesServiceStatus.OK. - * - * Access by calling `const {PlacesServiceStatus} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Parameters specific to marker customization functions that apply options to markers representing planned stops. Used by {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.plannedStopMarkerCustomization}. */ - export enum PlacesServiceStatus { + export interface PlannedStopMarkerCustomizationFunctionParams extends google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams { /** - * This request was invalid. + * The 0-based index of this stop in the list of remaining stops. */ - INVALID_REQUEST = 'INVALID_REQUEST', + stopIndex: number; + } + /** + * Parent class of polling location providers. + */ + export class PollingLocationProvider extends google.maps.journeySharing.LocationProvider { /** - * The place referenced was not found. + * True if this location provider is polling. Read only. */ - NOT_FOUND = 'NOT_FOUND', + isPolling: boolean; /** - * The response contains a valid result. + * 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. */ - OK = 'OK', + pollingIntervalMillis: number; + } + /** + * The event object passed to the event handler when the {@link google.maps.journeySharing.PollingLocationProvider.ispollingchange} event is triggered. + */ + export interface PollingLocationProviderIsPollingChangeEvent { /** - * The application has gone over its request quota. + * 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. */ - OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', + error: Error | null; + } + /** + * Parameters that are common to all polyline customization functions. No object of this class is provided directly to any polyline customization function; an object of one of its descendent classes is provided instead. + */ + export interface PolylineCustomizationFunctionParams { /** - * The application is not allowed to use the PlacesService. + * The default options used to create this set of polylines. */ - REQUEST_DENIED = 'REQUEST_DENIED', + defaultOptions: google.maps.PolylineOptions; /** - * The PlacesService request could not be processed due to a server error. The request may succeed if you try again. + * If true, the list of polylines was newly created, and the polyline customization function is being called for the first time. False otherwise. */ - UNKNOWN_ERROR = 'UNKNOWN_ERROR', + isNew: boolean; /** - * No result was found for this request. + * The list of polylines created. They are arranged sequentially to form the rendered route. */ - ZERO_RESULTS = 'ZERO_RESULTS', + polylines: google.maps.Polyline[]; } - export type PlacesServiceStatusString = `${google.maps.places.PlacesServiceStatus}`; /** - * A widget that provides query predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered. - * Access by calling `const {SearchBox} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated As of March 1st, 2025, google.maps.places.SearchBox is not available to new customers. At this time, google.maps.places.SearchBox is not scheduled to be discontinued and will continue to receive bug fixes for any major regressions. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details. + * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. */ - export class SearchBox extends google.maps.MVCObject { - /** - * Creates a new instance of SearchBox that attaches to the specified input text field with the given options. - * @param inputField - * @param opts - */ - constructor(inputField: HTMLInputElement, opts?: google.maps.places.SearchBoxOptions | null); - /** - * Returns the bounds to which query predictions are biased. - */ - getBounds(): google.maps.LatLngBounds | undefined; + export type PolylineSetup = google.maps.journeySharing.PolylineSetupOptions | ((arg0: google.maps.journeySharing.DefaultPolylineSetupOptions) => google.maps.journeySharing.PolylineSetupOptions); + /** + * PolylineSetup options. + * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead. + */ + export interface PolylineSetupOptions { /** - * Returns the query selected by the user to be used with places_changed event. + * Polyline options. */ - getPlaces(): google.maps.places.PlaceResult[] | undefined; + polylineOptions?: google.maps.PolylineOptions | null; /** - * Sets the region to use for biasing query predictions. Results will only be biased towards this area and not be completely restricted to it. + * Polyline visibility. */ - setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): void; + visible?: boolean | null; } /** - * Options for PlaceAllContentElement. + * Parameters specific to marker customization functions that apply options to markers representing shipment delivery vehicle and destination locations. Used by {@link google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions.deliveryVehicleMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions.destinationMarkerCustomization}. */ - export interface PlaceAllContentElementOptions { + export interface ShipmentMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { + /** + * Information for the task associated with this marker. + */ + taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo; } /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show all available content. Append this element as a child to use it. For example:
 <gmp-place-details>
  <gmp-place-all-content></gmp-place-all-content>
</gmp-place-details>
- * Access by calling `const {PlaceAllContentElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineShipmentLocationProvider}. */ - export class PlaceAllContentElement extends HTMLElement implements google.maps.places.PlaceAllContentElementOptions { + export interface ShipmentPolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { /** - * - * @param options + * Information for the task associated with this polyline. */ - constructor(options?: google.maps.places.PlaceAllContentElementOptions); - addEventListener(type: K, listener: (this: PlaceAllContentElement, ev: PlaceAllContentElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceAllContentElementEventMap extends HTMLElementEventMap { + taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo; } /** - * The preferred media size in cases where multiple sizes are supported, such as the vertical {@link google.maps.places.PlaceSearchElement}. + * The classification of polyline speed based on traffic data. * - * Access by calling `const {MediaSize} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {Speed} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum MediaSize { + export enum Speed { /** - * Large media size. + * Normal speed, no slowdown is detected. */ - LARGE = 'LARGE', + NORMAL = 'NORMAL', /** - * Medium media size. + * Slowdown detected, but no traffic jam formed. */ - MEDIUM = 'MEDIUM', + SLOW = 'SLOW', /** - * Small media size. + * Traffic jam detected. */ - SMALL = 'SMALL', + TRAFFIC_JAM = 'TRAFFIC_JAM', } - export type MediaSizeString = `${google.maps.places.MediaSize}`; + export type SpeedString = `${google.maps.journeySharing.Speed}`; /** - * Color options for Google Maps attribution text. Attribution may be customized to use any of these colors. - * - * Access by calling `const {AttributionColor} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Traffic density indicator on a contiguous path segment. The interval defines the starting and ending points of the segment via their indices. */ - export enum AttributionColor { + export interface SpeedReadingInterval { /** - * Black attribution text. + * The zero-based index of the ending point of the interval in the path. */ - BLACK = 'BLACK', + endPolylinePointIndex: number; /** - * Gray attribution text. + * Traffic speed in this interval. */ - GRAY = 'GRAY', + speed: google.maps.journeySharing.SpeedString; /** - * White attribution text. + * The zero-based index of the starting point of the interval in the path. */ - WHITE = 'WHITE', + startPolylinePointIndex: number; } - export type AttributionColorString = `${google.maps.places.AttributionColor}`; /** - * Orientation variants for {@link google.maps.places.PlaceDetailsCompactElement}. - * - * Access by calling `const {PlaceDetailsOrientation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The details for a task returned by Fleet Engine. */ - export enum PlaceDetailsOrientation { + export interface Task { /** - * Horizontal orientation. + * Attributes assigned to the task. */ - HORIZONTAL = 'HORIZONTAL', + attributes: { [key: string]: unknown }; /** - * Vertical orientation. + * The timestamp of the estimated completion time of the task. */ - VERTICAL = 'VERTICAL', - } - export type PlaceDetailsOrientationString = `${google.maps.places.PlaceDetailsOrientation}`; - /** - * Options for PlaceAccessibleEntranceIconElement. - */ - export interface PlaceAccessibleEntranceIconElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a wheelchair icon if the place has an accessible entrance. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>
</gmp-place-content-config>
- * Access by calling `const {PlaceAccessibleEntranceIconElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceAccessibleEntranceIconElement extends HTMLElement implements google.maps.places.PlaceAccessibleEntranceIconElementOptions { + estimatedCompletionTime: Date | null; /** - * - * @param options + * Information specific to the last location update. */ - constructor(options?: google.maps.places.PlaceAccessibleEntranceIconElementOptions); - addEventListener(type: K, listener: (this: PlaceAccessibleEntranceIconElement, ev: PlaceAccessibleEntranceIconElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceAccessibleEntranceIconElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceAddressElement. - */ - export interface PlaceAddressElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's address. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-address></gmp-place-address>
</gmp-place-content-config>
- * Access by calling `const {PlaceAddressElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceAddressElement extends HTMLElement implements google.maps.places.PlaceAddressElementOptions { + latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; /** - * - * @param options + * The task name in the format "providers/{provider_id}/tasks/{task_id}". The task_id must be a unique identifier and not a tracking ID. To store a tracking ID of a shipment, use the tracking_id field. Multiple tasks can have the same tracking_id. */ - constructor(options?: google.maps.places.PlaceAddressElementOptions); - addEventListener(type: K, listener: (this: PlaceAddressElement, ev: PlaceAddressElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceAddressElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceFeatureListElement. - */ - export interface PlaceFeatureListElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's feature list in the "About" tab. Feature list can include accessibility options, amenities, accepted payment methods, and more. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-feature-list></gmp-place-feature-list>
</gmp-place-content-config>
- * Access by calling `const {PlaceFeatureListElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceFeatureListElement extends HTMLElement implements google.maps.places.PlaceFeatureListElementOptions { - addEventListener(type: K, listener: (this: PlaceFeatureListElement, ev: PlaceFeatureListElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceFeatureListElementEventMap extends HTMLElementEventMap { - } - /** - * Access by calling `const {AccessibilityOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AccessibilityOptions { + name: string; /** - * Whether a place has a wheelchair accessible entrance. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * The outcome of the task. */ - get hasWheelchairAccessibleEntrance(): boolean | null; + outcome: string | null; /** - * Whether a place has wheelchair accessible parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * The location where the task was completed (from provider). */ - get hasWheelchairAccessibleParking(): boolean | null; + outcomeLocation: google.maps.LatLngLiteral | null; /** - * Whether a place has a wheelchair accessible restroom. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * The setter of the task outcome location ('PROVIDER' or 'LAST_VEHICLE_LOCATION'). */ - get hasWheelchairAccessibleRestroom(): boolean | null; + outcomeLocationSource: string | null; /** - * Whether a place offers wheelchair accessible seating. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * The timestamp of when the task's outcome was set (from provider). */ - get hasWheelchairAccessibleSeating(): boolean | null; - } - /** - * Address component for the Place's location. - * Access by calling `const {AddressComponent} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AddressComponent { + outcomeTime: Date | null; /** - * The full text of the address component. + * The location where the task is to be completed. */ - get longText(): string | null; + plannedLocation: google.maps.LatLngLiteral | null; + /** + * Information about the segments left to be completed for this task. + */ + remainingVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[]; + /** + * The current execution state of the task. + */ + status: string; + /** + * The time window during which the task should be completed. + */ + targetTimeWindow: google.maps.journeySharing.TimeWindow | null; /** - * The abbreviated, short text of the given address component. + * The tracking ID of the shipment. */ - get shortText(): string | null; + trackingId: string | null; /** - * An array of strings denoting the type of this address component. A list of valid types can be found here. + * The task type; for example, a break or shipment. */ - get types(): string[]; + type: string; /** - * Converts to a plain object. + * The ID of the vehicle performing this task. */ - toJSON(key?: string): unknown; + vehicleId: string | null; } /** - * Defines the spatial relationship between the target location and the area. - * - * Access by calling `const {Containment} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * TaskInfo type, used by {@link google.maps.journeySharing.DeliveryVehicleStop}. */ - export enum Containment { + export interface TaskInfo { /** - * The target location is outside the area region, but close by. + * The extra time it takes to perform the task, in milliseconds. */ - NEAR = 'NEAR', + extraDurationMillis: number | null; /** - * The target location is within the area region, close to the edge. + * The ID of the task. */ - OUTSKIRTS = 'OUTSKIRTS', + id: string | null; /** - * The target location is within the area region, close to the center. + * The time window during which the task should be completed. */ - WITHIN = 'WITHIN', + targetTimeWindow: google.maps.journeySharing.TimeWindow | null; } - export type ContainmentString = `${google.maps.places.Containment}`; /** - * Area information and the area's relationship with the target location. - * Access by calling `const {Area} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Parameters specific to marker customization functions that apply options to markers representing planned or actual task locations. Used by {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.taskMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.taskOutcomeMarkerCustomization}. */ - export class Area { + export interface TaskMarkerCustomizationFunctionParams extends google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams { /** - * Defines the spatial relationship between the target location and the area. + * The task location represented by this marker. */ - get containment(): google.maps.places.ContainmentString | null; + task: google.maps.journeySharing.Task; + } + /** + * The details for a task tracking info object returned by Fleet Engine. + */ + export interface TaskTrackingInfo { /** - * The area's place. + * Attributes assigned to the task. */ - get place(): google.maps.places.Place; + attributes: { [key: string]: unknown }; /** - * Converts to a plain object. + * The estimated arrival time to the stop location. */ - toJSON(key?: string): unknown; - } - /** - * Defines the spatial relationship between the target location and the landmark - * - * Access by calling `const {SpatialRelationship} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum SpatialRelationship { + estimatedArrivalTime: Date | null; /** - * The target is directly opposite the landmark on the other side of the road. + * The estimated completion time of a Task. */ - ACROSS_THE_ROAD = 'ACROSS_THE_ROAD', + estimatedTaskCompletionTime: Date | null; /** - * Not on the same route as the landmark but a single turn away. + * Information specific to the last location update. */ - AROUND_THE_CORNER = 'AROUND_THE_CORNER', + latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; /** - * Close to the landmark's structure but further away from its street entrances. + * The name in the format "providers/{provider_id}/taskTrackingInfo/{tracking_id}", where tracking_id represents the tracking ID. */ - BEHIND = 'BEHIND', + name: string; /** - * The target is directly adjacent to the landmark. + * The location where the Task will be completed. */ - BESIDE = 'BESIDE', + plannedLocation: google.maps.LatLng | null; /** - * On the same route as the landmark but not besides or across. + * The total remaining distance in meters to the VehicleStop of interest. */ - DOWN_THE_ROAD = 'DOWN_THE_ROAD', + remainingDrivingDistanceMeters: number | null; /** - * The default relationship when nothing more specific below applies. + * Indicates the number of stops the vehicle remaining until the task stop is reached, including the task stop. For example, if the vehicle's next stop is the task stop, the value will be 1. */ - NEAR = 'NEAR', + remainingStopCount: number | null; /** - * The landmark has a spatial geometry and the target is within its bounds. + * A list of points which when connected forms a polyline of the vehicle's expected route to the location of this task. */ - WITHIN = 'WITHIN', - } - export type SpatialRelationshipString = `${google.maps.places.SpatialRelationship}`; - /** - * Basic landmark information and the landmark's relationship with the target location. Landmarks are prominent places that can be used to describe a location. - * Access by calling `const {Landmark} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Landmark { + routePolylinePoints: google.maps.LatLng[] | null; /** - * The landmark's place. + * The current execution state of the Task. */ - get place(): google.maps.places.Place; + state: string | null; /** - * The spatial relationship between the target location and the landmark. + * The time window during which the task should be completed. */ - get spatialRelationship(): google.maps.places.SpatialRelationshipString; + targetTimeWindow: google.maps.journeySharing.TimeWindow | null; /** - * The straight line distance, in meters, between the center point of the target and the center point of the landmark. In some situations, this value can be longer than travelDistanceMeters. + * The outcome of attempting to execute a Task. */ - get straightLineDistanceMeters(): number; + taskOutcome: string | null; /** - * The travel distance, in meters, along the road network from the target to the landmark, if known. This value does not take into account the mode of transportation, such as walking, driving, biking. + * The time when the Task's outcome was set by the provider. */ - get travelDistanceMeters(): number | null; + taskOutcomeTime: Date | null; /** - * Converts to a plain object. + * The tracking ID of a Task.
  • Must be a valid Unicode string.
  • Limited to a maximum length of 64 characters.
  • Normalized according to Unicode Normalization Form C.
  • May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
*/ - toJSON(key?: string): unknown; + trackingId: string; } /** - * A relational description of a location. Includes a ranked set of nearby landmarks and precise containing areas and their relationship to the target location. - * Access by calling `const {AddressDescriptor} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A time range. */ - export class AddressDescriptor { - /** - * A ranked list of containing or adjacent areas. The most recognizable and precise areas are ranked first. - */ - get areas(): google.maps.places.Area[]; + export interface TimeWindow { /** - * A ranked list of nearby landmarks. The most recognizable and nearby landmarks are ranked first. + * The end time of the time window (inclusive). */ - get landmarks(): google.maps.places.Landmark[]; + endTime: Date; /** - * Converts to a plain object. + * The start time of the time window (inclusive). */ - toJSON(key?: string): unknown; + startTime: Date; } /** - * Information about a data provider for a Place. - * Access by calling `const {Attribution} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The details for a trip returned by Fleet Engine. */ - export class Attribution { + export interface Trip { /** - * Name of the Place's data provider. + * Location where the customer was dropped off. */ - get provider(): string | null; + actualDropOffLocation: google.maps.LatLngLiteral | null; /** - * URI to the Place's data provider. + * Location where the customer was picked up. */ - get providerURI(): string | null; + actualPickupLocation: google.maps.LatLngLiteral | null; /** - * Converts to a plain object. + * The estimated future time when the passengers will be dropped off, or the actual time when they were dropped off. */ - toJSON(key?: string): unknown; - } - /** - * The consumer alert message. All text are rendered in the language specified by the languageCode field. - * Access by calling `const {ConsumerAlert} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class ConsumerAlert { + dropOffTime: Date | null; /** - * The details of the consumer alert message. + * Information specific to the last location update. */ - get details(): google.maps.places.ConsumerAlertDetails | null; + latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null; /** - * The language code of the consumer alert message. + * In the format "providers/{provider_id}/trips/{trip_id}". The trip_id must be a unique identifier. */ - get languageCode(): string | null; + name: string; /** - * The overview of the consumer alert message. + * Number of passengers on this trip; does not include the driver. */ - get overview(): string | null; + passengerCount: number; /** - * Converts to a plain object. + * The estimated future time when the passengers will be picked up, or the actual time when they were picked up. */ - toJSON(key?: string): unknown; - } - /** - * Details of the consumer alert message. - * Access by calling `const {ConsumerAlertDetails} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class ConsumerAlertDetails { + pickupTime: Date | null; /** - * The title to show for a link to provide more information. + * Location where the customer indicates they will be dropped off. */ - get aboutLinkTitle(): string | null; + plannedDropOffLocation: google.maps.LatLngLiteral | null; /** - * The URI for a link to provide more information. + * Location where customer indicates they will be picked up. */ - get aboutLinkURI(): string | null; + plannedPickupLocation: google.maps.LatLngLiteral | null; /** - * The description of the consumer alert message. + * An array of waypoints indicating the path from the current location to the drop-off point. */ - get description(): string | null; + remainingWaypoints: google.maps.journeySharing.VehicleWaypoint[]; /** - * The title to show together with the detailed description. + * Current status of the trip. Possible values are UNKNOWN_TRIP_STATUS, NEW, ENROUTE_TO_PICKUP, ARRIVED_AT_PICKUP, ARRIVED_AT_INTERMEDIATE_DESTINATION, ENROUTE_TO_INTERMEDIATE_DESTINATION, ENROUTE_TO_DROPOFF, COMPLETE, or CANCELED. */ - get title(): string | null; + status: string; + /** + * The type of the trip. Possible values are UNKNOWN_TRIP_TYPE, SHARED or EXCLUSIVE. + */ + type: string; + /** + * ID of the vehicle making this trip. + */ + vehicleId: string; } /** - * ContentBlock describes the content of a summary and where it came from. - * Access by calling `const {ContentBlock} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Parameters specific to marker customization functions that apply options to markers representing trip vehicle, origin and destination locations. Used by {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.vehicleMarkerCustomization}, {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.originMarkerCustomization}, and {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.destinationMarkerCustomization}. */ - export class ContentBlock { + export interface TripMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { /** - * Content related to the topic. + * The trip associated with this marker.

For information about the vehicle servicing this trip, use {@link google.maps.journeySharing.Trip.latestVehicleLocationUpdate} and {@link google.maps.journeySharing.Trip.remainingWaypoints}. */ - get content(): string | null; + trip: google.maps.journeySharing.Trip; + } + /** + * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineTripLocationProvider}. + */ + export interface TripPolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { /** - * Language code of the content. + * The trip associated with this polyline. */ - get contentLanguageCode(): string | null; + trip: google.maps.journeySharing.Trip; + } + /** + * Trip types supported by a {@link google.maps.journeySharing.Vehicle}. + * + * Access by calling `const {TripType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum TripType { /** - * A list of {@link google.maps.places.Place}s referenced. When first retrieved, each Place only contains a place ID in the id field. + * The trip is exclusive to a vehicle. */ - get referencedPlaces(): google.maps.places.Place[]; + EXCLUSIVE = 'EXCLUSIVE', /** - * Converts to a plain object. + * The trip may share a vehicle with other trips. */ - toJSON(key?: string): unknown; + SHARED = 'SHARED', + /** + * Unknown trip type. + */ + UNKNOWN_TRIP_TYPE = 'UNKNOWN_TRIP_TYPE', } + export type TripTypeString = `${google.maps.journeySharing.TripType}`; /** - * AI-generated summary of amenities near the EV charging station. This only applies to places with type electric_vehicle_charging_station. - * Access by calling `const {EVChargeAmenitySummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * TripWaypoint type. */ - export class EVChargeAmenitySummary { + export interface TripWaypoint { /** - * A summary of the nearby coffee options. + * The path distance between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in meters. */ - get coffee(): google.maps.places.ContentBlock | null; + distanceMeters: number | null; /** - * The text for the disclosure relating to this summary. + * Travel time between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in milliseconds. */ - get disclosureText(): string | null; + durationMillis: number | null; /** - * The language code of the disclosure text. + * The location of the waypoint. */ - get disclosureTextLanguageCode(): string | null; + location: google.maps.LatLng | null; /** - * A URI to report a problem with the summary. + * The path from the previous stop (or the vehicle's current location, if this stop is the first in the list of stops) to this stop. */ - get flagContentURI(): string | null; + path: google.maps.LatLng[] | null; /** - * An overview of the available amenities. + * The list of traffic speeds along the path from the previous waypoint (or vehicle location) to the current waypoint. Each interval in the list describes the traffic on a contiguous segment on the path; the interval defines the starting and ending points of the segment via their indices. See the definition of {@link google.maps.journeySharing.SpeedReadingInterval} for more details. */ - get overview(): google.maps.places.ContentBlock | null; + speedReadingIntervals: google.maps.journeySharing.SpeedReadingInterval[] | null; /** - * A summary of the nearby restaurants. + * The trip associated with this waypoint. */ - get restaurant(): google.maps.places.ContentBlock | null; + tripId: string | null; /** - * A summary of nearby stores. + * The role this waypoint plays in this trip, such as pickup or dropoff. */ - get store(): google.maps.places.ContentBlock | null; + waypointType: google.maps.journeySharing.WaypointTypeString | null; + } + /** + * Parameters specific to marker customization functions that apply options to markers representing trip waypoint locations. Used by {@link google.maps.journeySharing.FleetEngineTripLocationProviderOptions.waypointMarkerCustomization}. + */ + export interface TripWaypointMarkerCustomizationFunctionParams extends google.maps.journeySharing.TripMarkerCustomizationFunctionParams { /** - * Converts to a plain object. + * The 0-based waypoint index associated with this marker. Use this index on {@link google.maps.journeySharing.Trip.remainingWaypoints} to retrieve information about the waypoint. */ - toJSON(key?: string): unknown; + waypointIndex: number; } /** - * EV charging connector types. - * - * Access by calling `const {EVConnectorType} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The details for a vehicle returned by Fleet Engine. */ - export enum EVConnectorType { + export interface Vehicle { /** - * Combined Charging System (AC and DC). Based on SAE Type-1 J-1772 connector. + * Custom vehicle attributes. */ - CCS_COMBO_1 = 'CCS_COMBO_1', + attributes: { [key: string]: unknown }; /** - * Combined Charging System (AC and DC). Based on Type-2 Mennekes connector. + * The waypoint where current route segment ends. */ - CCS_COMBO_2 = 'CCS_COMBO_2', + currentRouteSegmentEndPoint: google.maps.journeySharing.TripWaypoint | null; /** - * CHAdeMO type connector. + * Time when the current route segment was set. */ - CHADEMO = 'CHADEMO', + currentRouteSegmentVersion: Date | null; /** - * J1772 type 1 connector. + * List of trip IDs for trips currently assigned to this vehicle. */ - J1772 = 'J1772', + currentTrips: string[] | null; /** - * The North American Charging System (NACS), standardized as SAE J3400. + * The ETA to the first entry in the waypoints field. */ - NACS = 'NACS', + etaToFirstWaypoint: Date | null; /** - * Other connector types. + * The last reported location of the vehicle. */ - OTHER = 'OTHER', + latestLocation: google.maps.journeySharing.VehicleLocationUpdate | null; /** - * The generic TESLA connector. This is NACS in the North America but can be non-NACS in other parts of the world (e.g. CCS Combo 2 (CCS2) or GB/T). This value is less representative of an actual connector type, and more represents the ability to charge a Tesla brand vehicle at a Tesla owned charging station. + * The total numbers of riders this vehicle can carry. The driver is not considered in this value. */ - TESLA = 'TESLA', + maximumCapacity: number | null; /** - * IEC 62196 type 2 connector. Often referred to as MENNEKES. + * In the format "providers/{provider_id}/vehicles/{vehicle_id}". The vehicle_id must be a unique identifier. */ - TYPE_2 = 'TYPE_2', + name: string; /** - * GB/T type corresponds to the GB/T standard in China. This type covers all GB_T types. + * The current navigation status of the vehicle. */ - UNSPECIFIED_GB_T = 'UNSPECIFIED_GB_T', + navigationStatus: google.maps.journeySharing.VehicleNavigationStatusString; /** - * Unspecified wall outlet. + * The remaining driving distance in the current route segment, in meters. */ - UNSPECIFIED_WALL_OUTLET = 'UNSPECIFIED_WALL_OUTLET', - } - export type EVConnectorTypeString = `${google.maps.places.EVConnectorType}`; - /** - * Information about the EV charging station hosted in the place. - * Access by calling `const {EVChargeOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class EVChargeOptions { + remainingDistanceMeters: number; /** - * A list of EV charging connector aggregations that contain connectors of the same type and same charge rate. + * Trip types supported by this vehicle. */ - get connectorAggregations(): google.maps.places.ConnectorAggregation[]; + supportedTripTypes: google.maps.journeySharing.TripTypeString[] | null; /** - * Number of connectors at this station. Because some ports can have multiple connectors but only be able to charge one car at a time, the number of connectors may be greater than the total number of cars which can charge simultaneously. + * The vehicle state. */ - get connectorCount(): number; + vehicleState: google.maps.journeySharing.VehicleStateString; /** - * Converts to a plain object. + * The type of this vehicle. */ - toJSON(key?: string): unknown; - } - /** - * EV charging information, aggregated for connectors of the same type and the same charge rate. - * Access by calling `const {ConnectorAggregation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class ConnectorAggregation { + vehicleType: google.maps.journeySharing.VehicleTypeString; /** - * The time when the connector availability information in this aggregation was last updated. + * The remaining waypoints assigned to this Vehicle. */ - get availabilityLastUpdateTime(): Date | null; + waypoints: google.maps.journeySharing.TripWaypoint[] | null; /** - * Number of connectors in this aggregation that are currently available. + * Last time the waypoints field was updated. */ - get availableCount(): number | null; + waypointsVersion: Date | null; + } + /** + * VehicleJourneySegment type + */ + export interface VehicleJourneySegment { /** - * Number of connectors in this aggregation. + * The travel distance from the previous stop to this stop, in meters. */ - get count(): number; + drivingDistanceMeters: number | null; /** - * The static max charging rate in kw of each connector of the aggregation. + * The travel time from the previous stop this stop, in milliseconds. */ - get maxChargeRateKw(): number; + drivingDurationMillis: number | null; /** - * Number of connectors in this aggregation that are currently out of service. + * The path from the previous stop (or the vehicle's current location, if this stop is the first in the list of stops) to this stop. */ - get outOfServiceCount(): number | null; + path: google.maps.LatLngLiteral[] | null; /** - * The connector type of this aggregation. + * Information about the stop. */ - get type(): google.maps.places.EVConnectorTypeString | null; + stop: google.maps.journeySharing.DeliveryVehicleStop | null; } /** - * A representation of an amount of money with its currency type. - * Access by calling `const {Money} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * VehicleLocationUpdate type */ - export class Money { + export interface VehicleLocationUpdate { /** - * The three-letter currency code, defined in ISO 4217. + * The heading of the update. 0 corresponds to north, 180 to south. */ - get currencyCode(): string; + heading: number | null; /** - * Number of nano (10^-9) units of the amount. + * The location of the update. */ - get nanos(): number; + location: google.maps.LatLngLiteral | google.maps.LatLng | null; /** - * The whole units of the amount. For example, if {@link google.maps.places.Money.currencyCode} is "USD", then 1 unit is 1 US dollar. + * The speed in kilometers per hour. */ - get units(): number; + speedKilometersPerHour: number | null; /** - * Returns a human-readable representation of the amount of money with its currency symbol. + * The time this update was received from the vehicle. */ - toString(): string; + time: Date | null; + } + /** + * Parameters specific to marker customization functions that apply options to vehicle markers. Used by {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.vehicleMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineFleetLocationProviderOptions.vehicleMarkerCustomization}. + */ + export interface VehicleMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams { /** - * Converts to a plain object. + * The vehicle represented by this marker. */ - toJSON(key?: string): unknown; + vehicle: google.maps.journeySharing.Vehicle; } /** - * The most recent information about fuel options in a gas station. This information is updated regularly. - * Access by calling `const {FuelOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The current navigation status of a {@link google.maps.journeySharing.Vehicle}. + * + * Access by calling `const {VehicleNavigationStatus} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class FuelOptions { + export enum VehicleNavigationStatus { /** - * A list of fuel prices for each type of fuel this station has, one entry per fuel type. + * The vehicle is within approximately 50m of the destination. */ - get fuelPrices(): google.maps.places.FuelPrice[]; + ARRIVED_AT_DESTINATION = 'ARRIVED_AT_DESTINATION', /** - * Converts to a plain object. + * Turn-by-turn navigation is available and the Driver app navigation has entered GUIDED_NAV mode. */ - toJSON(key?: string): unknown; - } - /** - * Fuel price information for a given type of fuel. - * Access by calling `const {FuelPrice} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class FuelPrice { + ENROUTE_TO_DESTINATION = 'ENROUTE_TO_DESTINATION', /** - * The price of the fuel. + * The Driver app's navigation is in FREE_NAV mode. */ - get price(): google.maps.places.Money | null; + NO_GUIDANCE = 'NO_GUIDANCE', /** - * The type of fuel. + * The vehicle has gone off the suggested route. */ - get type(): google.maps.places.FuelTypeString | null; + OFF_ROUTE = 'OFF_ROUTE', /** - * The time the fuel price was last updated. + * Unspecified navigation status. */ - get updateTime(): Date | null; + UNKNOWN_NAVIGATION_STATUS = 'UNKNOWN_NAVIGATION_STATUS', } + export type VehicleNavigationStatusString = `${google.maps.journeySharing.VehicleNavigationStatus}`; /** - * Types of fuel. - * - * Access by calling `const {FuelType} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider}. */ - export enum FuelType { - /** - * Bio-diesel. - */ - BIO_DIESEL = 'BIO_DIESEL', + export interface VehiclePolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams { /** - * Diesel fuel. + * The vehicle traversing through this polyline. */ - DIESEL = 'DIESEL', + vehicle: google.maps.journeySharing.Vehicle; + } + /** + * The current state of a {@link google.maps.journeySharing.Vehicle}. + * + * Access by calling `const {VehicleState} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum VehicleState { /** - * Diesel plus fuel. + * The vehicle is not accepting new trips. */ - DIESEL_PLUS = 'DIESEL_PLUS', + OFFLINE = 'OFFLINE', /** - * E 100. + * The vehicle is accepting new trips. */ - E100 = 'E100', + ONLINE = 'ONLINE', /** - * E 80. + * Unknown vehicle state. */ - E80 = 'E80', + UNKNOWN_VEHICLE_STATE = 'UNKNOWN_VEHICLE_STATE', + } + export type VehicleStateString = `${google.maps.journeySharing.VehicleState}`; + /** + * The type of {@link google.maps.journeySharing.Vehicle}. + * + * Access by calling `const {VehicleType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum VehicleType { /** - * E 85. + * An automobile. */ - E85 = 'E85', + AUTO = 'AUTO', /** - * LPG. + * Any vehicle that acts as a taxi (typically licensed or regulated). */ - LPG = 'LPG', + TAXI = 'TAXI', /** - * Methane. + * A vehicle with a large storage capacity. */ - METHANE = 'METHANE', + TRUCK = 'TRUCK', /** - * Midgrade. + * A motorcycle, moped, or other two-wheeled vehicle. */ - MIDGRADE = 'MIDGRADE', + TWO_WHEELER = 'TWO_WHEELER', /** - * Premium. + * Unknown vehicle type. */ - PREMIUM = 'PREMIUM', + UNKNOWN = 'UNKNOWN', + } + export type VehicleTypeString = `${google.maps.journeySharing.VehicleType}`; + /** + * VehicleWaypoint type. + */ + export interface VehicleWaypoint { /** - * Regular unleaded. + * The path distance between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in meters. */ - REGULAR_UNLEADED = 'REGULAR_UNLEADED', + distanceMeters: number | null; /** - * SP 100. + * Travel time between the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint in milliseconds. */ - SP100 = 'SP100', + durationMillis: number | null; /** - * SP 91. + * The location of the waypoint. */ - SP91 = 'SP91', + location: google.maps.LatLngLiteral | null; /** - * SP 91 E10. + * The path from the previous waypoint (or the vehicle's current location, if this waypoint is the first in the list of waypoints) to this waypoint. */ - SP91_E10 = 'SP91_E10', + path: google.maps.LatLngLiteral[] | null; /** - * SP 92. + * The list of traffic speeds along the path from the previous waypoint (or vehicle location) to the current waypoint. Each interval in the list describes the traffic on a contiguous segment on the path; the interval defines the starting and ending points of the segment via their indices. See the definition of {@link google.maps.journeySharing.SpeedReadingInterval} for more details. */ - SP92 = 'SP92', + speedReadingIntervals: google.maps.journeySharing.SpeedReadingInterval[] | null; + } + /** + * Parameters specific to marker customization functions that apply options to vehicle waypoint markers. Used by {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.originMarkerCustomization}, {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.destinationMarkerCustomization} and {@link google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions.intermediateDestinationMarkerCustomization} + */ + export interface VehicleWaypointMarkerCustomizationFunctionParams extends google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams { /** - * SP 95. + * The 0-based waypoint index associated with this marker. Use this index on {@link google.maps.journeySharing.Vehicle.waypoints} to retrieve information about the waypoint. */ - SP95 = 'SP95', + waypointIndex: number; + } + /** + * Waypoint types supported by {@link google.maps.journeySharing.Vehicle}. + * + * Access by calling `const {WaypointType} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum WaypointType { /** - * SP95 E10. + * Waypoints for dropping off riders. */ - SP95_E10 = 'SP95_E10', + DROP_OFF_WAYPOINT_TYPE = 'DROP_OFF_WAYPOINT_TYPE', /** - * SP 98. + * Waypoints for intermediate destinations in a multi-destination trip. */ - SP98 = 'SP98', + INTERMEDIATE_DESTINATION_WAYPOINT_TYPE = 'INTERMEDIATE_DESTINATION_WAYPOINT_TYPE', /** - * SP 99. + * Waypoints for picking up riders. */ - SP99 = 'SP99', + PICKUP_WAYPOINT_TYPE = 'PICKUP_WAYPOINT_TYPE', /** - * Truck diesel. + * Unknown waypoint type. */ - TRUCK_DIESEL = 'TRUCK_DIESEL', + UNKNOWN_WAYPOINT_TYPE = 'UNKNOWN_WAYPOINT_TYPE', } - export type FuelTypeString = `${google.maps.places.FuelType}`; + export type WaypointTypeString = `${google.maps.journeySharing.WaypointType}`; +} + +declare namespace google.maps.maps3d { /** - * AI-generated summary of the place. - * Access by calling `const {GenerativeSummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Specifies how altitude components in the coordinates are interpreted. + * + * Access by calling `const {AltitudeMode} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class GenerativeSummary { + export enum AltitudeMode { /** - * The text for the disclosure relating to this summary. + * Allows to express objects relative to the average mean sea level. That also means that if the terrain level of detail changes underneath the object, its absolute position will remain the same. */ - get disclosureText(): string | null; + ABSOLUTE = 'ABSOLUTE', /** - * The language code of the disclosure text. + * Allows to express objects placed on the ground. They will remain at ground level following the terrain regardless of what altitude is provided. If the object is positioned over a major body of water, it will be placed at sea level. */ - get disclosureTextLanguageCode(): string | null; + CLAMP_TO_GROUND = 'CLAMP_TO_GROUND', /** - * A URI to report a problem with the summary. + * Allows to express objects relative to the ground surface. If the terrain level of detail changes, the position of the object will remain constant relative to the ground. When over water, the altitude will be interpreted as a value in meters above sea level. */ - get flagContentURI(): string | null; + RELATIVE_TO_GROUND = 'RELATIVE_TO_GROUND', /** - * The overview of the place. + * Allows to express objects relative to the highest of ground+building+water surface. When over water, this will be water surface; when over terrain, this will be the building surface (if present) or ground surface (if no buildings). */ - get overview(): string | null; + RELATIVE_TO_MESH = 'RELATIVE_TO_MESH', + } + export type AltitudeModeString = `${google.maps.maps3d.AltitudeMode}`; + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Specifies how the camera should behave when it moves to a new position to center itself according to its opted-in child elements. + * + * Access by calling `const {AutofitsCameraAnimation} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum AutofitsCameraAnimation { /** - * The language code of the overview. + * Flies to the new position. */ - get overviewLanguageCode(): string | null; + FLY_TO = 'FLY_TO', /** - * Converts to a plain object. + * Snaps to the new position without an animation. */ - toJSON(key?: string): unknown; + NONE = 'NONE', } + export type AutofitsCameraAnimationString = `${google.maps.maps3d.AutofitsCameraAnimation}`; /** - * Links to trigger different Google Maps actions. - * Access by calling `const {GoogleMapsLinks} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * CameraOptions object used to define the properties that can be set on a camera object. The camera object can be anything that has a camera position, e.g. a current map state, or a future requested animation state. */ - export class GoogleMapsLinks { + export interface CameraOptions { /** - * A link to show the directions to the place on Google Maps. The link only populates the destination location and uses the default travel mode DRIVE. + * An enum specifying how to interpret the altitude value of the given CameraOptions object. This reuses the existing {@link google.maps.maps3d.AltitudeMode} enum. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.ABSOLUTE} */ - get directionsURI(): string | null; + altitudeMode?: google.maps.maps3d.AltitudeModeString | null; /** - * A link to show the photos for the place on Google Maps. + * See {@link google.maps.maps3d.Map3DElement.cameraPosition}. */ - get photosURI(): string | null; + cameraPosition?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; /** - * A link to show the place on Google Maps. + * See {@link google.maps.maps3d.Map3DElement.center}. */ - get placeURI(): string | null; + center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; /** - * A link to show the reviews for the place on Google Maps. + * See {@link google.maps.maps3d.Map3DElement.fov}. */ - get reviewsURI(): string | null; + fov?: number | null; /** - * A link to write a review for the place on Google Maps. + * See {@link google.maps.maps3d.Map3DElement.heading}. */ - get writeAReviewURI(): string | null; + heading?: number | null; /** - * Converts to a plain object. + * See {@link google.maps.maps3d.Map3DElement.range}. */ - toJSON(key?: string): unknown; + range?: number | null; + /** + * See {@link google.maps.maps3d.Map3DElement.roll}. + */ + roll?: number | null; + /** + * See {@link google.maps.maps3d.Map3DElement.tilt}. + */ + tilt?: number | null; } /** - * AI-generated summary of points of interest near the place. - * Access by calling `const {NeighborhoodSummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * A 3D circle overlay on a 3D map. + * Access by calling `const {CirclePathElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class NeighborhoodSummary { + export class CirclePathElement extends HTMLElement implements google.maps.maps3d.CirclePathElementOptions { /** - * A detailed description of the neighborhood. + * Creates a CirclePathElement with the options specified. + * @param options */ - get description(): google.maps.places.ContentBlock | null; + constructor(options?: google.maps.maps3d.CirclePathElementOptions); /** - * The text for the disclosure relating to this summary. + * The center of the circle. */ - get disclosureText(): string | null; + get center(): google.maps.LatLngAltitude | null; /** - * The language code of the disclosure text. + * The center of the circle. */ - get disclosureTextLanguageCode(): string | null; + set center(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined); /** - * A URI to report a problem with the summary. + * The radius of the circle in meters. */ - get flagContentURI(): string | null; + get radius(): number | null; /** - * An overview of the neighborhood. + * The radius of the circle in meters. */ - get overview(): google.maps.places.ContentBlock | null; + set radius(value: number | null | undefined); + addEventListener(type: K, listener: (this: CirclePathElement, ev: CirclePathElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface CirclePathElementEventMap extends HTMLElementEventMap { + } + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * CirclePathElementOptions object used to define the properties that can be set on a CirclePathElement. + */ + export interface CirclePathElementOptions { /** - * Converts to a plain object. + * See {@link google.maps.maps3d.CirclePathElement.center}. */ - toJSON(key?: string): unknown; + center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; + /** + * See {@link google.maps.maps3d.CirclePathElement.radius}. + */ + radius?: number | null; } /** - * A point where the Place changes its opening status. - * Access by calling `const {OpeningHoursPoint} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A flattener element is used to flatten a specified area on the map. + * Access by calling `const {FlattenerElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class OpeningHoursPoint { + export class FlattenerElement extends HTMLElement implements google.maps.maps3d.FlattenerElementOptions { /** - * The day of the week, as a number in the range [0, 6], starting on Sunday. For example, 2 means Tuesday. + * + * @param options */ - get day(): number; + constructor(options?: google.maps.maps3d.FlattenerElementOptions); /** - * The hour of the OpeningHoursPoint.time as a number, in the range [0, 23]. This will be reported in the Place’s time zone. + * The ordered sequence of coordinates that designates a closed loop. These paths define Exclusion Holes within the polygon's main path, which is the Flattening Zone. Areas within an innerPath are exempt from flattening. */ - get hour(): number; + get innerPaths(): google.maps.LatLngAltitude[][] | null; /** - * The minute of the OpeningHoursPoint.time as a number, in the range [0, 59]. This will be reported in the Place’s time zone. + * The ordered sequence of coordinates that designates a closed loop. These paths define Exclusion Holes within the polygon's main path, which is the Flattening Zone. Areas within an innerPath are exempt from flattening. */ - get minute(): number; + set innerPaths(value: Iterable> | null | undefined); /** - * Converts to a plain object. + * The ordered sequence of coordinates that designates a closed loop. This loop defines the Flattening Zone. */ - toJSON(key?: string): unknown; + get path(): google.maps.LatLngAltitude[] | null; + /** + * The ordered sequence of coordinates that designates a closed loop. This loop defines the Flattening Zone. + */ + set path(value: Iterable | null | undefined); + addEventListener(type: K, listener: (this: FlattenerElement, ev: FlattenerElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface FlattenerElementEventMap extends HTMLElementEventMap { } /** - * A period where the Place is open. - * Access by calling `const {OpeningHoursPeriod} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * FlattenerElementOptions object used to define the properties that can be set on a FlattenerElement. */ - export class OpeningHoursPeriod { - /** - * The closing time for the Place. - */ - get close(): google.maps.places.OpeningHoursPoint | null; + export interface FlattenerElementOptions { /** - * The opening time for the Place. + * See {@link google.maps.maps3d.FlattenerElement.innerPaths}. */ - get open(): google.maps.places.OpeningHoursPoint; + innerPaths?: Iterable> | null; /** - * Converts to a plain object. + * See {@link google.maps.maps3d.FlattenerElement.path}. */ - toJSON(key?: string): unknown; + path?: Iterable | null; } /** - * Information about business hours of a Place. - * Access by calling `const {OpeningHours} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Customization options for the FlyCameraAround Animation. */ - export class OpeningHours { + export interface FlyAroundAnimationOptions { /** - * Opening periods covering each day of the week, starting from Sunday, in chronological order. Does not include days where the Place is not open. + * The central point at which the camera should look at during the orbit animation. Note that the map heading will change as the camera orbits around this center point. */ - get periods(): google.maps.places.OpeningHoursPeriod[]; + camera: google.maps.maps3d.CameraOptions; /** - * An array of dates representing special days that fall within the current period. Special days impact the business hours of a place, e.g. Christmas day or one off closures. Set for currentOpeningHours and currentSecondaryOpeningHours if there are exceptional hours. + * The duration of one animation cycle in milliseconds. */ - get specialDays(): Date[]; + durationMillis?: number; /** - * An array of seven strings representing the formatted opening hours for each day of the week. The Places Service will format and localize the opening hours appropriately for the current language. The ordering of the elements in this array depends on the language. Some languages start the week on Monday, while others start on Sunday. + * Specifies the number of times an animation should repeat. If the number is zero, the animation will complete immediately after it starts. If Number.Infinity is passed, the animation will repeat forever. */ - get weekdayDescriptions(): string[]; + repeatCount?: number; /** - * Converts to a plain object. + * The number of rounds to rotate around the center in the given duration. This controls the overall speed of rotation. Passing a negative number to rounds will cause the camera to rotate in a counter-clockwise direction instead of the default clockwise direction. + * @deprecated Please use {@link google.maps.maps3d.FlyAroundAnimationOptions.repeatCount} instead. */ - toJSON(key?: string): unknown; + rounds?: number; } /** - * Access by calling `const {ParkingOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Customization options for the FlyCameraTo Animation. */ - export class ParkingOptions { - /** - * Whether a place offers free garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. - */ - get hasFreeGarageParking(): boolean | null; + export interface FlyToAnimationOptions { /** - * Whether a place offers free parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * The duration of the animation in milliseconds. A duration of 0 will teleport the camera straight to the end position. */ - get hasFreeParkingLot(): boolean | null; + durationMillis?: number; /** - * Whether a place offers free street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * The location at which the camera should point at the end of the animation. */ - get hasFreeStreetParking(): boolean | null; + endCamera: google.maps.maps3d.CameraOptions; + } + /** + * Specifies how gesture events should be handled on the map element. + * + * Access by calling `const {GestureHandling} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum GestureHandling { /** - * Whether a place offers paid garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * This lets the map choose whether to use cooperative or greedy gesture handling. This is the default behavior if not specified.

This will cause the map to enter cooperative mode if the map is dominating its scroll parent (usually the host page) to where the user cannot scroll away from the map to other content. */ - get hasPaidGarageParking(): boolean | null; + AUTO = 'AUTO', /** - * Whether a place offers paid parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * This forces cooperative mode, where modifier keys or two-finger gestures are required to scroll the map. */ - get hasPaidParkingLot(): boolean | null; + COOPERATIVE = 'COOPERATIVE', /** - * Whether a place offers paid street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * This forces greedy mode, where the host page cannot be scrolled from user events on the map element. */ - get hasPaidStreetParking(): boolean | null; + GREEDY = 'GREEDY', + } + export type GestureHandlingString = `${google.maps.maps3d.GestureHandling}`; + /** + * This event is created from clicking a Map3DElement. + * Access by calling `const {LocationClickEvent} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class LocationClickEvent extends Event { /** - * Whether a place offers valet parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * The latitude/longitude/altitude that was below the cursor when the event occurred. Please note, that at coarser levels, less accurate data will be returned. Also, sea floor elevation may be returned for the altitude value when clicking at the water surface from higher camera positions. This event bubbles up through the DOM tree. */ - get hasValetParking(): boolean | null; + position: google.maps.LatLngAltitude | null; } /** - * Access by calling `const {PaymentOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Map3DElement is an HTML interface for the 3D Map view. Note that the mode must be set for the 3D Map to start rendering. + * Access by calling `const {Map3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PaymentOptions { + export class Map3DElement extends HTMLElement implements google.maps.maps3d.Map3DElementOptions { /** - * Whether a place only accepts payment via cash. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * + * @param options */ - get acceptsCashOnly(): boolean | null; + constructor(options?: google.maps.maps3d.Map3DElementOptions); /** - * Whether a place accepts payment via credit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * The animation to use for automatic camera fitting. + * @defaultValue none */ - get acceptsCreditCards(): boolean | null; + get autofitsCameraAnimation(): google.maps.maps3d.AutofitsCameraAnimationString | null; /** - * Whether a place accepts payment via debit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * The animation to use for automatic camera fitting. + * @defaultValue none */ - get acceptsDebitCards(): boolean | null; + set autofitsCameraAnimation(value: google.maps.maps3d.AutofitsCameraAnimationString | null | undefined); /** - * Whether a place accepts payment via NFC. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + * When set, restricts the position of the camera within the specified lat/lng bounds. Note that objects outside the bounds are still rendered. Bounds can restrict both longitude and latitude, or can restrict either latitude or longitude only. For latitude-only bounds use west and east longitudes of -180 and 180, respectively. For longitude-only bounds use north and south latitudes of 90 and -90, respectively. */ - get acceptsNFC(): boolean | null; - } - /** - * Information about the author of user-generated content. - * Access by calling `const {AuthorAttribution} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AuthorAttribution { + get bounds(): google.maps.LatLngBounds | null; /** - * Author's name for this result. + * When set, restricts the position of the camera within the specified lat/lng bounds. Note that objects outside the bounds are still rendered. Bounds can restrict both longitude and latitude, or can restrict either latitude or longitude only. For latitude-only bounds use west and east longitudes of -180 and 180, respectively. For longitude-only bounds use north and south latitudes of 90 and -90, respectively. */ - get displayName(): string; + set bounds(value: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null | undefined); /** - * Author's photo URI for this result. This may not always be available. + * The position of the camera given as a LatLngAltitude. Will be derived if omitted. If center is omitted but cameraPosition is specified, center will derive from cameraPosition. If both are updated in the same run loop, cameraPosition will be favored. The fields cameraPosition and center can be one-to-one-derived from each other in context of the given shared heading, range, roll, and tilt. */ - get photoURI(): string | null; + get cameraPosition(): google.maps.LatLngAltitude | null; /** - * Author's profile URI for this result. + * The position of the camera given as a LatLngAltitude. Will be derived if omitted. If center is omitted but cameraPosition is specified, center will derive from cameraPosition. If both are updated in the same run loop, cameraPosition will be favored. The fields cameraPosition and center can be one-to-one-derived from each other in context of the given shared heading, range, roll, and tilt. */ - get uri(): string | null; + set cameraPosition(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined); /** - * Converts to a plain object. + * The center of the map given as a LatLngAltitude, where altitude is in meters above the mean sea level. Note that this is not necessarily where the camera is located, as the range field affects the camera's distance from the map center. If not set, defaults to {lat: 0, lng: 0, altitude: 63170000}. 63170000 meters is a maximum allowed altitude (Earth radius multiplied by 10). */ - toJSON(key?: string): unknown; - } - /** - * Information about a photo of a Place. - * Access by calling `const {Photo} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Photo { + get center(): google.maps.LatLngAltitude | null; /** - * Attribution text to be displayed for this photo. + * The center of the map given as a LatLngAltitude, where altitude is in meters above the mean sea level. Note that this is not necessarily where the camera is located, as the range field affects the camera's distance from the map center. If not set, defaults to {lat: 0, lng: 0, altitude: 63170000}. 63170000 meters is a maximum allowed altitude (Earth radius multiplied by 10). */ - get authorAttributions(): google.maps.places.AuthorAttribution[]; + set center(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined); /** - * A link where user can flag a problem with the photo. + * When true, all default UI buttons are hidden. + * @defaultValue false */ - get flagContentURI(): string | null; + get defaultUIHidden(): boolean; /** - * A link to show the photo on Google Maps. + * When true, all default UI buttons are hidden. + * @defaultValue false */ - get googleMapsURI(): string | null; + set defaultUIHidden(value: boolean | null | undefined); /** - * The height of the photo in pixels. + * If provided, an accessibility description (e.g. for use with screen readers) will be added to the map with the provided value. */ - get heightPx(): number; + get description(): string | null; /** - * The width of the photo in pixels. + * If provided, an accessibility description (e.g. for use with screen readers) will be added to the map with the provided value. */ - get widthPx(): number; + set description(value: string | null | undefined); /** - * Returns the image URL corresponding to the specified options. + * Specifies the vertical field of view in degrees. Valid values range from 5.0 to 80.0. Higher values increase the visible area but may introduce perspective distortion. Default: 35.0. */ - getURI(options?: google.maps.places.PhotoOptions): string; + get fov(): number | null; /** - * Converts to a plain object. + * Specifies the vertical field of view in degrees. Valid values range from 5.0 to 80.0. Higher values increase the visible area but may introduce perspective distortion. Default: 35.0. */ - toJSON(key?: string): unknown; - } - /** - * Price level for a Place. - * - * Access by calling `const {PriceLevel} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum PriceLevel { - - EXPENSIVE = 'EXPENSIVE', - - FREE = 'FREE', - - INEXPENSIVE = 'INEXPENSIVE', - - MODERATE = 'MODERATE', - - VERY_EXPENSIVE = 'VERY_EXPENSIVE', - } - export type PriceLevelString = `${google.maps.places.PriceLevel}`; - /** - * The price range associated with a Place. endPrice could be unset, which indicates a range without upper bound (e.g. "More than $100"). - * Access by calling `const {PriceRange} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PriceRange { + set fov(value: number | null | undefined); /** - * The upper end of the price range (inclusive). Price should be lower than this amount. + * Controls cooperative gesture handling. When set to COOPERATIVE, modifier keys or two-finger gestures are required to scroll the map. When set to GREEDY, the host page cannot be scrolled from user events on the map element. When set to AUTO, the gesture handling is determined by the scrollability of the host page. + * @defaultValue {@link google.maps.maps3d.GestureHandling.GREEDY} */ - get endPrice(): google.maps.places.Money | null; + get gestureHandling(): google.maps.maps3d.GestureHandlingString; /** - * The low end of the price range (inclusive). Price should be at or above this amount. + * Controls cooperative gesture handling. When set to COOPERATIVE, modifier keys or two-finger gestures are required to scroll the map. When set to GREEDY, the host page cannot be scrolled from user events on the map element. When set to AUTO, the gesture handling is determined by the scrollability of the host page. + * @defaultValue {@link google.maps.maps3d.GestureHandling.GREEDY} */ - get startPrice(): google.maps.places.Money; + set gestureHandling(value: google.maps.maps3d.GestureHandlingString | null | undefined); /** - * Converts to a plain object. + * The compass heading of the map, in degrees, where due north is zero. When there is no tilt, any roll will be interpreted as heading. */ - toJSON(key?: string): unknown; - } - /** - * Information about a review of a Place. - * Access by calling `const {Review} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Review { + get heading(): number | null; /** - * The reviewer. + * The compass heading of the map, in degrees, where due north is zero. When there is no tilt, any roll will be interpreted as heading. */ - get authorAttribution(): google.maps.places.AuthorAttribution | null; + set heading(value: number | null | undefined); /** - * A link where user can flag a problem with the review. + * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property. Only unique values will be sent. Changes to this value after instantiation may be ignored. */ - get flagContentURI(): string | null; + get internalUsageAttributionIds(): string[] | null; /** - * A link to show the review on Google Maps. + * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property. Only unique values will be sent. Changes to this value after instantiation may be ignored. */ - get googleMapsURI(): string | null; + set internalUsageAttributionIds(value: Iterable | null | undefined); /** - * The review text in its original language. + * Language in which to attempt to render the base map's language. Will default to the language requested by the developer when loading the Maps JS API. */ - get originalText(): string | null; + get language(): string | null; /** - * An IETF language code indicating the original language of the review. + * Language in which to attempt to render the base map's language. Will default to the language requested by the developer when loading the Maps JS API. */ - get originalTextLanguageCode(): string | null; - - get publishTime(): Date | null; + set language(value: string | null | undefined); /** - * The rating of this review, a number between 1.0 and 5.0 (inclusive). + * Specifies a map ID which will be used to fetch cloud-based map style for the map. */ - get rating(): number | null; + get mapId(): string | null; /** - * A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. For example `"a month ago"'. + * Specifies a map ID which will be used to fetch cloud-based map style for the map. */ - get relativePublishTimeDescription(): string | null; + set mapId(value: string | null | undefined); /** - * The localized text of the review. + * The maximum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). */ - get text(): string | null; + get maxAltitude(): number | null; /** - * An IETF language code indicating the localized language of the review. + * The maximum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). */ - get textLanguageCode(): string | null; + set maxAltitude(value: number | null | undefined); /** - * The month of the date when the review author visited the place. This field is 0-based; 0 is January, and 11 is December. + * The maximum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. */ - get visitDateMonth(): number | null; + get maxHeading(): number | null; /** - * The year of the date when the review author visited the place. + * The maximum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. */ - get visitDateYear(): number | null; + set maxHeading(value: number | null | undefined); /** - * Converts to a plain object. + * The maximum angle of incidence of the map. A valid value is between 0 and 90 degrees. */ - toJSON(key?: string): unknown; - } - /** - * AI-generated summary of the place user reviews. - * Access by calling `const {ReviewSummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class ReviewSummary { + get maxTilt(): number | null; /** - * The text for the disclosure relating to this summary. + * The maximum angle of incidence of the map. A valid value is between 0 and 90 degrees. */ - get disclosureText(): string | null; + set maxTilt(value: number | null | undefined); /** - * The language code of the disclosure text. + * The minimum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). */ - get disclosureTextLanguageCode(): string | null; + get minAltitude(): number | null; /** - * A URI to report a problem with the summary. + * The minimum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). */ - get flagContentURI(): string | null; + set minAltitude(value: number | null | undefined); /** - * A URI to show reviews of this place on Google Maps. + * The minimum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. */ - get reviewsURI(): string | null; + get minHeading(): number | null; /** - * The summary of user reviews. + * The minimum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. */ - get text(): string | null; + set minHeading(value: number | null | undefined); /** - * The language code of the summary of user reviews. + * The minimum angle of incidence of the map. A valid value is between 0 and 90 degrees. */ - get textLanguageCode(): string | null; + get minTilt(): number | null; /** - * Converts to a plain object. + * The minimum angle of incidence of the map. A valid value is between 0 and 90 degrees. */ - toJSON(key?: string): unknown; - } - /** - * Information about secondary business hours of a Place. - * Access by calling `const {SecondaryOpeningHours} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class SecondaryOpeningHours extends google.maps.places.OpeningHours { + set minTilt(value: number | null | undefined); /** - * The type of secondary opening hours. This refers to what the secondary hours apply to like takeout, delivery, or pickup. See SecondaryHoursType for a list of valid values. + * Specifies a mode the map should be rendered in. If not set, the map won't be rendered. */ - get type(): string | null; + get mode(): google.maps.maps3d.MapModeString | null; /** - * Converts to a plain object. + * Specifies a mode the map should be rendered in. If not set, the map won't be rendered. */ - toJSON(key?: string): unknown; - } - /** - * Represents a time zone from the IANA Time Zone Database https://www.iana.org/time-zones. - * Access by calling `const {TimeZone} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class TimeZone { + set mode(value: google.maps.maps3d.MapModeString | null | undefined); /** - * IANA Time Zone Database time zone. For example "America/New_York". + * The distance from camera to the center of the map, in meters. */ - get id(): string | null; + get range(): number | null; /** - * IANA Time Zone Database version number. For example "2019a". + * The distance from camera to the center of the map, in meters. */ - get version(): string | null; + set range(value: number | null | undefined); /** - * Converts to a plain object. + * Region with which to attempt to render the base map's POIs. Will default to the region requested by the developer when loading the Maps JS API. */ - toJSON(key?: string): unknown; - } - /** - * Represents a transit icon. - * Access by calling `const {TransitIcon} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class TransitIcon { + get region(): string | null; /** - * Whether the name is contained in the icon and there is no need to display it next to the icon. + * Region with which to attempt to render the base map's POIs. Will default to the region requested by the developer when loading the Maps JS API. */ - nameIncluded: boolean | null; + set region(value: string | null | undefined); /** - * The URL of the icon. + * The roll of the camera around the view vector in degrees. To resolve ambiguities, when there is no tilt, any roll will be interpreted as heading. */ - url: URL | null; + get roll(): number | null; /** - * Converts to a plain object. + * The roll of the camera around the view vector in degrees. To resolve ambiguities, when there is no tilt, any roll will be interpreted as heading. */ - toJSON(key?: string): unknown; - } - /** - * The type of a transit vehicle. - * - * Access by calling `const {TransitVehicleType} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum TransitVehicleType { + set roll(value: number | null | undefined); /** - * Airplane. + * The tilt of the camera's view vector in degrees. A view vector looking directly down at the earth would have a tilt of zero degrees. A view vector pointing away from the earth would have a tilt of 180 degrees. */ - AIRPLANE = 'AIRPLANE', + get tilt(): number | null; /** - * Bus. + * The tilt of the camera's view vector in degrees. A view vector looking directly down at the earth would have a tilt of zero degrees. A view vector pointing away from the earth would have a tilt of 180 degrees. */ - BUS = 'BUS', + set tilt(value: number | null | undefined); /** - * Cable car. + * When true, all default UI buttons are disabled. Does not disable the keyboard and gesture controls. + * @defaultValue false + * @deprecated Please use {@link google.maps.maps3d.Map3DElement.defaultUIHidden} instead. This property will be removed in a future release. */ - CABLE_CAR = 'CABLE_CAR', + defaultUIDisabled?: boolean | null; /** - * Coach. + * This method orbits the camera around a given location for a given duration. The animation can be repeated by the given number of {@link google.maps.maps3d.FlyAroundAnimationOptions.repeatCount} times.

The camera will move in a clockwise direction.

The location being orbited around is specified via {@link google.maps.maps3d.CameraOptions.center}. This is the location that will show in the center of the viewport during the orbit animation, while the camera moves around it.

The method is asynchronous because animations can only start after the map has loaded a minimum amount. The method returns once the animation has been started.

If the number of {@link google.maps.maps3d.FlyAroundAnimationOptions.repeatCount} times is zero, no spin will occur, and the animation will complete immediately after it starts. */ - COACH = 'COACH', + flyCameraAround(options: google.maps.maps3d.FlyAroundAnimationOptions): void; /** - * Commuter train. + * This method moves the camera parabolically from the current location to a given end location over a given duration. End location can be specified via {@link google.maps.maps3d.CameraOptions.cameraPosition}, which controls the exact camera position, or via {@link google.maps.maps3d.CameraOptions.center}, which controls the visible viewport center of the map.

The method is asynchronous because animations can only start after the map has loaded a minimum amount. The method returns once the animation has been started. */ - COMMUTER_TRAIN = 'COMMUTER_TRAIN', + flyCameraTo(options: google.maps.maps3d.FlyToAnimationOptions): void; /** - * Ferry. + * This method stops any fly animation that might happen to be running. The camera stays wherever it is mid-animation; it does not teleport to the end point.

The method is asynchronous because animations can only start or stop after the map has loaded a minimum amount. The method returns once the animation has stopped. */ - FERRY = 'FERRY', + stopCameraAnimation(): void; + addEventListener(type: K, listener: (this: Map3DElement, ev: Map3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Map3DElementEventMap extends HTMLElementEventMap { + "gmp-animationend": Event; + "gmp-camerapositionchange": Event; + "gmp-centerchange": Event; + "gmp-click": google.maps.maps3d.LocationClickEvent | google.maps.maps3d.PlaceClickEvent; + "gmp-error": Event; + "gmp-fovchange": Event; + "gmp-headingchange": Event; + "gmp-map-id-error": Event; + "gmp-rangechange": Event; + "gmp-rollchange": Event; + "gmp-steadychange": google.maps.maps3d.SteadyChangeEvent; + "gmp-tiltchange": Event; + } + /** + * Map3DElementOptions object used to define the properties that can be set on a Map3DElement. + */ + export interface Map3DElementOptions { /** - * Funicular. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * See {@link google.maps.maps3d.Map3DElement.autofitsCameraAnimation}. */ - FUNICULAR = 'FUNICULAR', + autofitsCameraAnimation?: google.maps.maps3d.AutofitsCameraAnimationString | null; /** - * Gondola lift. + * See {@link google.maps.maps3d.Map3DElement.bounds}. */ - GONDOLA_LIFT = 'GONDOLA_LIFT', + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * Heavy rail. + * See {@link google.maps.maps3d.Map3DElement.cameraPosition}. */ - HEAVY_RAIL = 'HEAVY_RAIL', + cameraPosition?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; /** - * High speed train. + * See {@link google.maps.maps3d.Map3DElement.center}. */ - HIGH_SPEED_TRAIN = 'HIGH_SPEED_TRAIN', + center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; /** - * Horse carriage. + * See {@link google.maps.maps3d.Map3DElement.defaultUIHidden}. */ - HORSE_CARRIAGE = 'HORSE_CARRIAGE', + defaultUIHidden?: boolean | null; /** - * Intercity bus. + * See {@link google.maps.maps3d.Map3DElement.description}. */ - INTERCITY_BUS = 'INTERCITY_BUS', + description?: string | null; /** - * Long distance train. + * See {@link google.maps.maps3d.Map3DElement.fov}. */ - LONG_DISTANCE_TRAIN = 'LONG_DISTANCE_TRAIN', + fov?: number | null; /** - * Metro rail. + * See {@link google.maps.maps3d.Map3DElement.gestureHandling}. */ - METRO_RAIL = 'METRO_RAIL', + gestureHandling?: google.maps.maps3d.GestureHandlingString | null; /** - * Monorail. + * See {@link google.maps.maps3d.Map3DElement.heading}. */ - MONORAIL = 'MONORAIL', + heading?: number | null; /** - * Rail. + * See {@link google.maps.maps3d.Map3DElement.internalUsageAttributionIds}. */ - RAIL = 'RAIL', + internalUsageAttributionIds?: Iterable | null; /** - * Share taxi. + * See {@link google.maps.maps3d.Map3DElement.language}. */ - SHARE_TAXI = 'SHARE_TAXI', + language?: string | null; /** - * Special. + * See {@link google.maps.maps3d.Map3DElement.mapId}. */ - SPECIAL = 'SPECIAL', + mapId?: string | null; /** - * Subway. + * See {@link google.maps.maps3d.Map3DElement.maxAltitude}. */ - SUBWAY = 'SUBWAY', + maxAltitude?: number | null; /** - * Tram. + * See {@link google.maps.maps3d.Map3DElement.maxHeading}. */ - TRAM = 'TRAM', + maxHeading?: number | null; /** - * Trolleybus. + * See {@link google.maps.maps3d.Map3DElement.maxTilt}. */ - TROLLEYBUS = 'TROLLEYBUS', - } - export type TransitVehicleTypeString = `${google.maps.places.TransitVehicleType}`; - /** - * Represents a transit line. - * Access by calling `const {TransitLine} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class TransitLine { + maxTilt?: number | null; /** - * The background color of the labels for this transit line in hexadecimal format (e.g., "#909CE1"). This color can also be used for drawing shapes for this transit line. + * See {@link google.maps.maps3d.Map3DElement.minAltitude}. */ - backgroundColor: string | null; + minAltitude?: number | null; /** - * The full name of this transit line (e.g., "Sunnydale local"). + * See {@link google.maps.maps3d.Map3DElement.minHeading}. */ - displayName: string | null; + minHeading?: number | null; /** - * The transit line full name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * See {@link google.maps.maps3d.Map3DElement.minTilt}. */ - displayNameLanguageCode: string | null; + minTilt?: number | null; /** - * Icon for this particular line. + * See {@link google.maps.maps3d.Map3DElement.mode}. */ - icon: google.maps.places.TransitIcon | null; + mode?: google.maps.maps3d.MapModeString | null; /** - * The id of the transit line that can be used to uniquely identify the line among other transit lines in the same transit station. This identifier is not guaranteed to be stable across different responses. + * See {@link google.maps.maps3d.Map3DElement.range}. */ - id: string | null; + range?: number | null; /** - * The short name of this transit line (e.g., "S2"). + * See {@link google.maps.maps3d.Map3DElement.region}. */ - shortDisplayName: string | null; + region?: string | null; /** - * The transit line short name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * See {@link google.maps.maps3d.Map3DElement.roll}. */ - shortDisplayNameLanguageCode: string | null; + roll?: number | null; /** - * The text color of labels for this transit line in hexadecimal format (e.g., "#909CE1"). + * See {@link google.maps.maps3d.Map3DElement.tilt}. */ - textColor: string | null; + tilt?: number | null; /** - * The URL of a webpage with details about this line. + * See {@link google.maps.maps3d.Map3DElement.defaultUIDisabled}. + * @deprecated Please use {@link google.maps.maps3d.Map3DElement.defaultUIHidden} instead. This property will be removed in a future release. */ - url: URL | null; + defaultUIDisabled?: boolean | null; + } + /** + * Specifies a mode the map should be rendered in. + * + * Access by calling `const {MapMode} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum MapMode { /** - * Icon for this particular vehicle type. + * This map mode displays a transparent layer of major streets on satellite, or photorealistic imagery. */ - vehicleIcon: google.maps.places.TransitIcon | null; + HYBRID = 'HYBRID', /** - * The type of vehicle used. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * This map mode displays a normal street map. */ - vehicleType: google.maps.places.TransitVehicleTypeString | null; + ROADMAP = 'ROADMAP', /** - * Converts to a plain object. + * This map mode displays satellite, or photorealistic imagery where available. */ - toJSON(key?: string): unknown; + SATELLITE = 'SATELLITE', } + export type MapModeString = `${google.maps.maps3d.MapMode}`; /** - * Represents a transit agency. - * Access by calling `const {TransitAgency} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Shows a position on a 3D map. Note that the position must be set for the Marker3DElement to display. + * Access by calling `const {Marker3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class TransitAgency { + export class Marker3DElement extends HTMLElement implements google.maps.maps3d.Marker3DElementOptions { /** - * The name of the agency in the requested language. + * Creates an Marker3DElement with the options specified. + * @param options */ - displayName: string | null; + constructor(options?: google.maps.maps3d.Marker3DElementOptions); /** - * The agency name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Specifies how the altitude component of the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - displayNameLanguageCode: string | null; + get altitudeMode(): google.maps.maps3d.AltitudeModeString; /** - * The URL of the agency's fare details page. + * Specifies how the altitude component of the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - fareURL: URL | null; + set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); /** - * A localized branded icon of a transit system. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * If provided, the specified marker will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false */ - icon: google.maps.places.TransitIcon | null; + get autofitsCamera(): boolean; /** - * The transit lines that are served by this agency. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * If provided, the specified marker will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false */ - lines: google.maps.places.TransitLine[]; + set autofitsCamera(value: boolean | null | undefined); /** - * The URL of the agency's homepage. + * An enumeration specifying how a Marker3DElement should behave when it collides with another Marker3DElement or with the basemap labels. + * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} */ - url: URL | null; + get collisionBehavior(): google.maps.CollisionBehaviorString; /** - * Converts to a plain object. + * An enumeration specifying how a Marker3DElement should behave when it collides with another Marker3DElement or with the basemap labels. + * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} */ - toJSON(key?: string): unknown; - } - /** - * Represents a transit stop. - * Access by calling `const {TransitStop} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class TransitStop { + set collisionBehavior(value: google.maps.CollisionBehaviorString | null | undefined); /** - * The name of the stop in the requested language. + * The collision priority used for collision detection. */ - displayName: string | null; + get collisionPriority(): number | null; /** - * The name of the stop in the requested language's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * The collision priority used for collision detection. */ - displayNameLanguageCode: string | null; + set collisionPriority(value: number | null | undefined); /** - * This field indicates whether there is an accessible path from outside the station to the stop. It does not indicate whether it is possible to board a vehicle from the stop. + * Specifies whether this marker should be drawn or not when it's occluded. The marker can be occluded by map geometry (e.g. buildings). + * @defaultValue false */ - hasWheelchairAccessibleEntrance: boolean | null; + get drawsWhenOccluded(): boolean; /** - * The id of the transit stop that can be used to uniquely identify the stop among other transit stops in the same transit station. This identifier is not guaranteed to be stable across different responses. + * Specifies whether this marker should be drawn or not when it's occluded. The marker can be occluded by map geometry (e.g. buildings). + * @defaultValue false */ - id: string | null; + set drawsWhenOccluded(value: boolean | null | undefined); /** - * The stop's location. + * Specifies whether to connect the marker to the ground. To extrude a marker, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. + * @defaultValue false + */ + get extruded(): boolean; + /** + * Specifies whether to connect the marker to the ground. To extrude a marker, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. + * @defaultValue false + */ + set extruded(value: boolean | null | undefined); + /** + * Text to be displayed by this marker. */ - location: google.maps.LatLngAltitude | null; + get label(): string | null; /** - * The platform code represented by this stop. It can be formatted in any way (e.g., "2", "Platform 2", "2-4", or "1x"). + * Text to be displayed by this marker. */ - platformCode: string | null; + set label(value: string | null | undefined); /** - * The platform code text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. */ - platformCodeLanguageCode: string | null; + get position(): google.maps.LatLngAltitude | null; /** - * The verbatim text written on the signboard for this platform (e.g., "Towards Central" or "East side & Brooklyn"). When platformCode is absent, this field is potentially the only identifier for the platform. However, both platformCode and signageText may be set simultaneously. + * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. */ - signageText: string | null; + set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); /** - * The signage text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Specifies whether this marker should preserve its size or not regardless of distance from camera. By default, the marker is scaled based on distance from camera/tilt. + * @defaultValue false */ - signageTextLanguageCode: string | null; + get sizePreserved(): boolean; /** - * Human readable identifier of the stop, used by transit agencies to distinguish stops with the same name. + * Specifies whether this marker should preserve its size or not regardless of distance from camera. By default, the marker is scaled based on distance from camera/tilt. + * @defaultValue false */ - stopCode: string | null; + set sizePreserved(value: boolean | null | undefined); /** - * The stop code text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * The zIndex compared to other markers. */ - stopCodeLanguageCode: string | null; + get zIndex(): number | null; /** - * Converts to a plain object. + * The zIndex compared to other markers. */ - toJSON(key?: string): unknown; + set zIndex(value: number | null | undefined); + addEventListener(type: K, listener: (this: Marker3DElement, ev: Marker3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Marker3DElementEventMap extends HTMLElementEventMap { } /** - * Represents transit-specific information for a place. - * Access by calling `const {TransitStation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Marker3DElementOptions object used to define the properties that can be set on a Marker3DElement. */ - export class TransitStation { - /** - * The transit agencies that serve this station. - */ - agencies: google.maps.places.TransitAgency[]; - /** - * The name of the station in the local language. - */ - displayName: string | null; + export interface Marker3DElementOptions { /** - * The local display name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * See {@link google.maps.maps3d.Marker3DElement.altitudeMode}. */ - displayNameLanguageCode: string | null; + altitudeMode?: google.maps.maps3d.AltitudeModeString | null; /** - * The transit stops at this station. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * See {@link google.maps.maps3d.Marker3DElement.autofitsCamera}. */ - stops: google.maps.places.TransitStop[]; + autofitsCamera?: boolean | null; /** - * Converts to a plain object. + * See {@link google.maps.maps3d.Marker3DElement.collisionBehavior}. */ - toJSON(key?: string): unknown; - } - /** - * Options for PlaceMediaElement. - */ - export interface PlaceMediaElementOptions { + collisionBehavior?: google.maps.CollisionBehaviorString | null; /** - * See {@link google.maps.places.PlaceMediaElement.lightboxPreferred}. + * See {@link google.maps.maps3d.Marker3DElement.collisionPriority}. */ - lightboxPreferred?: boolean | null; + collisionPriority?: number | null; /** - * See {@link google.maps.places.PlaceMediaElement.preferredSize}. + * See {@link google.maps.maps3d.Marker3DElement.drawsWhenOccluded}. */ - preferredSize?: google.maps.places.MediaSizeString | null; - } - /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's media, such as photos. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-media lightbox-preferred></gmp-place-media>
</gmp-place-content-config>
- * Access by calling `const {PlaceMediaElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceMediaElement extends HTMLElement implements google.maps.places.PlaceMediaElementOptions { + drawsWhenOccluded?: boolean | null; /** - * - * @param options + * See {@link google.maps.maps3d.Marker3DElement.extruded}. */ - constructor(options?: google.maps.places.PlaceMediaElementOptions); + extruded?: boolean | null; /** - * Whether to enable or disable the media lightbox, in cases where both options are supported. - * @defaultValue false + * See {@link google.maps.maps3d.Marker3DElement.label}. */ - get lightboxPreferred(): boolean; + label?: string | null; /** - * Whether to enable or disable the media lightbox, in cases where both options are supported. - * @defaultValue false + * See {@link google.maps.maps3d.Marker3DElement.position}. */ - set lightboxPreferred(value: boolean | null | undefined); + position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; /** - * The preferred media size in cases where multiple sizes are supported, such as the vertical {@link google.maps.places.PlaceSearchElement}. The vertical PlaceSearchElement will use MediaSize.SMALL by default if this is not specified. - * @defaultValue null + * See {@link google.maps.maps3d.Marker3DElement.sizePreserved}. */ - get preferredSize(): google.maps.places.MediaSizeString | null; + sizePreserved?: boolean | null; /** - * The preferred media size in cases where multiple sizes are supported, such as the vertical {@link google.maps.places.PlaceSearchElement}. The vertical PlaceSearchElement will use MediaSize.SMALL by default if this is not specified. - * @defaultValue null + * See {@link google.maps.maps3d.Marker3DElement.zIndex}. */ - set preferredSize(value: google.maps.places.MediaSizeString | null | undefined); - addEventListener(type: K, listener: (this: PlaceMediaElement, ev: PlaceMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceMediaElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceOpenNowStatusElement. - */ - export interface PlaceOpenNowStatusElementOptions { + zIndex?: number | null; } /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show the current open or closed status of a place. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-open-now-status></gmp-place-open-now-status>
</gmp-place-content-config>
- * Access by calling `const {PlaceOpenNowStatusElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Shows a position on a 3D map. Note that the position must be set for the Marker3DInteractiveElement to display. Unlike Marker3DElement, Marker3DInteractiveElement receives a gmp-click event. + * Access by calling `const {Marker3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceOpenNowStatusElement extends HTMLElement implements google.maps.places.PlaceOpenNowStatusElementOptions { + export class Marker3DInteractiveElement extends google.maps.maps3d.Marker3DElement implements google.maps.maps3d.Marker3DInteractiveElementOptions { /** - * + * Creates an Marker3DInteractiveElement with the options specified. * @param options */ - constructor(options?: google.maps.places.PlaceOpenNowStatusElementOptions); - addEventListener(type: K, listener: (this: PlaceOpenNowStatusElement, ev: PlaceOpenNowStatusElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceOpenNowStatusElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceOpeningHoursElement. - */ - export interface PlaceOpeningHoursElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's opening hours. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-opening-hours></gmp-place-opening-hours>
</gmp-place-content-config>
- * Access by calling `const {PlaceOpeningHoursElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceOpeningHoursElement extends HTMLElement implements google.maps.places.PlaceOpeningHoursElementOptions { - addEventListener(type: K, listener: (this: PlaceOpeningHoursElement, ev: PlaceOpeningHoursElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceOpeningHoursElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlacePhoneNumberElement. - */ - export interface PlacePhoneNumberElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's phone number. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-phone-number></gmp-place-phone-number>
</gmp-place-content-config>
- * Access by calling `const {PlacePhoneNumberElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlacePhoneNumberElement extends HTMLElement implements google.maps.places.PlacePhoneNumberElementOptions { - addEventListener(type: K, listener: (this: PlacePhoneNumberElement, ev: PlacePhoneNumberElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlacePhoneNumberElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlacePlusCodeElement. - */ - export interface PlacePlusCodeElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's plus code. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-plus-code></gmp-place-plus-code>
</gmp-place-content-config>
- * Access by calling `const {PlacePlusCodeElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlacePlusCodeElement extends HTMLElement implements google.maps.places.PlacePlusCodeElementOptions { - addEventListener(type: K, listener: (this: PlacePlusCodeElement, ev: PlacePlusCodeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlacePlusCodeElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlacePriceElement. - */ - export interface PlacePriceElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's price level or price range. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-price></gmp-place-price>
</gmp-place-content-config>
- * Access by calling `const {PlacePriceElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlacePriceElement extends HTMLElement implements google.maps.places.PlacePriceElementOptions { + constructor(options?: google.maps.maps3d.Marker3DInteractiveElementOptions); /** - * - * @param options + * When set, the popover element will be open on this marker's click. */ - constructor(options?: google.maps.places.PlacePriceElementOptions); - addEventListener(type: K, listener: (this: PlacePriceElement, ev: PlacePriceElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlacePriceElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceRatingElement. - */ - export interface PlaceRatingElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's rating. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-rating></gmp-place-rating>
</gmp-place-content-config>
- * Access by calling `const {PlaceRatingElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceRatingElement extends HTMLElement implements google.maps.places.PlaceRatingElementOptions { + get gmpPopoverTargetElement(): google.maps.maps3d.PopoverElement | null; /** - * - * @param options + * When set, the popover element will be open on this marker's click. */ - constructor(options?: google.maps.places.PlaceRatingElementOptions); - addEventListener(type: K, listener: (this: PlaceRatingElement, ev: PlaceRatingElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceRatingElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceReviewSummaryElement. - */ - export interface PlaceReviewSummaryElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's review summary. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-review-summary></gmp-place-review-summary>
</gmp-place-content-config>
- * Access by calling `const {PlaceReviewSummaryElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceReviewSummaryElement extends HTMLElement implements google.maps.places.PlaceReviewSummaryElementOptions { - addEventListener(type: K, listener: (this: PlaceReviewSummaryElement, ev: PlaceReviewSummaryElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceReviewSummaryElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceReviewsElement. - */ - export interface PlaceReviewsElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's reviews. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-reviews></gmp-place-reviews>
</gmp-place-content-config>
- * Access by calling `const {PlaceReviewsElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceReviewsElement extends HTMLElement implements google.maps.places.PlaceReviewsElementOptions { - addEventListener(type: K, listener: (this: PlaceReviewsElement, ev: PlaceReviewsElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceReviewsElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceSummaryElement. - */ - export interface PlaceSummaryElementOptions { - } - /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's summary. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-summary></gmp-place-summary>
</gmp-place-content-config>
- * Access by calling `const {PlaceSummaryElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceSummaryElement extends HTMLElement implements google.maps.places.PlaceSummaryElementOptions { - addEventListener(type: K, listener: (this: PlaceSummaryElement, ev: PlaceSummaryElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + set gmpPopoverTargetElement(value: google.maps.maps3d.PopoverElement | null | undefined); + /** + * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the Marker3DInteractiveElement with the provided value. + */ + title: string; + addEventListener(type: K, listener: (this: Marker3DInteractiveElement, ev: Marker3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface PlaceSummaryElementEventMap extends HTMLElementEventMap { + export interface Marker3DInteractiveElementEventMap extends google.maps.maps3d.Marker3DElementEventMap { + "gmp-click": google.maps.maps3d.LocationClickEvent; } /** - * Options for PlaceTypeElement. + * Marker3DInteractiveElementOptions object used to define the properties that can be set on a Marker3DInteractiveElement. */ - export interface PlaceTypeElementOptions { + export interface Marker3DInteractiveElementOptions extends google.maps.maps3d.Marker3DElementOptions { + /** + * See {@link google.maps.maps3d.Marker3DInteractiveElement.gmpPopoverTargetElement}. + */ + gmpPopoverTargetElement?: google.maps.maps3d.PopoverElement | null; + /** + * See {@link google.maps.maps3d.Marker3DInteractiveElement.title}. + */ + title?: string; } /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's type. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-type></gmp-place-type>
</gmp-place-content-config>
- * Access by calling `const {PlaceTypeElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Shows a position on a 3D map. Note that the position must be set for the MarkerElement to display.

MarkerElement supports high customization via custom HTML elements, but has lower interaction performance than Marker3DElement, especially when handling more than 1000 markers on a map. + * Access by calling `const {MarkerElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceTypeElement extends HTMLElement implements google.maps.places.PlaceTypeElementOptions { + export class MarkerElement extends HTMLElement implements google.maps.maps3d.MarkerElementOptions { /** - * + * Creates an MarkerElement with the options specified. * @param options */ - constructor(options?: google.maps.places.PlaceTypeElementOptions); - addEventListener(type: K, listener: (this: PlaceTypeElement, ev: PlaceTypeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + constructor(options?: google.maps.maps3d.MarkerElementOptions); + /** + * Specifies how the altitude component of the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + */ + get altitudeMode(): google.maps.maps3d.AltitudeModeString; + /** + * Specifies how the altitude component of the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + */ + set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + /** + * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. + * @defaultValue -50% + */ + get anchorLeft(): string; + /** + * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. + * @defaultValue -50% + */ + set anchorLeft(value: string | null | undefined); + /** + * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. + * @defaultValue -100% + */ + get anchorTop(): string; + /** + * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. + * @defaultValue -100% + */ + set anchorTop(value: string | null | undefined); + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * If provided, the specified marker will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false + */ + autofitsCamera?: boolean | null; + /** + * An enumeration specifying how a MarkerElement should behave when it collides with another MarkerElement, Marker3DElement, or with the basemap labels. + * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} + */ + get collisionBehavior(): google.maps.CollisionBehaviorString; + /** + * An enumeration specifying how a MarkerElement should behave when it collides with another MarkerElement, Marker3DElement, or with the basemap labels. + * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} + */ + set collisionBehavior(value: google.maps.CollisionBehaviorString | null | undefined); + /** + * A number which is used to help determine relative priority between {@link google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY} markers (including {@link google.maps.maps3d.Marker3DElement} ). A higher collisionPriority value indicates higher priority. + */ + get collisionPriority(): number | null; + /** + * A number which is used to help determine relative priority between {@link google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY} markers (including {@link google.maps.maps3d.Marker3DElement} ). A higher collisionPriority value indicates higher priority. + */ + set collisionPriority(value: number | null | undefined); + /** + * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. + */ + get position(): google.maps.LatLngAltitude | null; + /** + * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. + */ + set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + /** + * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the MarkerElement with the provided value. + */ + title: string; + addEventListener(type: K, listener: (this: MarkerElement, ev: MarkerElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface PlaceTypeElementEventMap extends HTMLElementEventMap { + export interface MarkerElementEventMap extends HTMLElementEventMap { } /** - * Options for PlaceTypeSpecificHighlightsElement. + * MarkerElementOptions object used to define the properties that can be set on a MarkerElement. */ - export interface PlaceTypeSpecificHighlightsElementOptions { + export interface MarkerElementOptions { + /** + * See {@link google.maps.maps3d.MarkerElement.altitudeMode}. + */ + altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + /** + * See {@link google.maps.maps3d.MarkerElement.anchorLeft}. + */ + anchorLeft?: string | null; + /** + * See {@link google.maps.maps3d.MarkerElement.anchorTop}. + */ + anchorTop?: string | null; + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * See {@link google.maps.maps3d.MarkerElement.autofitsCamera}. + */ + autofitsCamera?: boolean | null; + /** + * See {@link google.maps.maps3d.MarkerElement.collisionBehavior}. + */ + collisionBehavior?: google.maps.CollisionBehaviorString | null; + /** + * See {@link google.maps.maps3d.MarkerElement.collisionPriority}. + */ + collisionPriority?: number | null; + /** + * See {@link google.maps.maps3d.MarkerElement.position}. + */ + position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + /** + * See {@link google.maps.maps3d.MarkerElement.title}. + */ + title?: string; } /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's type-specific highlights, such as gas prices and EV charger availability. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-type-specific-highlights></gmp-place-type-specific-highlights>
</gmp-place-content-config>
- * Access by calling `const {PlaceTypeSpecificHighlightsElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Shows a position on a 3D map. Note that the position must be set for the MarkerInteractiveElement to display. Unlike MarkerElement, MarkerInteractiveElement receives a gmp-click event. + * Access by calling `const {MarkerInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceTypeSpecificHighlightsElement extends HTMLElement implements google.maps.places.PlaceTypeSpecificHighlightsElementOptions { - addEventListener(type: K, listener: (this: PlaceTypeSpecificHighlightsElement, ev: PlaceTypeSpecificHighlightsElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + export class MarkerInteractiveElement extends google.maps.maps3d.MarkerElement implements google.maps.maps3d.MarkerInteractiveElementOptions { + /** + * Creates a MarkerInteractiveElement with the options specified. + * @param options + */ + constructor(options?: google.maps.maps3d.MarkerInteractiveElementOptions); + /** + * When set, the popover element will be open on this marker's click. + */ + get gmpPopoverTargetElement(): google.maps.maps3d.PopoverElement | null; + /** + * When set, the popover element will be open on this marker's click. + */ + set gmpPopoverTargetElement(value: google.maps.maps3d.PopoverElement | null | undefined); + addEventListener(type: K, listener: (this: MarkerInteractiveElement, ev: MarkerInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface PlaceTypeSpecificHighlightsElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceWebsiteElement. - */ - export interface PlaceWebsiteElementOptions { + export interface MarkerInteractiveElementEventMap extends google.maps.maps3d.MarkerElementEventMap { + "gmp-click": google.maps.maps3d.LocationClickEvent; } /** - * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's website. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-website></gmp-place-website>
</gmp-place-content-config>
- * Access by calling `const {PlaceWebsiteElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * MarkerInteractiveElementOptions object used to define the properties that can be set on a MarkerInteractiveElement. */ - export class PlaceWebsiteElement extends HTMLElement implements google.maps.places.PlaceWebsiteElementOptions { - addEventListener(type: K, listener: (this: PlaceWebsiteElement, ev: PlaceWebsiteElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceWebsiteElementEventMap extends HTMLElementEventMap { + export interface MarkerInteractiveElementOptions extends google.maps.maps3d.MarkerElementOptions { + /** + * See {@link google.maps.maps3d.MarkerInteractiveElement.gmpPopoverTargetElement}. + */ + gmpPopoverTargetElement?: google.maps.maps3d.PopoverElement | null; } /** - * Options for PlaceAttributionElement. + * A 3D model which allows the rendering of gLTF models. Note that the position and the src must be set for the Model3DElement to display.

Core properties of the gLTF PBR should be supported. No extensions or extension properties are currently supported. + * Access by calling `const {Model3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceAttributionElementOptions { + export class Model3DElement extends HTMLElement implements google.maps.maps3d.Model3DElementOptions { /** - * See {@link google.maps.places.PlaceAttributionElement.darkSchemeColor}. + * Creates an Model3DElement with the options specified. + * @param options */ - darkSchemeColor?: google.maps.places.AttributionColorString | null; + constructor(options?: google.maps.maps3d.Model3DElementOptions); /** - * See {@link google.maps.places.PlaceAttributionElement.lightSchemeColor}. + * Specifies how altitude in the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - lightSchemeColor?: google.maps.places.AttributionColorString | null; + get altitudeMode(): google.maps.maps3d.AltitudeModeString; + /** + * Specifies how altitude in the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + */ + set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + /** + * Describes rotation of a 3D model's coordinate system to position the model on the 3D Map.

Rotations are applied to the model in the following order: roll, tilt and then heading. + */ + get orientation(): google.maps.Orientation3D | null; + /** + * Describes rotation of a 3D model's coordinate system to position the model on the 3D Map.

Rotations are applied to the model in the following order: roll, tilt and then heading. + */ + set orientation(value: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null | undefined); + /** + * Sets the Model3DElement's position. Altitude is ignored in certain modes and thus optional. + */ + get position(): google.maps.LatLngAltitude | null; + /** + * Sets the Model3DElement's position. Altitude is ignored in certain modes and thus optional. + */ + set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + /** + * Scales the model along the x, y, and z axes in the model's coordinate space. + * @defaultValue 1 + */ + get scale(): google.maps.Vector3D | null; + /** + * Scales the model along the x, y, and z axes in the model's coordinate space. + * @defaultValue 1 + */ + set scale(value: number | google.maps.Vector3D | google.maps.Vector3DLiteral | null | undefined); + /** + * Specifies the url of the 3D model. At this time, only models in the .glb format are supported.

Any relative HTTP urls will be resolved to their corresponding absolute ones.

Please note that If you're hosting your .glb model files on a different website or server than your main application, make sure to set up the correct CORS HTTP headers. This allows your application to securely access the model files from the other domain. + */ + get src(): URL | null; + /** + * Specifies the url of the 3D model. At this time, only models in the .glb format are supported.

Any relative HTTP urls will be resolved to their corresponding absolute ones.

Please note that If you're hosting your .glb model files on a different website or server than your main application, make sure to set up the correct CORS HTTP headers. This allows your application to securely access the model files from the other domain. + */ + set src(value: string | URL | null | undefined); + addEventListener(type: K, listener: (this: Model3DElement, ev: Model3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Model3DElementEventMap extends HTMLElementEventMap { } /** - * Allows customization of the Google Maps attribution text in a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement}. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. If this element is omitted, attribution will still be shown with default colors. For example:
 <gmp-place-content-config>
  <gmp-place-attribution
     light-scheme-color="black"
     dark-scheme-color="white"
  ></gmp-place-attribution>
</gmp-place-content-config>
- * Access by calling `const {PlaceAttributionElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Model3DElementOptions object used to define the properties that can be set on a Model3DElement. */ - export class PlaceAttributionElement extends HTMLElement implements google.maps.places.PlaceAttributionElementOptions { + export interface Model3DElementOptions { /** - * - * @param options + * See {@link google.maps.maps3d.Model3DElement.altitudeMode}. */ - constructor(options?: google.maps.places.PlaceAttributionElementOptions); + altitudeMode?: google.maps.maps3d.AltitudeModeString | null; /** - * The color of the Google Maps attribution in dark mode. - * @defaultValue AttributionColor.WHITE + * See {@link google.maps.maps3d.Model3DElement.orientation}. */ - get darkSchemeColor(): google.maps.places.AttributionColorString; + orientation?: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null; /** - * The color of the Google Maps attribution in dark mode. - * @defaultValue AttributionColor.WHITE + * See {@link google.maps.maps3d.Model3DElement.position}. */ - set darkSchemeColor(value: google.maps.places.AttributionColorString | null | undefined); + position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; /** - * The color of the Google Maps attribution in light mode. - * @defaultValue AttributionColor.GRAY + * See {@link google.maps.maps3d.Model3DElement.scale}. */ - get lightSchemeColor(): google.maps.places.AttributionColorString; + scale?: number | google.maps.Vector3D | google.maps.Vector3DLiteral | null; /** - * The color of the Google Maps attribution in light mode. - * @defaultValue AttributionColor.GRAY + * See {@link google.maps.maps3d.Model3DElement.src}. */ - set lightSchemeColor(value: google.maps.places.AttributionColorString | null | undefined); - addEventListener(type: K, listener: (this: PlaceAttributionElement, ev: PlaceAttributionElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceAttributionElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceContentConfigElement. - */ - export interface PlaceContentConfigElementOptions { + src?: string | URL | null; } /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement} or {@link google.maps.places.PlaceSearchElement} to show a custom set of content. Append this element as a child to use it.

For {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement} or {@link google.maps.places.PlaceSearchElement}, append any of the following elements to the {@link google.maps.places.PlaceContentConfigElement} to show the corresponding content:
{@link google.maps.places.PlaceAddressElement}, {@link google.maps.places.PlaceAccessibleEntranceIconElement}, {@link google.maps.places.PlaceAttributionElement} {@link google.maps.places.PlaceMediaElement}, {@link google.maps.places.PlaceOpenNowStatusElement}, {@link google.maps.places.PlacePriceElement}, {@link google.maps.places.PlaceRatingElement}, {@link google.maps.places.PlaceTypeElement}.

Specific to {@link google.maps.places.PlaceDetailsElement}, you may also append any of the following elements:
{@link google.maps.places.PlaceFeatureListElement} {@link google.maps.places.PlaceOpeningHoursElement}, {@link google.maps.places.PlacePhoneNumberElement}, {@link google.maps.places.PlacePlusCodeElement}, {@link google.maps.places.PlaceReviewSummaryElement}, {@link google.maps.places.PlaceReviewsElement}, {@link google.maps.places.PlaceSummaryElement}, {@link google.maps.places.PlaceTypeSpecificHighlightsElement}, {@link google.maps.places.PlaceWebsiteElement}.

The order of the children does not matter; the element renders content in a standard order which is not customizable. Example:
 <gmp-place-details>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
    <gmp-place-address></gmp-place-address>
  </gmp-place-content-config>
</gmp-place-details>
- * Access by calling `const {PlaceContentConfigElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A 3D model which allows the rendering of gLTF models. Note that the position and the src must be set for the Model3DElement to display.

Core properties of the gLTF PBR should be supported. No extensions or extension properties are currently supported.

Unlike Model3DElement, Model3DInteractiveElement receives a gmp-click event. + * Access by calling `const {Model3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceContentConfigElement extends HTMLElement implements google.maps.places.PlaceContentConfigElementOptions { + export class Model3DInteractiveElement extends google.maps.maps3d.Model3DElement implements google.maps.maps3d.Model3DInteractiveElementOptions { /** - * + * Creates a Model3DInteractiveElement with the options specified. * @param options */ - constructor(options?: google.maps.places.PlaceContentConfigElementOptions); - addEventListener(type: K, listener: (this: PlaceContentConfigElement, ev: PlaceContentConfigElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + constructor(options?: google.maps.maps3d.Model3DElementOptions); + addEventListener(type: K, listener: (this: Model3DInteractiveElement, ev: Model3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface PlaceContentConfigElementEventMap extends HTMLElementEventMap { + export interface Model3DInteractiveElementEventMap extends google.maps.maps3d.Model3DElementEventMap { + "gmp-click": google.maps.maps3d.LocationClickEvent; } /** - * Options for PlaceStandardContentElement. + * Model3DInteractiveElementOptions object used to define the properties that can be set on a Model3DInteractiveElement. */ - export interface PlaceStandardContentElementOptions { + export interface Model3DInteractiveElementOptions extends google.maps.maps3d.Model3DElementOptions { } /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a standard set of content. Append this element as a child to use it.
For {@link google.maps.places.PlaceDetailsElement}, standard content consists of:
  • media
  • address
  • rating
  • type
  • price
  • accessible entrance icon
  • website
  • phone number
  • opening hours
  • summary
  • type specific highlights
  • reviews
  • feature list

For {@link google.maps.places.PlaceDetailsCompactElement}, standard content consists of:
  • media
  • rating
  • type
  • price
  • accessible entrance icon
  • open now status

For {@link google.maps.places.PlaceSearchElement}, standard content consists of:
  • media
  • rating
  • type
  • price
  • accessible entrance icon

For example:
 <gmp-place-details>
  <gmp-place-standard-content></gmp-place-standard-content>
</gmp-place-details>
- * Access by calling `const {PlaceStandardContentElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * This event is created from clicking on a place icon on a Map3DElement. To prevent the default popover from showing up, call the preventDefault() method on this event to prevent it being handled by the Map3DElement. + * Access by calling `const {PlaceClickEvent} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceStandardContentElement extends HTMLElement implements google.maps.places.PlaceStandardContentElementOptions { + export class PlaceClickEvent extends google.maps.maps3d.LocationClickEvent { /** - * - * @param options + * The place id of the map feature. */ - constructor(options?: google.maps.places.PlaceStandardContentElementOptions); - addEventListener(type: K, listener: (this: PlaceStandardContentElement, ev: PlaceStandardContentElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceStandardContentElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceDetailsLocationRequestElement. - */ - export interface PlaceDetailsLocationRequestElementOptions { + placeId: string; /** - * The location to render the place for. + * Fetches a Place for this place id. In the resulting Place object, the id property will be populated. Additional fields can be subsequently requested via Place.fetchFields() subject to normal Places API enablement and billing. The promise is rejected if there was an error fetching the Place. */ - location?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + fetchPlace(): Promise; } /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data based on a location. Append this element as a child of a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data for the specified location. For example:
 <gmp-place-details>
  <gmp-place-details-location-request
    location="37.6207665,-122.4284806"
  ></gmp-place-details-location-request>
</gmp-place-details>
- * Access by calling `const {PlaceDetailsLocationRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A 3D polygon (like a 3D polyline) defines a series of connected coordinates in an ordered sequence. Additionally, polygons form a closed loop and define a filled region. + * Access by calling `const {Polygon3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceDetailsLocationRequestElement extends HTMLElement implements google.maps.places.PlaceDetailsLocationRequestElementOptions { + export class Polygon3DElement extends HTMLElement implements google.maps.maps3d.Polygon3DElementOptions { /** - * + * Creates an Polygon3DElement with the options specified. * @param options */ - constructor(options?: google.maps.places.PlaceDetailsLocationRequestElementOptions); + constructor(options?: google.maps.maps3d.Polygon3DElementOptions); /** - * The location to render details for in the Place Details element. Normalizes to a LatLngAltitude. - * @defaultValue null + * Specifies how altitude components in the coordinates are interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - get location(): google.maps.LatLngAltitude | null; + get altitudeMode(): google.maps.maps3d.AltitudeModeString; /** - * The location to render details for in the Place Details element. Normalizes to a LatLngAltitude. - * @defaultValue null + * Specifies how altitude components in the coordinates are interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - set location(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); - addEventListener(type: K, listener: (this: PlaceDetailsLocationRequestElement, ev: PlaceDetailsLocationRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceDetailsLocationRequestElementEventMap extends HTMLElementEventMap { - } - /** - * Options for fetching Place fields. - */ - export interface FetchFieldsRequest { + set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); /** - * List of fields to be fetched. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * If provided, the specified polygon will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false */ - fields: Iterable; + get autofitsCamera(): boolean; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * If provided, the specified polygon will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false */ - internalUsageAttributionIds?: Iterable | null; - } - /** - * Options for constructing a Place. - */ - export interface PlaceOptions { + set autofitsCamera(value: boolean | null | undefined); /** - * The unique place id. + * Specifies whether parts of the polygon which could be occluded are drawn or not. Polygons can be occluded by map geometry (e.g. buildings). + * @defaultValue false */ - id?: string; + get drawsOccludedSegments(): boolean; /** - * A language identifier for the language in which details should be returned. See the list of supported languages. + * Specifies whether parts of the polygon which could be occluded are drawn or not. Polygons can be occluded by map geometry (e.g. buildings). + * @defaultValue false */ - requestedLanguage?: string | null; + set drawsOccludedSegments(value: boolean | null | undefined); /** - * A region code of the user's region. This can affect which photos may be returned, and possibly other things. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * Specifies whether to connect the polygon to the ground. To extrude a polygon, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. + * @defaultValue false */ - requestedRegion?: string | null; + get extruded(): boolean; /** - * The unique place resource name. + * Specifies whether to connect the polygon to the ground. To extrude a polygon, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. + * @defaultValue false */ - resourceName?: string; - } - /** - * RankPreference enum for SearchByTextRequest. - * - * Access by calling `const {SearchByTextRankPreference} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum SearchByTextRankPreference { + set extruded(value: boolean | null | undefined); /** - * Ranks results by distance. + * The fill color. All CSS3 colors are supported. */ - DISTANCE = 'DISTANCE', + get fillColor(): string | null; /** - * Ranks results by relevance. + * The fill color. All CSS3 colors are supported. */ - RELEVANCE = 'RELEVANCE', - } - export type SearchByTextRankPreferenceString = `${google.maps.places.SearchByTextRankPreference}`; - /** - * Request interface for {@link google.maps.places.Place.searchByText}. - */ - export interface SearchByTextRequest { + set fillColor(value: string | null | undefined); /** - * EV-related options that can be specified for a place search request. + * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. + * @defaultValue false */ - evSearchOptions?: google.maps.places.EVSearchOptions; + get geodesic(): boolean; /** - * Fields to be included in the response, which will be billed for. If ['*'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). You can request any property in the {@link google.maps.places.Place} class as a field. + * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. + * @defaultValue false */ - fields: string[]; + set geodesic(value: boolean | null | undefined); /** - * Include places that are not yet open but are expected to open in the future. + * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths, which create multiple cut-outs inside the polygon. */ - futureOpeningBusinessesIncluded?: boolean; + get innerPaths(): google.maps.LatLngAltitude[][] | null; /** - * The requested place type. Full list of types supported: https://developers.google.com/maps/documentation/places/web-service/place-types. Only one included type is supported. See {@link google.maps.places.SearchByTextRequest.useStrictTypeFiltering} + * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths, which create multiple cut-outs inside the polygon. */ - includedType?: string; + set innerPaths(value: Iterable> | null | undefined); /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The ordered sequence of coordinates that designates a closed loop. Altitude is ignored in certain modes and thus optional. */ - internalUsageAttributionIds?: Iterable | null; + get path(): google.maps.LatLngAltitude[] | null; /** - * Used to restrict the search to places that are currently open. - * @defaultValue false + * The ordered sequence of coordinates that designates a closed loop. Altitude is ignored in certain modes and thus optional. */ - isOpenNow?: boolean; + set path(value: Iterable | null | undefined); /** - * Place details will be displayed with the preferred language if available. Will default to the browser's language preference. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. + * The stroke color. All CSS3 colors are supported. */ - language?: string; + get strokeColor(): string | null; /** - * The region to search. This location serves as a bias which means results around given location might be returned. Cannot be set along with locationRestriction. + * The stroke color. All CSS3 colors are supported. */ - locationBias?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | google.maps.CircleLiteral | google.maps.Circle; + set strokeColor(value: string | null | undefined); /** - * The region to search. This location serves as a restriction which means results outside given location will not be returned. Cannot be set along with locationBias. + * The stroke width in pixels. */ - locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; + get strokeWidth(): number | null; /** - * Maximum number of results to return. It must be between 1 and 20, inclusively. + * The stroke width in pixels. */ - maxResultCount?: number; + set strokeWidth(value: number | null | undefined); /** - * Filter out results whose average user rating is strictly less than this limit. A valid value must be an float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating will be rounded up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all results with a less than 1.0 rating. + * The zIndex compared to other polys. */ - minRating?: number; + get zIndex(): number | null; /** - * Used to restrict the search to places that are marked as certain price levels. Any combinations of price levels can be chosen. Defaults to all price levels. + * The zIndex compared to other polys. */ - priceLevels?: google.maps.places.PriceLevelString[]; + set zIndex(value: number | null | undefined); /** - * Include pure service area businesses if the field is set to true. A pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers may not have a physical address or location on Google Maps. Places will not return fields including location, plusCode, and other location related fields for these businesses. + * The ordered sequence of coordinates that designates a closed loop. Altitude is ignored in certain modes and thus optional. + * @deprecated Use path instead. This property will be removed in a future release. */ - pureServiceAreaBusinessesIncluded?: boolean; + outerCoordinates?: Iterable | null; /** - * How results will be ranked in the response. - * @defaultValue SearchByTextRankPreference.RELEVANCE + * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths, which create multiple cut-outs inside the polygon. + * @deprecated Use innerPaths instead. This property will be removed in a future release. */ - rankPreference?: google.maps.places.SearchByTextRankPreferenceString; + innerCoordinates?: Iterable> | null; + addEventListener(type: K, listener: (this: Polygon3DElement, ev: Polygon3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Polygon3DElementEventMap extends HTMLElementEventMap { + } + /** + * Polygon3DElementOptions object used to define the properties that can be set on a Polygon3DElement. + */ + export interface Polygon3DElementOptions { /** - * The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. + * See {@link google.maps.maps3d.Polygon3DElement.altitudeMode}. + */ + altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * See {@link google.maps.maps3d.Polygon3DElement.autofitsCamera}. + */ + autofitsCamera?: boolean | null; + /** + * See {@link google.maps.maps3d.Polygon3DElement.drawsOccludedSegments}. + */ + drawsOccludedSegments?: boolean | null; + /** + * See {@link google.maps.maps3d.Polygon3DElement.extruded}. + */ + extruded?: boolean | null; + /** + * See {@link google.maps.maps3d.Polygon3DElement.fillColor}. + */ + fillColor?: string | null; + /** + * See {@link google.maps.maps3d.Polygon3DElement.geodesic}. + */ + geodesic?: boolean | null; + /** + * See {@link google.maps.maps3d.Polygon3DElement.innerCoordinates}. + */ + innerCoordinates?: Iterable | Iterable> | null; + /** + * See {@link google.maps.maps3d.Polygon3DElement.innerPaths}. + */ + innerPaths?: Iterable | Iterable> | null; + /** + * See {@link google.maps.maps3d.Polygon3DElement.outerCoordinates}. */ - region?: string; + outerCoordinates?: Iterable | null; /** - * Required when you do not use {@link google.maps.places.SearchByTextRequest.query}. The text query for textual search. + * See {@link google.maps.maps3d.Polygon3DElement.path}. */ - textQuery?: string; + path?: Iterable | null; /** - * Used to set strict type filtering for {@link google.maps.places.SearchByTextRequest.includedType}. If set to true, only results of the same type will be returned. - * @defaultValue false + * See {@link google.maps.maps3d.Polygon3DElement.strokeColor}. */ - useStrictTypeFiltering?: boolean; + strokeColor?: string | null; /** - * @deprecated Please use textQuery instead + * See {@link google.maps.maps3d.Polygon3DElement.strokeWidth}. */ - query?: string; + strokeWidth?: number | null; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * @deprecated Please use rankPreference instead. + * See {@link google.maps.maps3d.Polygon3DElement.zIndex}. */ - rankBy?: google.maps.places.SearchByTextRankPreferenceString; + zIndex?: number | null; } /** - * EV-related options that can be specified for a place search request. + * A 3D polygon (like a 3D polyline) defines a series of connected coordinates in an ordered sequence. Additionally, polygons form a closed loop and define a filled region. Unlike Polygon3DElement, Polygon3DInteractiveElement receives a gmp-click event. + * Access by calling `const {Polygon3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface EVSearchOptions { - /** - * The list of preferred EV connector types. A place that does not support any of the listed connector types is filtered out. - */ - connectorTypes?: google.maps.places.EVConnectorTypeString[]; + export class Polygon3DInteractiveElement extends google.maps.maps3d.Polygon3DElement implements google.maps.maps3d.Polygon3DInteractiveElementOptions { /** - * Minimum required charging rate in kilowatts. A place with a charging rate less than the specified rate is filtered out. + * Creates a Polygon3DInteractiveElement with the options specified. + * @param options */ - minimumChargingRateKw?: number; + constructor(options?: google.maps.maps3d.Polygon3DElementOptions); + addEventListener(type: K, listener: (this: Polygon3DInteractiveElement, ev: Polygon3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Polygon3DInteractiveElementEventMap extends google.maps.maps3d.Polygon3DElementEventMap { + "gmp-click": google.maps.maps3d.LocationClickEvent; } /** - * RankPreference enum for SearchNearbyRequest. - * - * Access by calling `const {SearchNearbyRankPreference} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Polygon3DInteractiveElementOptions object used to define the properties that can be set on a Polygon3DInteractiveElement. */ - export enum SearchNearbyRankPreference { - /** - * Ranks results by distance. - */ - DISTANCE = 'DISTANCE', - /** - * Ranks results by popularity. - */ - POPULARITY = 'POPULARITY', + export interface Polygon3DInteractiveElementOptions extends google.maps.maps3d.Polygon3DElementOptions { } - export type SearchNearbyRankPreferenceString = `${google.maps.places.SearchNearbyRankPreference}`; /** - * Request interface for {@link google.maps.places.Place.searchNearby}. For more information on the request, see Places API reference. + * A 3D polyline is a linear overlay of connected line segments on a 3D map. + * Access by calling `const {Polyline3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface SearchNearbyRequest { - /** - * Excluded primary place types. See the full list of types supported. A place can only have a single primary type. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. - */ - excludedPrimaryTypes?: string[]; + export class Polyline3DElement extends HTMLElement implements google.maps.maps3d.Polyline3DElementOptions { /** - * Excluded place types. See the full list of types supported. A place can have many different place types. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. + * Creates an Polyline3DElement with the options specified. + * @param options */ - excludedTypes?: string[]; + constructor(options?: google.maps.maps3d.Polyline3DElementOptions); /** - * Fields to be included in the response, which will be billed for. If ['*'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). You can request any property in the {@link google.maps.places.Place} class as a field. + * Specifies how altitude components in the coordinates are interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - fields: string[]; + get altitudeMode(): google.maps.maps3d.AltitudeModeString; /** - * Include places that are not yet open but are expected to open in the future. + * Specifies how altitude components in the coordinates are interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - futureOpeningBusinessesIncluded?: boolean; + set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); /** - * Included primary place types. See the full list of types supported. A place can only have a single primary type. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * If provided, the specified polyline will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false */ - includedPrimaryTypes?: string[]; + get autofitsCamera(): boolean; /** - * Included place types. See the full list of types supported. A place can have many different place types. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * If provided, the specified polyline will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false */ - includedTypes?: string[]; + set autofitsCamera(value: boolean | null | undefined); /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Specifies whether parts of the polyline which could be occluded are drawn or not. Polylines can be occluded by map geometry (e.g. buildings). + * @defaultValue false */ - internalUsageAttributionIds?: Iterable | null; + get drawsOccludedSegments(): boolean; /** - * Place details will be displayed with the preferred language if available. Will default to the browser's language preference. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. + * Specifies whether parts of the polyline which could be occluded are drawn or not. Polylines can be occluded by map geometry (e.g. buildings). + * @defaultValue false */ - language?: string; + set drawsOccludedSegments(value: boolean | null | undefined); /** - * The region to search, specified as a circle with center and radius. Results outside given location are not returned. + * Specifies whether to connect the polyline to the ground. To extrude a polyline, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. + * @defaultValue false */ - locationRestriction: google.maps.Circle | google.maps.CircleLiteral; + get extruded(): boolean; /** - * Maximum number of results to return. For acceptable values and default, see Places API reference. + * Specifies whether to connect the polyline to the ground. To extrude a polyline, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. + * @defaultValue false */ - maxResultCount?: number; + set extruded(value: boolean | null | undefined); /** - * How results will be ranked in the response. - * @defaultValue SearchNearbyRankPreference.POPULARITY + * When true, edges of the polyline are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polyline are rendered as straight lines in screen space. + * @defaultValue false */ - rankPreference?: google.maps.places.SearchNearbyRankPreferenceString; + get geodesic(): boolean; /** - * The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. + * When true, edges of the polyline are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polyline are rendered as straight lines in screen space. + * @defaultValue false */ - region?: string; - } - /** - * Access by calling `const {Place} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Place implements google.maps.places.PlaceOptions { + set geodesic(value: boolean | null | undefined); /** - * - * @param options + * The outer color. All CSS3 colors are supported. */ - constructor(options: google.maps.places.PlaceOptions); + get outerColor(): string | null; /** - * Accessibility options of this Place. undefined if the accessibility options data have not been called for from the server. + * The outer color. All CSS3 colors are supported. */ - get accessibilityOptions(): google.maps.places.AccessibilityOptions | null | undefined; + set outerColor(value: string | null | undefined); /** - * The collection of address components for this Place’s location. Empty object if there is no known address data. undefined if the address data has not been called for from the server. + * The outer width is between 0.0 and 1.0. This is a percentage of the strokeWidth. */ - get addressComponents(): google.maps.places.AddressComponent[] | undefined; + get outerWidth(): number | null; /** - * The address descriptor for this place. Address descriptors include additional information that help describe a location using landmarks and areas. See address descriptor regional coverage in https://developers.google.com/maps/documentation/geocoding/address-descriptors/coverage. + * The outer width is between 0.0 and 1.0. This is a percentage of the strokeWidth. */ - get addressDescriptor(): google.maps.places.AddressDescriptor | null | undefined; + set outerWidth(value: number | null | undefined); /** - * The representation of the Place’s address in the adr microformat. + * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional. */ - get adrFormatAddress(): string | null | undefined; - - get allowsDogs(): boolean | null | undefined; + get path(): google.maps.LatLngAltitude[] | null; /** - * Data providers that must be shown for the Place. + * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional. */ - get attributions(): google.maps.places.Attribution[] | undefined; + set path(value: Iterable | null | undefined); /** - * The location's operational status. null if there is no known status. undefined if the status data has not been loaded from the server. + * The stroke color. All CSS3 colors are supported. */ - get businessStatus(): google.maps.places.BusinessStatusString | null | undefined; + get strokeColor(): string | null; /** - * The consumer alert for this place. + * The stroke color. All CSS3 colors are supported. */ - get consumerAlert(): google.maps.places.ConsumerAlert | null | undefined; + set strokeColor(value: string | null | undefined); /** - * The list of containing places for this place. Containing places are places that contain the place. + * The stroke width in pixels. */ - get containingPlaces(): google.maps.places.Place[] | undefined; + get strokeWidth(): number | null; /** - * The hours of operation for the next seven days (including today). This includes exceptional hours like holidays and irregular closures. + * The stroke width in pixels. */ - get currentOpeningHours(): google.maps.places.OpeningHours | null | undefined; + set strokeWidth(value: number | null | undefined); /** - * The current secondary hours of this place which includes exceptional hours like holidays and irregular closures for the next seven days. Secondary hours are different from a place's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. + * The zIndex compared to other polys. */ - get currentSecondaryOpeningHours(): google.maps.places.SecondaryOpeningHours[] | undefined; + get zIndex(): number | null; /** - * The location's display name. null if there is no name. undefined if the name data has not been loaded from the server. + * The zIndex compared to other polys. */ - get displayName(): string | null | undefined; + set zIndex(value: number | null | undefined); /** - * The language of the location's display name. null if there is no name. undefined if the name data has not been loaded from the server. + * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional. + * @deprecated Use path instead. This property will be removed in a future release. */ - get displayNameLanguageCode(): string | null | undefined; + coordinates?: Iterable | null; + addEventListener(type: K, listener: (this: Polyline3DElement, ev: Polyline3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Polyline3DElementEventMap extends HTMLElementEventMap { + } + /** + * Polyline3DElementOptions object used to define the properties that can be set on a Polyline3DElement. + */ + export interface Polyline3DElementOptions { /** - * The editorial summary for this place. null if there is no editorial summary. undefined if this field has not yet been requested. + * See {@link google.maps.maps3d.Polyline3DElement.altitudeMode}. */ - get editorialSummary(): string | null | undefined; + altitudeMode?: google.maps.maps3d.AltitudeModeString | null; /** - * The language of the editorial summary for this place. null if there is no editorial summary. undefined if this field has not yet been requested. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * See {@link google.maps.maps3d.Polyline3DElement.autofitsCamera}. */ - get editorialSummaryLanguageCode(): string | null | undefined; + autofitsCamera?: boolean | null; /** - * The EVChargeAmenitySummary for this place. + * See {@link google.maps.maps3d.Polyline3DElement.coordinates}. */ - get evChargeAmenitySummary(): google.maps.places.EVChargeAmenitySummary | null | undefined; + coordinates?: Iterable | null; /** - * EV Charge options provided by the place. undefined if the EV charge options have not been called for from the server. + * See {@link google.maps.maps3d.Polyline3DElement.drawsOccludedSegments}. */ - get evChargeOptions(): google.maps.places.EVChargeOptions | null | undefined; + drawsOccludedSegments?: boolean | null; /** - * The location’s full address. + * See {@link google.maps.maps3d.Polyline3DElement.extruded}. */ - get formattedAddress(): string | null | undefined; + extruded?: boolean | null; /** - * Fuel options provided by the place. undefined if the fuel options have not been called for from the server. + * See {@link google.maps.maps3d.Polyline3DElement.geodesic}. */ - get fuelOptions(): google.maps.places.FuelOptions | null | undefined; + geodesic?: boolean | null; /** - * The date this place will open, if its businessStatus is FUTURE_OPENING. When the field is not requested, this field will be undefined. Otherwise, this field will be populated with the opening date if it is available, and null if it is not. + * See {@link google.maps.maps3d.Polyline3DElement.outerColor}. */ - get futureOpeningDate(): Date | null | undefined; + outerColor?: string | null; /** - * The GenerativeSummary for this place. + * See {@link google.maps.maps3d.Polyline3DElement.outerWidth}. */ - get generativeSummary(): google.maps.places.GenerativeSummary | null | undefined; + outerWidth?: number | null; /** - * Links to trigger different Google Maps actions. + * See {@link google.maps.maps3d.Polyline3DElement.path}. */ - get googleMapsLinks(): google.maps.places.GoogleMapsLinks | null | undefined; + path?: Iterable | null; /** - * URL of the official Google page for this place. This is the Google-owned page that contains the best available information about the Place. + * See {@link google.maps.maps3d.Polyline3DElement.strokeColor}. */ - get googleMapsURI(): string | null | undefined; + strokeColor?: string | null; /** - * Whether a place has curbside pickup. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * See {@link google.maps.maps3d.Polyline3DElement.strokeWidth}. */ - get hasCurbsidePickup(): boolean | null | undefined; + strokeWidth?: number | null; /** - * Whether a place has delivery. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * See {@link google.maps.maps3d.Polyline3DElement.zIndex}. */ - get hasDelivery(): boolean | null | undefined; + zIndex?: number | null; + } + /** + * A 3D polyline is a linear overlay of connected line segments on a 3D map. Unlike Polyline3DElement, Polyline3DInteractiveElement receives a gmp-click event. + * Access by calling `const {Polyline3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Polyline3DInteractiveElement extends google.maps.maps3d.Polyline3DElement implements google.maps.maps3d.Polyline3DInteractiveElementOptions { /** - * Whether a place has dine in. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * Creates a Polyline3DInteractiveElement with the options specified. + * @param options */ - get hasDineIn(): boolean | null | undefined; - - get hasLiveMusic(): boolean | null | undefined; - - get hasMenuForChildren(): boolean | null | undefined; - - get hasOutdoorSeating(): boolean | null | undefined; - - get hasRestroom(): boolean | null | undefined; + constructor(options?: google.maps.maps3d.Polyline3DElementOptions); + addEventListener(type: K, listener: (this: Polyline3DInteractiveElement, ev: Polyline3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Polyline3DInteractiveElementEventMap extends google.maps.maps3d.Polyline3DElementEventMap { + "gmp-click": google.maps.maps3d.LocationClickEvent; + } + /** + * Polyline3DInteractiveElementOptions object used to define the properties that can be set on a Polyline3DInteractiveElement. + */ + export interface Polyline3DInteractiveElementOptions extends google.maps.maps3d.Polyline3DElementOptions { + } + /** + * A custom HTML element that renders a popover. It looks like a bubble and is often connected to a marker. + * Access by calling `const {PopoverElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PopoverElement extends HTMLElement implements google.maps.maps3d.PopoverElementOptions { /** - * Whether a place has takeout. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * + * @param options */ - get hasTakeout(): boolean | null | undefined; + constructor(options?: google.maps.maps3d.PopoverElementOptions); /** - * The default HEX color code for the place's category. + * Specifies how the altitude component of the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - get iconBackgroundColor(): string | null | undefined; + get altitudeMode(): google.maps.maps3d.AltitudeModeString; /** - * The unique place id. + * Specifies how the altitude component of the position is interpreted. + * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} */ - get id(): string; + set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); /** - * The Place’s phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign. + * If set to true, disables panning the map to make the popover fully visible when it opens. + * @defaultValue false */ - get internationalPhoneNumber(): string | null | undefined; - - get isGoodForChildren(): boolean | null | undefined; - - get isGoodForGroups(): boolean | null | undefined; - - get isGoodForWatchingSports(): boolean | null | undefined; + get autoPanDisabled(): boolean; /** - * Indicates whether the place is a pure service area business. A pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers may not have a physical address or location on Google Maps. + * If set to true, disables panning the map to make the popover fully visible when it opens. + * @defaultValue false */ - get isPureServiceAreaBusiness(): boolean | null | undefined; + set autoPanDisabled(value: boolean | null | undefined); /** - * Whether a place is reservable. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * Specifies whether this popover should be "light dismissed" or not. The "light dismiss" behavior is similar to setting the popover="auto" attribute which is part of the browser Popover API. + * @defaultValue false */ - get isReservable(): boolean | null | undefined; + get lightDismissDisabled(): boolean; /** - * The Place’s position. + * Specifies whether this popover should be "light dismissed" or not. The "light dismiss" behavior is similar to setting the popover="auto" attribute which is part of the browser Popover API. + * @defaultValue false */ - get location(): google.maps.LatLng | null | undefined; + set lightDismissDisabled(value: boolean | null | undefined); /** - * The Place’s phone number, formatted according to the number's regional convention. + * Specifies whether this popover should be open or not. + * @defaultValue false */ - get nationalPhoneNumber(): string | null | undefined; + get open(): boolean; /** - * The NeighborhoodSummary for this place. + * Specifies whether this popover should be open or not. + * @defaultValue false */ - get neighborhoodSummary(): google.maps.places.NeighborhoodSummary | null | undefined; + set open(value: boolean | null | undefined); /** - * Options of parking provided by the place. undefined if the parking options data have not been called for from the server. + * The position at which to display this popover. If the popover is anchored to an interactive marker, the marker's position will be used instead. */ - get parkingOptions(): google.maps.places.ParkingOptions | null | undefined; + get positionAnchor(): google.maps.LatLngAltitude | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | null; /** - * Payment options provided by the place. undefined if the payment options data have not been called for from the server. + * The position at which to display this popover. If the popover is anchored to an interactive marker, the marker's position will be used instead. */ - get paymentOptions(): google.maps.places.PaymentOptions | null | undefined; + set positionAnchor(value: google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | string | null | undefined); + addEventListener(type: K, listener: (this: PopoverElement, ev: PopoverElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PopoverElementEventMap extends HTMLElementEventMap { + } + /** + * PopoverElementOptions object used to define the properties that can be set on a PopoverElement. + */ + export interface PopoverElementOptions { /** - * Photos of this Place. The collection will contain up to ten {@link google.maps.places.Photo} objects. + * See {@link google.maps.maps3d.PopoverElement.altitudeMode}. */ - get photos(): google.maps.places.Photo[] | undefined; - - get plusCode(): google.maps.places.PlusCode | null | undefined; - - get postalAddress(): google.maps.places.PostalAddress | null | undefined; + altitudeMode?: google.maps.maps3d.AltitudeModeString | null; /** - * The price level of the Place. This property can return any of the following values
  • Free
  • Inexpensive
  • Moderate
  • Expensive
  • Very Expensive
+ * See {@link google.maps.maps3d.PopoverElement.autoPanDisabled}. */ - get priceLevel(): google.maps.places.PriceLevelString | null | undefined; + autoPanDisabled?: boolean | null; /** - * The price range for this Place. endPrice could be unset, which indicates a range without upper bound (e.g. "More than $100"). + * See {@link google.maps.maps3d.PopoverElement.lightDismissDisabled}. */ - get priceRange(): google.maps.places.PriceRange | null | undefined; + lightDismissDisabled?: boolean | null; /** - * The location's primary type. null if there is no type. undefined if the type data has not been loaded from the server. + * See {@link google.maps.maps3d.PopoverElement.open}. */ - get primaryType(): string | null | undefined; + open?: boolean | null; /** - * The location's primary type display name. null if there is no type. undefined if the type data has not been loaded from the server. + * See {@link google.maps.maps3d.PopoverElement.positionAnchor}. */ - get primaryTypeDisplayName(): string | null | undefined; + positionAnchor?: google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | string | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | null; + } + /** + * This event is created from monitoring a steady state of Map3DElement. This event bubbles up through the DOM tree. + * Access by calling `const {SteadyChangeEvent} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class SteadyChangeEvent extends Event { /** - * The language of the location's primary type display name. null if there is no type. undefined if the type data has not been loaded from the server. + * Indicates whether Map3DElement is steady (i.e. all rendering for the current scene has completed) or not. */ - get primaryTypeDisplayNameLanguageCode(): string | null | undefined; + isSteady: boolean; + } +} + +declare namespace google.maps.marker { + /** + * This event is created from clicking an Advanced Marker. Access the marker's position with event.target.position. + * Access by calling `const {AdvancedMarkerClickEvent} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class AdvancedMarkerClickEvent extends Event { + } + /** + * Shows a position on a map. Note that the position must be set for the AdvancedMarkerElement to display. + * Access by calling `const {AdvancedMarkerElement} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class AdvancedMarkerElement extends HTMLElement implements google.maps.marker.AdvancedMarkerElementOptions { /** - * A rating, between 1.0 to 5.0, based on user reviews of this Place. + * Creates an AdvancedMarkerElement with the options specified. If a map is specified, the AdvancedMarkerElement is added to the map upon construction. + * @param options */ - get rating(): number | null | undefined; + constructor(options?: google.maps.marker.AdvancedMarkerElementOptions); /** - * The regular hours of operation for this place. This does not include exceptional hours like holidays. + * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. + * @defaultValue "-50%" */ - get regularOpeningHours(): google.maps.places.OpeningHours | null | undefined; + anchorLeft?: string | null; /** - * The regular secondary hours of this place which excludes exceptional hours like holidays and irregular closures. Secondary hours are different from a place's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. + * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. + * @defaultValue "-100%" */ - get regularSecondaryOpeningHours(): google.maps.places.SecondaryOpeningHours[] | undefined; + anchorTop?: string | null; /** - * The requested language for this place. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.collisionBehavior}. */ - requestedLanguage?: string | null; + collisionBehavior?: google.maps.CollisionBehaviorString | null; /** - * The requested region for this place. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.gmpClickable}. */ - requestedRegion?: string | null; + gmpClickable?: boolean | null; /** - * The unique place resource name. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.gmpDraggable}. */ - get resourceName(): string; + gmpDraggable?: boolean | null; /** - * A list of reviews for this Place. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.map}. */ - get reviews(): google.maps.places.Review[] | undefined; + map?: google.maps.Map | null; /** - * The ReviewSummary for this place. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.position}. */ - get reviewSummary(): google.maps.places.ReviewSummary | null | undefined; + position?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; /** - * Whether a place serves beer. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.title}. */ - get servesBeer(): boolean | null | undefined; + title: string; /** - * Whether a place serves breakfast. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.zIndex}. */ - get servesBreakfast(): boolean | null | undefined; + zIndex?: number | null; /** - * Whether a place serves brunch. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * This field is read-only. The DOM Element backing the view. + * @deprecated Use the AdvancedMarkerElement directly. */ - get servesBrunch(): boolean | null | undefined; - - get servesCocktails(): boolean | null | undefined; - - get servesCoffee(): boolean | null | undefined; - - get servesDessert(): boolean | null | undefined; + get element(): HTMLElement; /** - * Whether a place serves dinner. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * See {@link google.maps.marker.AdvancedMarkerElementOptions.content}. + * @deprecated Use .children instead. */ - get servesDinner(): boolean | null | undefined; + content?: Node | null; /** - * Whether a place serves lunch. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * Adds the given listener function to the given event name in the Maps Eventing system. */ - get servesLunch(): boolean | null | undefined; + addListener(eventName: string, handler: Function): google.maps.MapsEventListener; + addEventListener(type: K, listener: (this: AdvancedMarkerElement, ev: AdvancedMarkerElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface AdvancedMarkerElementEventMap extends HTMLElementEventMap { + "gmp-click": google.maps.marker.AdvancedMarkerClickEvent; + } + /** + * Options for constructing an {@link google.maps.marker.AdvancedMarkerElement}. + */ + export interface AdvancedMarkerElementOptions { /** - * Whether a place serves vegetarian food. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. + * @defaultValue "-50%" */ - get servesVegetarianFood(): boolean | null | undefined; + anchorLeft?: string | null; /** - * Whether a place serves wine. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. + * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. + * @defaultValue "-100%" */ - get servesWine(): boolean | null | undefined; + anchorTop?: string | null; /** - * The location’s short address. + * An enumeration specifying how an AdvancedMarkerElement should behave when it collides with another AdvancedMarkerElement or with the basemap labels on a vector map.

Note: AdvancedMarkerElement to AdvancedMarkerElement collision works on both raster and vector maps, however, AdvancedMarkerElement to base map's label collision only works on vector maps. */ - get shortFormattedAddress(): string | null | undefined; + collisionBehavior?: google.maps.CollisionBehaviorString | null; /** - * The list of sub-destinations for this place. Sub-destinations are specific places associated with a main place. These provide more specific destinations for users who are searching within a large or complex place, like an airport, national park, university, or stadium. + * The DOM Element backing the visual of an AdvancedMarkerElement.

Note: AdvancedMarkerElement does not clone the passed-in DOM element. Once the DOM element is passed to an AdvancedMarkerElement, passing the same DOM element to another AdvancedMarkerElement will move the DOM element and cause the previous AdvancedMarkerElement to look empty. + * @defaultValue {@link google.maps.marker.PinElement} */ - get subDestinations(): google.maps.places.Place[] | undefined; + content?: Node | null; /** - * URI to the svg image mask resource that can be used to represent a place’s category. + * If true, the AdvancedMarkerElement will be clickable and trigger the gmp-click event, and will be interactive for accessibility purposes (e.g. allowing keyboard navigation via arrow keys). + * @defaultValue false */ - get svgIconMaskURI(): string | null | undefined; + gmpClickable?: boolean | null; /** - * The TimeZone for this place. + * If true, the AdvancedMarkerElement can be dragged.

Note: AdvancedMarkerElement with altitude is not draggable. + * @defaultValue false */ - get timeZone(): google.maps.places.TimeZone | null | undefined; + gmpDraggable?: boolean | null; /** - * Information about the transit station. undefined if the transit data has not been loaded from the server. + * Map on which to display the AdvancedMarkerElement. The map is required to display the AdvancedMarkerElement and can be provided by setting {@link google.maps.marker.AdvancedMarkerElement.map} if not provided at the construction. */ - get transitStation(): google.maps.places.TransitStation | null | undefined; + map?: google.maps.Map | null; /** - * An array of types for this Place (for example, ["political", "locality"] or ["restaurant", "establishment"]). + * Sets the AdvancedMarkerElement's position. An AdvancedMarkerElement may be constructed without a position, but will not be displayed until its position is provided - for example, by a user's actions or choices. An AdvancedMarkerElement's position can be provided by setting {@link google.maps.marker.AdvancedMarkerElement.position} if not provided at the construction.

Note: AdvancedMarkerElement with altitude is only supported on vector maps. */ - get types(): string[] | undefined; + position?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; /** - * The number of user ratings which contributed to this Place’s {@link google.maps.places.Place.rating}. + * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the AdvancedMarkerElement with the provided value. */ - get userRatingCount(): number | null | undefined; + title?: string | null; /** - * The offset from UTC of the Place’s current timezone, in minutes. For example, Austrialian Eastern Standard Time (GMT+10) in daylight savings is 11 hours ahead of UTC, so the utc_offset_minutes will be 660. For timezones behind UTC, the offset is negative. For example, the utc_offset_minutes is -60 for Cape Verde. + * All AdvancedMarkerElements are displayed on the map in order of their zIndex, with higher values displaying in front of AdvancedMarkerElements with lower values. By default, AdvancedMarkerElements are displayed according to their vertical position on screen, with lower AdvancedMarkerElements appearing in front of AdvancedMarkerElements farther up the screen. Mixing markers with an explicit zIndex and markers without one can lead to unexpected visual results. To ensure predictable behavior, it is recommended to either set the zIndex for all markers or leave it unset. Note that zIndex is also used to help determine relative priority between {@link google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY} Advanced Markers. A higher zIndex value indicates higher priority. */ - get utcOffsetMinutes(): number | null | undefined; + zIndex?: number | null; + } + /** + * A PinElement represents a DOM element that consists of a shape and a glyph. The shape has the same balloon style as seen in the default {@link google.maps.marker.AdvancedMarkerElement} or {@link google.maps.maps3d.Marker3DElement}. The glyph is an optional DOM element displayed in the balloon shape. A PinElement may have a different aspect ratio depending on its {@link google.maps.marker.PinElement.scale}.

+ * Access by calling `const {PinElement} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PinElement extends HTMLElement implements google.maps.marker.PinElementOptions { /** - * The preferred viewport when displaying this Place on a map. + * + * @param options */ - get viewport(): google.maps.LatLngBounds | null | undefined; + constructor(options?: google.maps.marker.PinElementOptions); /** - * The authoritative website for this Place, such as a business' homepage. + * The background color of the pin shape. See {@link google.maps.marker.PinElementOptions.background}. */ - get websiteURI(): string | null | undefined; + background?: string | null; /** - * @deprecated Use {@link google.maps.places.Place.regularOpeningHours} instead. + * The border color of the pin shape. See {@link google.maps.marker.PinElementOptions.borderColor}. */ - get openingHours(): google.maps.places.OpeningHours | null | undefined; + borderColor?: string | null; /** - * @deprecated This field was accidentally documented, but has never actually been populated. + * The color of the pin glyph. See {@link google.maps.marker.PinElementOptions.glyphColor}. */ - get hasWiFi(): boolean | null | undefined; + glyphColor?: string | null; /** - * Text query based place search. + * The source of the glyph image to be displayed in the pin. See {@link google.maps.marker.PinElementOptions.glyphSrc}. */ - static searchByText(request: google.maps.places.SearchByTextRequest): Promise<{places: google.maps.places.Place[]}>; + glyphSrc?: URL | string | null; /** - * Search for nearby places. + * The text displayed in the pin. See {@link google.maps.marker.PinElementOptions.glyphText}. */ - static searchNearby(request: google.maps.places.SearchNearbyRequest): Promise<{places: google.maps.places.Place[]}>; - - fetchFields(options: google.maps.places.FetchFieldsRequest): Promise<{place: google.maps.places.Place}>; + glyphText?: string | null; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Calculates the Date for the next opening time using the Place's {@link google.maps.places.Place.regularOpeningHours}. Returns undefined if the data is insufficient to calculate the result, or this place is not operational. + * See {@link google.maps.marker.PinElementOptions.scale}. */ - getNextOpeningTime(date?: Date): Promise; + scale?: number | null; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Check if the place is open at the given Date. Resolves with undefined if the known data for the location is insufficient to calculate this, e.g. if the opening hours are unregistered. + * This field is read-only. The DOM Element backing the view. + * @deprecated Use the PinElement directly. */ - isOpen(date?: Date): Promise; + get element(): HTMLElement; /** - * Converts to a plain object. + * See {@link google.maps.marker.PinElementOptions.glyph}. + * @deprecated Use {@link google.maps.marker.PinElementOptions.glyphText} or {@link google.maps.marker.PinElementOptions.glyphSrc} instead. */ - toJSON(key?: string): unknown; + glyph?: string | Element | URL | null; } /** - * Options for PlaceDetailsPlaceRequestElement. + * Options for creating a {@link google.maps.marker.PinElement}. */ - export interface PlaceDetailsPlaceRequestElementOptions { + export interface PinElementOptions { /** - * See {@link google.maps.places.PlaceDetailsPlaceRequestElement.place} + * The background color of the pin shape. Supports any CSS color value. */ - place?: google.maps.places.Place | string | null; - } - /** - * Configures a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data based on a place object, ID, or resource name. Append this element as a child of a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data for the specified place. For example:

 <gmp-place-details>
  <gmp-place-details-place-request
    place="PLACE_ID"
  ></gmp-place-details-place-request>
</gmp-place-details>
- * Access by calling `const {PlaceDetailsPlaceRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceDetailsPlaceRequestElement extends HTMLElement implements google.maps.places.PlaceDetailsPlaceRequestElementOptions { + background?: string | null; /** - * - * @param options + * The border color of the pin shape. Supports any CSS color value. */ - constructor(options?: google.maps.places.PlaceDetailsPlaceRequestElementOptions); + borderColor?: string | null; /** - * The place object, ID, or resource name to render details for in the Place Details Compact element. This property reflects to the attribute as a resource name. - * @defaultValue null + * The color of the glyph. Supports any CSS color value. */ - get place(): google.maps.places.Place | null; + glyphColor?: string | null; /** - * The place object, ID, or resource name to render details for in the Place Details Compact element. This property reflects to the attribute as a resource name. - * @defaultValue null + * The source of the glyph image to be displayed in the pin. */ - set place(value: google.maps.places.Place | string | null | undefined); - addEventListener(type: K, listener: (this: PlaceDetailsPlaceRequestElement, ev: PlaceDetailsPlaceRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceDetailsPlaceRequestElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceDetailsCompactElement. - */ - export interface PlaceDetailsCompactElementOptions { + glyphSrc?: URL | string | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The text displayed in the pin. */ - internalUsageAttributionIds?: Iterable | null; + glyphText?: string | null; /** - * See {@link google.maps.places.PlaceDetailsCompactElement.orientation}. + * The scale of the pin. + * @defaultValue 1 */ - orientation?: google.maps.places.PlaceDetailsOrientationString | null; + scale?: number | null; /** - * See {@link google.maps.places.PlaceDetailsCompactElement.truncationPreferred}. + * The DOM element displayed in the pin. + * @deprecated Use {@link google.maps.marker.PinElementOptions.glyphText} or {@link google.maps.marker.PinElementOptions.glyphSrc} instead. */ - truncationPreferred?: boolean | null; + glyph?: string | Element | URL | null; } +} + +declare namespace google.maps.places { /** - * Displays details for a place in a compact layout. Append a {@link google.maps.places.PlaceDetailsPlaceRequestElement} or {@link google.maps.places.PlaceDetailsLocationRequestElement} to specify the place to be rendered. Append a {@link google.maps.places.PlaceContentConfigElement}, {@link google.maps.places.PlaceStandardContentElement}, or {@link google.maps.places.PlaceAllContentElement} to specify which content to render.

Example:
 <gmp-place-details-compact>
  <gmp-place-details-place-request
    place="PLACE_ID"
  ></gmp-place-details-place-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-details-compact>

To use this element, enable the Places UI Kit API for your project in the Google Cloud console. - * Access by calling `const {PlaceDetailsCompactElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {AccessibilityOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceDetailsCompactElement extends HTMLElement implements google.maps.places.PlaceDetailsCompactElementOptions { + export class AccessibilityOptions { /** - * - * @param options + * Whether a place has a wheelchair accessible entrance. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - constructor(options?: google.maps.places.PlaceDetailsCompactElementOptions); + get hasWheelchairAccessibleEntrance(): boolean | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Whether a place has wheelchair accessible parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get internalUsageAttributionIds(): string[] | null; + get hasWheelchairAccessibleParking(): boolean | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Whether a place has a wheelchair accessible restroom. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + get hasWheelchairAccessibleRestroom(): boolean | null; /** - * The orientation variant (vertical or horizontal) of the element. - * @defaultValue PlaceDetailsOrientation.VERTICAL + * Whether a place offers wheelchair accessible seating. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - orientation?: google.maps.places.PlaceDetailsOrientationString | null; + get hasWheelchairAccessibleSeating(): boolean | null; + } + /** + * Address component for the Place's location. + * Access by calling `const {AddressComponent} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class AddressComponent { /** - * Read only. Place object containing the ID, location, and viewport of the currently rendered place. + * The full text of the address component. */ - get place(): google.maps.places.Place | undefined; + get longText(): string | null; /** - * If true, truncates the place name and address to fit on one line instead of wrapping. - * @defaultValue false + * The abbreviated, short text of the given address component. */ - get truncationPreferred(): boolean; + get shortText(): string | null; /** - * If true, truncates the place name and address to fit on one line instead of wrapping. - * @defaultValue false + * An array of strings denoting the type of this address component. A list of valid types can be found here. */ - set truncationPreferred(value: boolean | null | undefined); - addEventListener(type: K, listener: (this: PlaceDetailsCompactElement, ev: PlaceDetailsCompactElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceDetailsCompactElementEventMap extends HTMLElementEventMap { - "gmp-error": Event; - "gmp-load": Event; + get types(): string[]; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } /** - * Options for PlaceDetailsElement. + * A relational description of a location. Includes a ranked set of nearby landmarks and precise containing areas and their relationship to the target location. + * Access by calling `const {AddressDescriptor} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceDetailsElementOptions { + export class AddressDescriptor { /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * A ranked list of containing or adjacent areas. The most recognizable and precise areas are ranked first. */ - internalUsageAttributionIds?: Iterable | null; + get areas(): google.maps.places.Area[]; + /** + * A ranked list of nearby landmarks. The most recognizable and nearby landmarks are ranked first. + */ + get landmarks(): google.maps.places.Landmark[]; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } /** - * Displays details for a place in a full layout. Append either a {@link google.maps.places.PlaceDetailsPlaceRequestElement} or {@link google.maps.places.PlaceDetailsLocationRequestElement} to specify the place to be rendered. Append a {@link google.maps.places.PlaceContentConfigElement}, {@link google.maps.places.PlaceStandardContentElement}, or {@link google.maps.places.PlaceAllContentElement} to specify which content to render.

Example:
 <gmp-place-details>
  <gmp-place-details-place-request
    place="PLACE_ID"
  ></gmp-place-details-place-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-details>

To use this element, enable the Places UI Kit API for your project in the Google Cloud console. - * Access by calling `const {PlaceDetailsElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Area information and the area's relationship with the target location. + * Access by calling `const {Area} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceDetailsElement extends HTMLElement implements google.maps.places.PlaceDetailsElementOptions { - /** - * - * @param options - */ - constructor(options?: google.maps.places.PlaceDetailsElementOptions); + export class Area { /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Defines the spatial relationship between the target location and the area. */ - get internalUsageAttributionIds(): string[] | null; + get containment(): google.maps.places.ContainmentString | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The area's place. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + get place(): google.maps.places.Place; /** - * Read only. Place object containing the ID, location, and viewport of the currently rendered place. + * Converts to a plain object. */ - get place(): google.maps.places.Place | undefined; - addEventListener(type: K, listener: (this: PlaceDetailsElement, ev: PlaceDetailsElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceDetailsElementEventMap extends HTMLElementEventMap { - "gmp-error": Event; - "gmp-load": Event; + toJSON(key?: string): unknown; } /** - * Orientation variants for {@link google.maps.places.PlaceSearchElement}. - * - * Access by calling `const {PlaceSearchOrientation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Information about a data provider for a Place. + * Access by calling `const {Attribution} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum PlaceSearchOrientation { + export class Attribution { /** - * Horizontal orientation. + * Name of the Place's data provider. */ - HORIZONTAL = 'HORIZONTAL', + get provider(): string | null; /** - * Vertical orientation. + * URI to the Place's data provider. */ - VERTICAL = 'VERTICAL', + get providerURI(): string | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } - export type PlaceSearchOrientationString = `${google.maps.places.PlaceSearchOrientation}`; /** - * Attribution positions for {@link google.maps.places.PlaceSearchElement}. + * Color options for Google Maps attribution text. Attribution may be customized to use any of these colors. * - * Access by calling `const {PlaceSearchAttributionPosition} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {AttributionColor} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum PlaceSearchAttributionPosition { + export enum AttributionColor { /** - * Attribution at the bottom of the PlaceSearchElement + * Black attribution text. */ - BOTTOM = 'BOTTOM', + BLACK = 'BLACK', /** - * Attribution at the top of the PlaceSearchElement + * Gray attribution text. */ - TOP = 'TOP', + GRAY = 'GRAY', + /** + * White attribution text. + */ + WHITE = 'WHITE', } - export type PlaceSearchAttributionPositionString = `${google.maps.places.PlaceSearchAttributionPosition}`; + export type AttributionColorString = `${google.maps.places.AttributionColor}`; /** - * Options for PlaceSearchElement. + * Information about the author of user-generated content. + * Access by calling `const {AuthorAttribution} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceSearchElementOptions { - /** - * See {@link google.maps.places.PlaceSearchElement.attributionPosition}. - */ - attributionPosition?: google.maps.places.PlaceSearchAttributionPositionString | null; + export class AuthorAttribution { /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Author's name for this result. */ - internalUsageAttributionIds?: Iterable | null; + get displayName(): string; /** - * See {@link google.maps.places.PlaceSearchElement.orientation}. + * Author's photo URI for this result. This may not always be available. */ - orientation?: google.maps.places.PlaceSearchOrientationString | null; + get photoURI(): string | null; /** - * See {@link google.maps.places.PlaceSearchElement.selectable} + * Author's profile URI for this result. */ - selectable?: boolean | null; + get uri(): string | null; /** - * See {@link google.maps.places.PlaceSearchElement.truncationPreferred}. + * Converts to a plain object. */ - truncationPreferred?: boolean | null; + toJSON(key?: string): unknown; } /** - * Options for PlaceNearbySearchRequestElement. + * A widget that provides Place predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered. + * Access by calling `const {Autocomplete} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated As of March 1st, 2025, google.maps.places.Autocomplete is not available to new customers. Please use {@link google.maps.places.PlaceAutocompleteElement} instead. At this time, google.maps.places.Autocomplete is not scheduled to be discontinued, but {@link google.maps.places.PlaceAutocompleteElement} is recommended over google.maps.places.Autocomplete. While google.maps.places.Autocomplete will continue to receive bug fixes for any major regressions, existing bugs in google.maps.places.Autocomplete will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details and https://developers.google.com/maps/documentation/javascript/places-migration-overview for the migration guide. */ - export interface PlaceNearbySearchRequestElementOptions { + export class Autocomplete extends google.maps.MVCObject { /** - * Excluded primary place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.excludedPrimaryTypes} and {@link google.maps.places.SearchNearbyRequest.excludedPrimaryTypes} for more details. + * Creates a new instance of Autocomplete that attaches to the specified input text field with the given options. + * @param inputField The <input> text field to which the Autocomplete should be attached. + * @param opts Options. */ - excludedPrimaryTypes?: string[] | null; + constructor(inputField: HTMLInputElement, opts?: google.maps.places.AutocompleteOptions | null); /** - * Excluded place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.excludedTypes} and {@link google.maps.places.SearchNearbyRequest.excludedTypes} for more details. + * Returns the bounds to which predictions are biased. */ - excludedTypes?: string[] | null; + getBounds(): google.maps.LatLngBounds | undefined; /** - * Include place predictions for businesses that are not yet open but are expected to open in the future. + * Returns the fields to be included for the Place in the details response when the details are successfully retrieved. For a list of fields see {@link google.maps.places.PlaceResult}. */ - futureOpeningBusinessesIncluded?: boolean | null; + getFields(): string[] | undefined; /** - * Included primary place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.includedPrimaryTypes} and {@link google.maps.places.SearchNearbyRequest.includedPrimaryTypes} for more details. + * Returns the details of the Place selected by user if the details were successfully retrieved. Otherwise returns a stub Place object, with the name property set to the current value of the input field. */ - includedPrimaryTypes?: string[] | null; + getPlace(): google.maps.places.PlaceResult; /** - * Included place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.includedTypes} and {@link google.maps.places.SearchNearbyRequest.includedTypes} for more details. + * Sets the preferred area within which to return Place results. Results are biased towards, but not restricted to, this area. */ - includedTypes?: string[] | null; + setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | undefined): void; /** - * The region to search. See {@link google.maps.places.PlaceNearbySearchRequestElement.locationRestriction} and {@link google.maps.places.SearchNearbyRequest.locationRestriction} for more details. + * Sets the component restrictions. Component restrictions are used to restrict predictions to only those within the parent component. For example, the country. */ - locationRestriction?: google.maps.Circle | google.maps.CircleLiteral | null; + setComponentRestrictions(restrictions: google.maps.places.ComponentRestrictions | null): void; /** - * Maximum number of results to return. See {@link google.maps.places.PlaceNearbySearchRequestElement.maxResultCount} and {@link google.maps.places.SearchNearbyRequest.maxResultCount} for more details. + * Sets the fields to be included for the Place in the details response when the details are successfully retrieved. For a list of fields see {@link google.maps.places.PlaceResult}. */ - maxResultCount?: number | null; + setFields(fields: string[] | undefined): void; + + setOptions(options: google.maps.places.AutocompleteOptions | null): void; /** - * How results will be ranked in the response. See {@link google.maps.places.PlaceNearbySearchRequestElement.rankPreference} and {@link google.maps.places.SearchNearbyRankPreference} for more details. + * Sets the types of predictions to be returned. For supported types, see the developer's guide. If no types are specified, all types will be returned. */ - rankPreference?: google.maps.places.SearchNearbyRankPreferenceString | null; + setTypes(types: string[] | null): void; } /** - * Configures a {@link google.maps.places.PlaceSearchElement} to load results based on a nearby search request. The locationRestriction property is required for the search element to load. Any other configured properties will be ignored if locationRestriction is not set. Append this element as a child of a {@link google.maps.places.PlaceSearchElement} to load results. For example:
 <gmp-place-search>
  <gmp-place-nearby-search-request
    location-restriction="RADIUS@LAT,LNG"
  ></gmp-place-nearby-search-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-search>
- * Access by calling `const {PlaceNearbySearchRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The options that can be set on an Autocomplete object. */ - export class PlaceNearbySearchRequestElement extends HTMLElement implements google.maps.places.PlaceNearbySearchRequestElementOptions { + export interface AutocompleteOptions { /** - * - * @param options + * The area in which to search for places. */ - constructor(options?: google.maps.places.PlaceNearbySearchRequestElementOptions); + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * Excluded primary place types. - * @defaultValue null + * The component restrictions. Component restrictions are used to restrict predictions to only those within the parent component. For example, the country. */ - get excludedPrimaryTypes(): string[] | null; + componentRestrictions?: google.maps.places.ComponentRestrictions; /** - * Excluded primary place types. - * @defaultValue null + * Fields to be included for the Place in the details response when the details are successfully retrieved, which will be billed for. If ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). The default is ['ALL']. */ - set excludedPrimaryTypes(value: string[] | null | undefined); + fields?: string[]; /** - * Excluded place types. - * @defaultValue null + * A boolean value, indicating that the Autocomplete widget should only return those places that are inside the bounds of the Autocomplete widget at the time the query is sent. Setting strictBounds to false (which is the default) will make the results biased towards, but not restricted to, places contained within the bounds. */ - get excludedTypes(): string[] | null; + strictBounds?: boolean; /** - * Excluded place types. - * @defaultValue null + * The types of predictions to be returned. For supported types, see the developer's guide. If no types are specified, all types will be returned. */ - set excludedTypes(value: string[] | null | undefined); + types?: string[]; /** - * Include place predictions for businesses that are not yet open but are expected to open in the future. + * Whether to retrieve only Place IDs. The PlaceResult made available when the place_changed event is fired will only have the place_id, types and name fields, with the place_id, types and description returned by the Autocomplete service. Disabled by default. + * @deprecated placeIdOnly is deprecated as of January 15, 2019, and will be turned off on January 15, 2020. Use {@link google.maps.places.AutocompleteOptions.fields} instead: fields: ['place_id', 'name', 'types']. */ - get futureOpeningBusinessesIncluded(): boolean | null; + placeIdOnly?: boolean; + } + /** + * Represents a single autocomplete prediction. + */ + export interface AutocompletePrediction { /** - * Include place predictions for businesses that are not yet open but are expected to open in the future. + * This is the unformatted version of the query suggested by the Places service. */ - set futureOpeningBusinessesIncluded(value: boolean | null | undefined); + description: string; /** - * Included primary place type. - * @defaultValue null + * The distance in meters of the place from the {@link google.maps.places.AutocompletionRequest.origin}. */ - get includedPrimaryTypes(): string[] | null; + distance_meters?: number; /** - * Included primary place type. - * @defaultValue null + * A set of substrings in the place's description that match elements in the user's input, suitable for use in highlighting those substrings. Each substring is identified by an offset and a length, expressed in unicode characters. */ - set includedPrimaryTypes(value: string[] | null | undefined); + matched_substrings: google.maps.places.PredictionSubstring[]; /** - * Included place type. - * @defaultValue null + * A place ID that can be used to retrieve details about this place using the place details service (see {@link google.maps.places.PlacesService.getDetails}). */ - get includedTypes(): string[] | null; + place_id: string; /** - * Included place type. - * @defaultValue null + * Structured information about the place's description, divided into a main text and a secondary text, including an array of matched substrings from the autocomplete input, identified by an offset and a length, expressed in unicode characters. */ - set includedTypes(value: string[] | null | undefined); + structured_formatting: google.maps.places.StructuredFormatting; /** - * The region to search. Normalizes to a Circle. - * @defaultValue null + * Information about individual terms in the above description, from most to least specific. For example, "Taco Bell", "Willitis", and "CA". */ - get locationRestriction(): google.maps.Circle | null; + terms: google.maps.places.PredictionTerm[]; /** - * The region to search. Normalizes to a Circle. - * @defaultValue null + * An array of types that the prediction belongs to, for example 'establishment' or 'geocode'. */ - set locationRestriction(value: google.maps.Circle | google.maps.CircleLiteral | null | undefined); + types: string[]; + } + /** + * Request interface for {@link google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions}. + */ + export interface AutocompleteRequest { /** - * Maximum number of results to return. - * @defaultValue null + * Include place predictions for businesses that are not yet open but are expected to open in the future. */ - get maxResultCount(): number | null; + futureOpeningBusinessesIncluded?: boolean; /** - * Maximum number of results to return. - * @defaultValue null + * Included primary Place type (for example, "restaurant" or "gas_station").

A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. */ - set maxResultCount(value: number | null | undefined); + includedPrimaryTypes?: string[]; /** - * How results will be ranked in the response. - * @defaultValue null + * Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both locationRestriction and includedRegionCodes are set, the results will be located in the area of intersection. */ - get rankPreference(): google.maps.places.SearchNearbyRankPreferenceString | null; + includedRegionCodes?: string[]; /** - * How results will be ranked in the response. - * @defaultValue null + * The text string on which to search. */ - set rankPreference(value: google.maps.places.SearchNearbyRankPreferenceString | null | undefined); - addEventListener(type: K, listener: (this: PlaceNearbySearchRequestElement, ev: PlaceNearbySearchRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceNearbySearchRequestElementEventMap extends HTMLElementEventMap { - } - /** - * Options for PlaceTextSearchRequestElement. - */ - export interface PlaceTextSearchRequestElementOptions { + input: string; /** - * The list of preferred EV connector types. See {@link google.maps.places.SearchByTextRequest.evSearchOptions} and {@link google.maps.places.PlaceTextSearchRequestElement.evConnectorTypes} for more details. + * A zero-based Unicode character offset of input indicating the cursor position in input. The cursor position may influence what predictions are returned. If not specified, defaults to the length of input. */ - evConnectorTypes?: google.maps.places.EVConnectorTypeString[] | null; + inputOffset?: number; /** - * Minimum required charging rate in kilowatts. See {@link google.maps.places.SearchByTextRequest.evSearchOptions} and {@link google.maps.places.PlaceTextSearchRequestElement.evMinimumChargingRateKw} for more details. + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - evMinimumChargingRateKw?: number | null; + internalUsageAttributionIds?: Iterable | null; /** - * Include place predictions for businesses that are not yet open but are expected to open in the future. + * The language in which to return results. Will default to the browser's language preference. The results may be in mixed languages if the language used in input is different from language, or if the returned Place does not have a translation from the local language to language. */ - futureOpeningBusinessesIncluded?: boolean | null; + language?: string; /** - * The requested place type. See {@link google.maps.places.SearchByTextRequest.includedType} and {@link google.maps.places.PlaceTextSearchRequestElement.includedType} for more details. + * Bias results to a specified location.

At most one of locationBias or locationRestriction should be set. If neither are set, the results will be biased by IP address, meaning the IP address will be mapped to an imprecise location and used as a biasing signal. */ - includedType?: string | null; + locationBias?: google.maps.places.LocationBias; /** - * Used to restrict the search to places that are currently open. See {@link google.maps.places.SearchByTextRequest.isOpenNow} and {@link google.maps.places.PlaceTextSearchRequestElement.isOpenNow} for more details. + * Restrict results to a specified location.

At most one of locationBias or locationRestriction should be set. If neither are set, the results will be biased by IP address, meaning the IP address will be mapped to an imprecise location and used as a biasing signal. */ - isOpenNow?: boolean | null; + locationRestriction?: google.maps.places.LocationRestriction; /** - * Location bias for the search. See {@link google.maps.places.SearchByTextRequest.locationBias} and {@link google.maps.places.PlaceTextSearchRequestElement.locationBias} for more details. + * The origin point from which to calculate geodesic distance to the destination (returned as {@link google.maps.places.PlacePrediction.distanceMeters}). If this value is omitted, geodesic distance will not be returned. */ - locationBias?: google.maps.places.LocationBias | null; + origin?: google.maps.LatLng | google.maps.LatLngLiteral; /** - * Location restriction for the search. See {@link google.maps.places.SearchByTextRequest.locationRestriction} and {@link google.maps.places.PlaceTextSearchRequestElement.locationRestriction} for more details. + * Include pure service area businesses if the field is set to true. A pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers may not have a physical address or location on Google Maps. */ - locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + pureServiceAreaBusinessesIncluded?: boolean; /** - * Maximum number of results to return. See {@link google.maps.places.SearchByTextRequest.maxResultCount} and {@link google.maps.places.PlaceTextSearchRequestElement.maxResultCount} for more details. + * The region code, specified as a CLDR two-character region code. This affects address formatting, result ranking, and may influence what results are returned. This does not restrict results to the specified region. */ - maxResultCount?: number | null; + region?: string; /** - * Filter out results whose average user rating is strictly less than this limit. See {@link google.maps.places.SearchByTextRequest.minRating} and {@link google.maps.places.PlaceTextSearchRequestElement.minRating} for more details. + * A token which identifies an Autocomplete session for billing purposes. Generate a new session token via {@link google.maps.places.AutocompleteSessionToken}.

The session begins when the user starts typing a query, and concludes when they select a place and call {@link google.maps.places.Place.fetchFields}. Each session can have multiple queries, followed by one fetchFields call. The credentials used for each request within a session must belong to the same Google Cloud Console project. Once a session has concluded, the token is no longer valid; your app must generate a fresh token for each session. If the sessionToken parameter is omitted, or if you reuse a session token, the session is charged as if no session token was provided (each request is billed separately).

When a session token is provided in the request to {@link google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions}, the same token will automatically be included in the first call to fetchFields on a {@link google.maps.places.Place} returned by calling {@link google.maps.places.PlacePrediction.toPlace} on one of the resulting {@link google.maps.places.AutocompleteSuggestion}s.

We recommend the following guidelines:
  • Use session tokens for all Place Autocomplete calls.
  • Generate a fresh token for each session.
  • Be sure to pass a unique session token for each new session. Using the same token for more than one session will result in each request being billed individually.
*/ - minRating?: number | null; + sessionToken?: google.maps.places.AutocompleteSessionToken; + } + /** + * An Autocomplete response returned by the call to {@link google.maps.places.AutocompleteService.getPlacePredictions} containing a list of {@link google.maps.places.AutocompletePrediction}s. + */ + export interface AutocompleteResponse { /** - * Used to restrict the search to places that are marked as certain price levels. See {@link google.maps.places.SearchByTextRequest.priceLevels} and {@link google.maps.places.PlaceTextSearchRequestElement.priceLevels} for more details. + * The list of {@link google.maps.places.AutocompletePrediction}s. */ - priceLevels?: google.maps.places.PriceLevelString[] | null; + predictions: google.maps.places.AutocompletePrediction[]; + } + /** + * Contains methods related to retrieving Autocomplete predictions. + * Access by calling `const {AutocompleteService} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated As of March 1st, 2025, google.maps.places.AutocompleteService is not available to new customers. Please use {@link google.maps.places.AutocompleteSuggestion} instead. At this time, google.maps.places.AutocompleteService is not scheduled to be discontinued, but {@link google.maps.places.AutocompleteSuggestion} is recommended over google.maps.places.AutocompleteService. While google.maps.places.AutocompleteService will continue to receive bug fixes for any major regressions, existing bugs in google.maps.places.AutocompleteService will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details and https://developers.google.com/maps/documentation/javascript/places-migration-overview for the migration guide. + */ + export class AutocompleteService { /** - * How results will be ranked in the response. See {@link google.maps.places.SearchByTextRequest.rankPreference} and {@link google.maps.places.PlaceTextSearchRequestElement.rankPreference} for more details. + * Creates a new instance of the AutocompleteService. */ - rankPreference?: google.maps.places.SearchByTextRankPreferenceString | null; + constructor(); /** - * The text query for textual search. See {@link google.maps.places.SearchByTextRequest.textQuery} and {@link google.maps.places.PlaceTextSearchRequestElement.textQuery} for more details. + * Retrieves place autocomplete predictions based on the supplied autocomplete request. */ - textQuery?: string | null; + getPlacePredictions(request: google.maps.places.AutocompletionRequest, callback?: ((arg0: google.maps.places.AutocompletePrediction[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void)): Promise; /** - * Used to set strict type filtering for {@link google.maps.places.SearchByTextRequest.includedType}. See {@link google.maps.places.SearchByTextRequest.useStrictTypeFiltering} and {@link google.maps.places.PlaceTextSearchRequestElement.useStrictTypeFiltering} for more details. + * Retrieves query autocomplete predictions based on the supplied query autocomplete request. */ - useStrictTypeFiltering?: boolean | null; + getQueryPredictions(request: google.maps.places.QueryAutocompletionRequest, callback: (arg0: google.maps.places.QueryAutocompletePrediction[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; } /** - * Configures a {@link google.maps.places.PlaceSearchElement} to load results based on a text search request. The textQuery property is required for the search element to load. Any other configured properties will be ignored if textQuery is not set. Append this element as a child of a {@link google.maps.places.PlaceSearchElement} to load results. For example:
 <gmp-place-search>
  <gmp-place-text-search-request
    text-query="QUERY"
  ></gmp-place-text-search-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-search>
- * Access by calling `const {PlaceTextSearchRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a session token used for tracking an autocomplete session. + * Access by calling `const {AutocompleteSessionToken} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceTextSearchRequestElement extends HTMLElement implements google.maps.places.PlaceTextSearchRequestElementOptions { + export class AutocompleteSessionToken { /** - * - * @param options + * Creates a new instance of AutocompleteSessionToken. */ - constructor(options?: google.maps.places.PlaceTextSearchRequestElementOptions); + constructor(); + } + /** + * An Autocomplete suggestion result. + * Access by calling `const {AutocompleteSuggestion} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class AutocompleteSuggestion { /** - * The list of preferred EV connector types. - * @defaultValue null + * Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address.

If a {@link google.maps.places.AutocompleteRequest.sessionToken} was provided in the AutocompleteRequest used to fetch this AutocompleteSuggestion, the same token will automatically be included when calling {@link google.maps.places.Place.fetchFields} for the first time on the {@link google.maps.places.Place} returned by a call to {@link google.maps.places.PlacePrediction.toPlace}. + */ + get placePrediction(): google.maps.places.PlacePrediction | null; + /** + * Fetches a list of AutocompleteSuggestions.

If a {@link google.maps.places.AutocompleteRequest.sessionToken} is provided in the request, then that session token will automatically be included when calling {@link google.maps.places.Place.fetchFields} for the first time, on each {@link google.maps.places.Place} returned by {@link google.maps.places.PlacePrediction.toPlace} on the resulting {@link google.maps.places.PlacePrediction}s. + */ + static fetchAutocompleteSuggestions(autocompleteRequest: google.maps.places.AutocompleteRequest): Promise<{suggestions: google.maps.places.AutocompleteSuggestion[]}>; + } + /** + * An Autocompletion request to be sent to {@link google.maps.places.AutocompleteService.getPlacePredictions}. + */ + export interface AutocompletionRequest { + /** + * The component restrictions. Component restrictions are used to restrict predictions to only those within the parent component. For example, the country. + */ + componentRestrictions?: google.maps.places.ComponentRestrictions; + /** + * The user entered input string. */ - get evConnectorTypes(): google.maps.places.EVConnectorTypeString[] | null; + input: string; /** - * The list of preferred EV connector types. - * @defaultValue null + * A language identifier for the language in which the results should be returned, if possible. Results in the selected language may be given a higher ranking, but suggestions are not restricted to this language. See the list of supported languages. */ - set evConnectorTypes(value: google.maps.places.EVConnectorTypeString[] | null | undefined); + language?: string | null; /** - * Minimum required charging rate in kilowatts. - * @defaultValue null + * A soft boundary or hint to use when searching for places. */ - get evMinimumChargingRateKw(): number | null; + locationBias?: google.maps.places.LocationBias | null; /** - * Minimum required charging rate in kilowatts. - * @defaultValue null + * Bounds to constrain search results. */ - set evMinimumChargingRateKw(value: number | null | undefined); + locationRestriction?: google.maps.places.LocationRestriction | null; /** - * Include place predictions for businesses that are not yet open but are expected to open in the future. + * The character position in the input term at which the service uses text for predictions (the position of the cursor in the input field). */ - get futureOpeningBusinessesIncluded(): boolean | null; + offset?: number; /** - * Include place predictions for businesses that are not yet open but are expected to open in the future. + * The location where {@link google.maps.places.AutocompletePrediction.distance_meters} is calculated from. */ - set futureOpeningBusinessesIncluded(value: boolean | null | undefined); + origin?: google.maps.LatLng | google.maps.LatLngLiteral; /** - * The requested place type. - * @defaultValue null + * A region code which is used for result formatting and for result filtering. It does not restrict the suggestions to this country. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - get includedType(): string | null; + region?: string | null; /** - * The requested place type. - * @defaultValue null + * Unique reference used to bundle individual requests into sessions. */ - set includedType(value: string | null | undefined); + sessionToken?: google.maps.places.AutocompleteSessionToken; /** - * Used to restrict the search to places that are currently open. - * @defaultValue null + * The types of predictions to be returned. For supported types, see the developer's guide. If no types are specified, all types will be returned. */ - get isOpenNow(): boolean | null; + types?: string[]; /** - * Used to restrict the search to places that are currently open. - * @defaultValue null + * Bounds for prediction biasing. Predictions will be biased towards, but not restricted to, the given bounds. Both location and radius will be ignored if bounds is set. + * @deprecated bounds is deprecated as of May 2023. Use {@link google.maps.places.AutocompletionRequest.locationBias} and {@link google.maps.places.AutocompletionRequest.locationRestriction} instead. */ - set isOpenNow(value: boolean | null | undefined); + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * Location bias for the search. - * @defaultValue null + * Location for prediction biasing. Predictions will be biased towards the given location and radius. Alternatively, bounds can be used. + * @deprecated location is deprecated as of May 2023. Use {@link google.maps.places.AutocompletionRequest.locationBias} and {@link google.maps.places.AutocompletionRequest.locationRestriction} instead. */ - get locationBias(): google.maps.LatLngAltitude | google.maps.LatLngBounds | google.maps.Circle | string | null; + location?: google.maps.LatLng; /** - * Location bias for the search. - * @defaultValue null + * The radius of the area used for prediction biasing. The radius is specified in meters, and must always be accompanied by a location property. Alternatively, bounds can be used. + * @deprecated radius is deprecated as of May 2023. Use {@link google.maps.places.AutocompletionRequest.locationBias} and {@link google.maps.places.AutocompletionRequest.locationRestriction} instead. */ - set locationBias(value: google.maps.places.LocationBias | null | undefined); + radius?: number; + } + /** + * BasicPlaceAutocompleteElement is an HTMLElement subclass which provides a UI component for the Places Autocomplete API. + * Access by calling `const {BasicPlaceAutocompleteElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class BasicPlaceAutocompleteElement extends HTMLElement implements google.maps.places.BasicPlaceAutocompleteElementOptions { /** - * Location restriction for the search. Normalizes to a LatLngBounds. - * @defaultValue null + * + * @param options */ - get locationRestriction(): google.maps.LatLngBounds | null; + constructor(options?: google.maps.places.BasicPlaceAutocompleteElementOptions); /** - * Location restriction for the search. Normalizes to a LatLngBounds. - * @defaultValue null + * The description to be used for the input element. This will be detected by screen readers when the input element is focused. See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby for details. */ - set locationRestriction(value: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null | undefined); + description: string | null; /** - * Maximum number of results to return. - * @defaultValue null + * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. */ - get maxResultCount(): number | null; + get disabled(): boolean; /** - * Maximum number of results to return. - * @defaultValue null + * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. */ - set maxResultCount(value: number | null | undefined); + set disabled(value: boolean | null | undefined); /** - * Filter out results whose average user rating is strictly less than this limit. - * @defaultValue null + * Whether to include places that are not yet open but are expected to open in the future. */ - get minRating(): number | null; + futureOpeningBusinessesIncluded: boolean | null; /** - * Filter out results whose average user rating is strictly less than this limit. - * @defaultValue null + * Included primary Place type (for example, "restaurant" or "gas_station").

A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. */ - set minRating(value: number | null | undefined); + includedPrimaryTypes: string[] | null; /** - * Used to restrict the search to places that are marked as certain price levels. - * @defaultValue null + * Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both locationRestriction and includedRegionCodes are set, the results will be located in the area of intersection. */ - get priceLevels(): google.maps.places.PriceLevelString[] | null; + includedRegionCodes: string[] | null; /** - * Used to restrict the search to places that are marked as certain price levels. - * @defaultValue null + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - set priceLevels(value: google.maps.places.PriceLevelString[] | null | undefined); + get internalUsageAttributionIds(): string[] | null; /** - * How results will be ranked in the response. - * @defaultValue null + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - get rankPreference(): google.maps.places.SearchByTextRankPreferenceString | null; + set internalUsageAttributionIds(value: Iterable | null | undefined); /** - * How results will be ranked in the response. - * @defaultValue null + * A soft boundary or hint to use when searching for places. */ - set rankPreference(value: google.maps.places.SearchByTextRankPreferenceString | null | undefined); + locationBias: google.maps.places.LocationBias | null; /** - * The text query for textual search. - * @defaultValue null + * Bounds to constrain search results. */ - get textQuery(): string | null; + locationRestriction: google.maps.places.LocationRestriction | null; /** - * The text query for textual search. - * @defaultValue null + * The maximum number of characters that the user can enter. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength for details. */ - set textQuery(value: string | null | undefined); + maxlength: number | null; /** - * Used to set strict type filtering for 'includedType'. - * @defaultValue null + * The name to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name for details. Follows the same behavior as the name attribute for inputs. Note that this is the name that will be used when a form is submitted. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form for details. */ - get useStrictTypeFiltering(): boolean | null; + name: string | null; /** - * Used to set strict type filtering for 'includedType'. - * @defaultValue null + * Whether to hide the clear button. */ - set useStrictTypeFiltering(value: boolean | null | undefined); - addEventListener(type: K, listener: (this: PlaceTextSearchRequestElement, ev: PlaceTextSearchRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceTextSearchRequestElementEventMap extends HTMLElementEventMap { - } - /** - * This event fires when a place is selected from a list of places. Access the selection with event.place. - * Access by calling `const {PlaceSelectEvent} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceSelectEvent extends Event { + get noClearButton(): boolean; /** - * The selected place. + * Whether to hide the clear button. */ - get place(): google.maps.places.Place; - } - /** - * Displays the results of a place search in a list. Append a {@link google.maps.places.PlaceTextSearchRequestElement} or {@link google.maps.places.PlaceNearbySearchRequestElement} to specify the request to render results for. Append a {@link google.maps.places.PlaceContentConfigElement}, {@link google.maps.places.PlaceStandardContentElement}, or {@link google.maps.places.PlaceAllContentElement} to specify which content to render.

Example:
 <gmp-place-search>
  <gmp-place-text-search-request
    text-query="QUERY"
  ></gmp-place-text-search-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-search>

To use the Place Search Element, enable the Places UI Kit API for your project in the Google Cloud console. - * Access by calling `const {PlaceSearchElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceSearchElement extends HTMLElement implements google.maps.places.PlaceSearchElementOptions { + set noClearButton(value: boolean | null | undefined); /** - * - * @param options + * Whether to hide the input icon. */ - constructor(options?: google.maps.places.PlaceSearchElementOptions); + get noInputIcon(): boolean; /** - * The position of the attribution logo and legal disclosure button. - * @defaultValue PlaceSearchAttributionPosition.TOP + * Whether to hide the input icon. */ - get attributionPosition(): google.maps.places.PlaceSearchAttributionPositionString; + set noInputIcon(value: boolean | null | undefined); /** - * The position of the attribution logo and legal disclosure button. - * @defaultValue PlaceSearchAttributionPosition.TOP + * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. */ - set attributionPosition(value: google.maps.places.PlaceSearchAttributionPositionString | null | undefined); + get origin(): google.maps.LatLngAltitude | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. */ - get internalUsageAttributionIds(): string[] | null; + set origin(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The placeholder text to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder for details. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + placeholder: string | null; /** - * The orientation variant (vertical or horizontal) of the element. - * @defaultValue PlaceSearchOrientation.VERTICAL + * Whether to include places that are pure service area businesses. */ - get orientation(): google.maps.places.PlaceSearchOrientationString; + pureServiceAreaBusinessesIncluded: boolean | null; /** - * The orientation variant (vertical or horizontal) of the element. - * @defaultValue PlaceSearchOrientation.VERTICAL + * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. */ - set orientation(value: google.maps.places.PlaceSearchOrientationString | null | undefined); + get readonly(): boolean; /** - * Read only. Array of Place objects containing the IDs, locations, and viewports of the currently rendered places. + * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. */ - get places(): google.maps.places.Place[]; + set readonly(value: boolean | null | undefined); /** - * Whether or not the list items are selectable. If true, the list items will be buttons that dispatch the gmp-select event when clicked. Accessible keyboard navigation and selection is also supported. - * @defaultValue false + * A language identifier for the language in which the results should be returned, if possible. Results in the selected language may be given a higher ranking, but suggestions are not restricted to this language. See the list of supported languages. */ - get selectable(): boolean; + requestedLanguage: string | null; /** - * Whether or not the list items are selectable. If true, the list items will be buttons that dispatch the gmp-select event when clicked. Accessible keyboard navigation and selection is also supported. - * @defaultValue false + * A region code which is used for result formatting and for result filtering. It does not restrict the suggestions to this country. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - set selectable(value: boolean | null | undefined); + requestedRegion: string | null; /** - * If true, truncates certain lines of content to fit on one line instead of wrapping. - * @defaultValue false + * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. */ - get truncationPreferred(): boolean; + get unitSystem(): google.maps.UnitSystem | null; /** - * If true, truncates certain lines of content to fit on one line instead of wrapping. - * @defaultValue false + * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. */ - set truncationPreferred(value: boolean | null | undefined); - addEventListener(type: K, listener: (this: PlaceSearchElement, ev: PlaceSearchElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + set unitSystem(value: google.maps.UnitSystem | null | undefined); + addEventListener(type: K, listener: (this: BasicPlaceAutocompleteElement, ev: BasicPlaceAutocompleteElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface PlaceSearchElementEventMap extends HTMLElementEventMap { + export interface BasicPlaceAutocompleteElementEventMap extends HTMLElementEventMap { "gmp-error": Event; - "gmp-load": Event; "gmp-select": google.maps.places.PlaceSelectEvent; } /** - * Request interface for {@link google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions}. + * Options for constructing a BasicPlaceAutocompleteElement. + */ + export interface BasicPlaceAutocompleteElementOptions { + /** + * The description to be used for the input element. This will be detected by screen readers when the input element is focused. + */ + description?: string | null; + + disabled?: boolean | null; + + futureOpeningBusinessesIncluded?: boolean | null; + + includedPrimaryTypes?: string[] | null; + + includedRegionCodes?: string[] | null; + + internalUsageAttributionIds?: Iterable | null; + + locationBias?: google.maps.places.LocationBias | null; + + locationRestriction?: google.maps.places.LocationRestriction | null; + + maxlength?: number | null; + + name?: string | null; + + noClearButton?: boolean | null; + + noInputIcon?: boolean | null; + + origin?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + + placeholder?: string | null; + + pureServiceAreaBusinessesIncluded?: boolean | null; + + readonly?: boolean | null; + + requestedLanguage?: string | null; + + requestedRegion?: string | null; + + unitSystem?: google.maps.UnitSystem | null; + } + /** + * Business status for the place. See the web service documentation for more information. + * + * Access by calling `const {BusinessStatus} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface AutocompleteRequest { - /** - * Include place predictions for businesses that are not yet open but are expected to open in the future. - */ - futureOpeningBusinessesIncluded?: boolean; - /** - * Included primary Place type (for example, "restaurant" or "gas_station").

A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. - */ - includedPrimaryTypes?: string[]; - /** - * Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both locationRestriction and includedRegionCodes are set, the results will be located in the area of intersection. - */ - includedRegionCodes?: string[]; - /** - * The text string on which to search. - */ - input: string; - /** - * A zero-based Unicode character offset of input indicating the cursor position in input. The cursor position may influence what predictions are returned. If not specified, defaults to the length of input. - */ - inputOffset?: number; - /** - * Identifiers used to attribute calls to specific packages or OSS libraries. - */ - internalUsageAttributionIds?: Iterable | null; - /** - * The language in which to return results. Will default to the browser's language preference. The results may be in mixed languages if the language used in input is different from language, or if the returned Place does not have a translation from the local language to language. - */ - language?: string; - /** - * Bias results to a specified location.

At most one of locationBias or locationRestriction should be set. If neither are set, the results will be biased by IP address, meaning the IP address will be mapped to an imprecise location and used as a biasing signal. - */ - locationBias?: google.maps.places.LocationBias; - /** - * Restrict results to a specified location.

At most one of locationBias or locationRestriction should be set. If neither are set, the results will be biased by IP address, meaning the IP address will be mapped to an imprecise location and used as a biasing signal. - */ - locationRestriction?: google.maps.places.LocationRestriction; + export enum BusinessStatus { /** - * The origin point from which to calculate geodesic distance to the destination (returned as {@link google.maps.places.PlacePrediction.distanceMeters}). If this value is omitted, geodesic distance will not be returned. + * The establishment is permanently closed. See the web service documentation for more information. */ - origin?: google.maps.LatLng | google.maps.LatLngLiteral; + CLOSED_PERMANENTLY = 'CLOSED_PERMANENTLY', /** - * Include pure service area businesses if the field is set to true. A pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers may not have a physical address or location on Google Maps. + * The establishment is temporarily closed. See the web service documentation for more information. */ - pureServiceAreaBusinessesIncluded?: boolean; + CLOSED_TEMPORARILY = 'CLOSED_TEMPORARILY', /** - * The region code, specified as a CLDR two-character region code. This affects address formatting, result ranking, and may influence what results are returned. This does not restrict results to the specified region. + * The establishment will open in the future. See the web service documentation for more information. */ - region?: string; + FUTURE_OPENING = 'FUTURE_OPENING', /** - * A token which identifies an Autocomplete session for billing purposes. Generate a new session token via {@link google.maps.places.AutocompleteSessionToken}.

The session begins when the user starts typing a query, and concludes when they select a place and call {@link google.maps.places.Place.fetchFields}. Each session can have multiple queries, followed by one fetchFields call. The credentials used for each request within a session must belong to the same Google Cloud Console project. Once a session has concluded, the token is no longer valid; your app must generate a fresh token for each session. If the sessionToken parameter is omitted, or if you reuse a session token, the session is charged as if no session token was provided (each request is billed separately).

When a session token is provided in the request to {@link google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions}, the same token will automatically be included in the first call to fetchFields on a {@link google.maps.places.Place} returned by calling {@link google.maps.places.PlacePrediction.toPlace} on one of the resulting {@link google.maps.places.AutocompleteSuggestion}s.

We recommend the following guidelines:
  • Use session tokens for all Place Autocomplete calls.
  • Generate a fresh token for each session.
  • Be sure to pass a unique session token for each new session. Using the same token for more than one session will result in each request being billed individually.
+ * The establishment is operational, not necessarily open now. See the web service documentation for more information. */ - sessionToken?: google.maps.places.AutocompleteSessionToken; + OPERATIONAL = 'OPERATIONAL', } + export type BusinessStatusString = `${google.maps.places.BusinessStatus}`; /** - * An Autocomplete suggestion result. - * Access by calling `const {AutocompleteSuggestion} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Defines the component restrictions that can be used with the autocomplete service. */ - export class AutocompleteSuggestion { - /** - * Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address.

If a {@link google.maps.places.AutocompleteRequest.sessionToken} was provided in the AutocompleteRequest used to fetch this AutocompleteSuggestion, the same token will automatically be included when calling {@link google.maps.places.Place.fetchFields} for the first time on the {@link google.maps.places.Place} returned by a call to {@link google.maps.places.PlacePrediction.toPlace}. - */ - get placePrediction(): google.maps.places.PlacePrediction | null; + export interface ComponentRestrictions { /** - * Fetches a list of AutocompleteSuggestions.

If a {@link google.maps.places.AutocompleteRequest.sessionToken} is provided in the request, then that session token will automatically be included when calling {@link google.maps.places.Place.fetchFields} for the first time, on each {@link google.maps.places.Place} returned by {@link google.maps.places.PlacePrediction.toPlace} on the resulting {@link google.maps.places.PlacePrediction}s. + * Restricts predictions to the specified country (ISO 3166-1 Alpha-2 country code, case insensitive). For example, 'us', 'br', or 'au'. You can provide a single one, or an array of up to five country code strings. */ - static fetchAutocompleteSuggestions(autocompleteRequest: google.maps.places.AutocompleteRequest): Promise<{suggestions: google.maps.places.AutocompleteSuggestion[]}>; + country: string | string[] | null; } /** - * Prediction results for a Place Autocomplete prediction. - * Access by calling `const {PlacePrediction} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * EV charging information, aggregated for connectors of the same type and the same charge rate. + * Access by calling `const {ConnectorAggregation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlacePrediction { + export class ConnectorAggregation { /** - * The length of the geodesic in meters from origin if origin is specified. + * The time when the connector availability information in this aggregation was last updated. */ - get distanceMeters(): number | null; + get availabilityLastUpdateTime(): Date | null; /** - * Represents the name of the Place. + * Number of connectors in this aggregation that are currently available. */ - get mainText(): google.maps.places.FormattableText | null; + get availableCount(): number | null; /** - * The unique identifier of the suggested Place. This identifier can be used in other APIs that accept Place IDs. + * Number of connectors in this aggregation. */ - get placeId(): string; + get count(): number; /** - * Represents additional disambiguating features (such as a city or region) to further identify the Place. + * The static max charging rate in kw of each connector of the aggregation. */ - get secondaryText(): google.maps.places.FormattableText | null; + get maxChargeRateKw(): number; /** - * Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address.

text is recommended for developers who wish to show a single UI element. Developers who wish to show two separate, but related, UI elements may want to use {@link google.maps.places.PlacePrediction.mainText} and {@link google.maps.places.PlacePrediction.secondaryText} instead. + * Number of connectors in this aggregation that are currently out of service. */ - get text(): google.maps.places.FormattableText; + get outOfServiceCount(): number | null; /** - * List of types that apply to this Place from Table A or Table B in https://developers.google.com/maps/documentation/places/web-service/place-types. + * The connector type of this aggregation. */ - get types(): string[]; + get type(): google.maps.places.EVConnectorTypeString | null; + } + /** + * The consumer alert message. All text are rendered in the language specified by the languageCode field. + * Access by calling `const {ConsumerAlert} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class ConsumerAlert { /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Sends an Address Validation request associated with this autocomplete session (internally populating the request with the autocomplete session token). No place information from the PlacePrediction is included automatically - this is a convenience method to help with autocomplete session management. + * The details of the consumer alert message. */ - fetchAddressValidation(request: google.maps.addressValidation.AddressValidationRequest): Promise; + get details(): google.maps.places.ConsumerAlertDetails | null; /** - * Returns a {@link google.maps.places.Place} representation of this PlacePrediction. A subsequent call to {@link google.maps.places.Place.fetchFields} is required to get full Place details.

If a {@link google.maps.places.AutocompleteRequest.sessionToken} was provided in the {@link google.maps.places.AutocompleteRequest} used to fetch this PlacePrediction, the same token will automatically be included when calling fetchFields.

Alternatively, when using {@link google.maps.places.PlaceAutocompleteElement} the first call to {@link google.maps.places.Place.fetchFields} on a {@link google.maps.places.Place} returned by {@link google.maps.places.PlacePrediction.toPlace} will automatically include the session token. + * The language code of the consumer alert message. */ - toPlace(): google.maps.places.Place; - } - /** - * Identifies a substring within a given text. - * Access by calling `const {StringRange} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class StringRange { + get languageCode(): string | null; /** - * Zero-based offset of the last Unicode character of the substring (exclusive). + * The overview of the consumer alert message. */ - get endOffset(): number; + get overview(): string | null; /** - * Zero-based offset of the first Unicode character of the substring (inclusive). + * Converts to a plain object. */ - get startOffset(): number; + toJSON(key?: string): unknown; } /** - * Text representing a Place prediction. The text may be used as is or formatted. - * Access by calling `const {FormattableText} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Details of the consumer alert message. + * Access by calling `const {ConsumerAlertDetails} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class FormattableText { + export class ConsumerAlertDetails { /** - * A list of string ranges identifying where the input request matched in {@link google.maps.places.FormattableText.text}. The ranges can be used to format specific parts of text. The substrings may not be exact matches of {@link google.maps.places.AutocompleteRequest.input} if the matching was determined by criteria other than string matching (for example, spell corrections or transliterations). These values are Unicode character offsets of {@link google.maps.places.FormattableText.text}. The ranges are guaranteed to be ordered in increasing offset values. + * The title to show for a link to provide more information. */ - get matches(): google.maps.places.StringRange[]; + get aboutLinkTitle(): string | null; /** - * Text that may be used as is or formatted with {@link google.maps.places.FormattableText.matches}. + * The URI for a link to provide more information. */ - get text(): string; + get aboutLinkURI(): string | null; /** - * Returns {@link google.maps.places.FormattableText.text}. + * The description of the consumer alert message. */ - toString(): string; + get description(): string | null; + /** + * The title to show together with the detailed description. + */ + get title(): string | null; } /** - * BasicPlaceAutocompleteElement is an HTMLElement subclass which provides a UI component for the Places Autocomplete API. - * Access by calling `const {BasicPlaceAutocompleteElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Defines the spatial relationship between the target location and the area. See the web service documentation for more information. + * + * Access by calling `const {Containment} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class BasicPlaceAutocompleteElement extends HTMLElement implements google.maps.places.BasicPlaceAutocompleteElementOptions { + export enum Containment { /** - * - * @param options + * The target location is outside the area region, but close by. See the web service documentation for more information. */ - constructor(options: google.maps.places.BasicPlaceAutocompleteElementOptions); + NEAR = 'NEAR', /** - * The description to be used for the input element. This will be detected by screen readers when the input element is focused. See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby for details. + * The target location is within the area region, close to the edge. See the web service documentation for more information. */ - description: string | null; + OUTSKIRTS = 'OUTSKIRTS', /** - * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. + * The target location is within the area region, close to the center. See the web service documentation for more information. */ - get disabled(): boolean; + WITHIN = 'WITHIN', + } + export type ContainmentString = `${google.maps.places.Containment}`; + /** + * ContentBlock describes the content of a summary and where it came from. + * Access by calling `const {ContentBlock} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class ContentBlock { /** - * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. + * Content related to the topic. */ - set disabled(value: boolean | null | undefined); + get content(): string | null; /** - * Whether to include places that are not yet open but are expected to open in the future. + * Language code of the content. */ - futureOpeningBusinessesIncluded: boolean | null; + get contentLanguageCode(): string | null; /** - * Included primary Place type (for example, "restaurant" or "gas_station").

A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. + * A list of {@link google.maps.places.Place}s referenced. When first retrieved, each Place only contains a place ID in the id field. */ - includedPrimaryTypes: string[] | null; + get referencedPlaces(): google.maps.places.Place[]; /** - * Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both locationRestriction and includedRegionCodes are set, the results will be located in the area of intersection. + * Converts to a plain object. */ - includedRegionCodes: string[] | null; + toJSON(key?: string): unknown; + } + /** + * AI-generated summary of amenities near the EV charging station. This only applies to places with type electric_vehicle_charging_station. + * Access by calling `const {EVChargeAmenitySummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class EVChargeAmenitySummary { /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * A summary of the nearby coffee options. */ - get internalUsageAttributionIds(): string[] | null; + get coffee(): google.maps.places.ContentBlock | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The text for the disclosure relating to this summary. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + get disclosureText(): string | null; /** - * A soft boundary or hint to use when searching for places. + * The language code of the disclosure text. */ - locationBias: google.maps.places.LocationBias | null; + get disclosureTextLanguageCode(): string | null; /** - * Bounds to constrain search results. + * A URI to report a problem with the summary. */ - locationRestriction: google.maps.places.LocationRestriction | null; + get flagContentURI(): string | null; /** - * The maximum number of characters that the user can enter. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength for details. + * An overview of the available amenities. */ - maxlength: number | null; + get overview(): google.maps.places.ContentBlock | null; /** - * The name to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name for details. Follows the same behavior as the name attribute for inputs. Note that this is the name that will be used when a form is submitted. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form for details. + * A summary of the nearby restaurants. */ - name: string | null; + get restaurant(): google.maps.places.ContentBlock | null; /** - * Whether to hide the clear button. + * A summary of nearby stores. */ - get noClearButton(): boolean; + get store(): google.maps.places.ContentBlock | null; /** - * Whether to hide the clear button. + * Converts to a plain object. */ - set noClearButton(value: boolean | null | undefined); + toJSON(key?: string): unknown; + } + /** + * Information about the EV charging station hosted in the place. + * Access by calling `const {EVChargeOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class EVChargeOptions { /** - * Whether to hide the input icon. + * A list of EV charging connector aggregations that contain connectors of the same type and same charge rate. */ - get noInputIcon(): boolean; + get connectorAggregations(): google.maps.places.ConnectorAggregation[]; /** - * Whether to hide the input icon. + * Number of connectors at this station. Because some ports can have multiple connectors but only be able to charge one car at a time, the number of connectors may be greater than the total number of cars which can charge simultaneously. */ - set noInputIcon(value: boolean | null | undefined); + get connectorCount(): number; /** - * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. + * Converts to a plain object. */ - get origin(): google.maps.LatLngAltitude | null; + toJSON(key?: string): unknown; + } + /** + * See http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6872107 for additional information/context on EV charging connector types. See the web service documentation for more information. + * + * Access by calling `const {EVConnectorType} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum EVConnectorType { /** - * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. + * Combined Charging System (AC and DC). See the web service documentation for more information. */ - set origin(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + CCS_COMBO_1 = 'CCS_COMBO_1', /** - * The placeholder text to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder for details. + * Combined Charging System (AC and DC). See the web service documentation for more information. */ - placeholder: string | null; + CCS_COMBO_2 = 'CCS_COMBO_2', /** - * Whether to include places that are pure service area businesses. + * CHAdeMO type connector. See the web service documentation for more information. */ - pureServiceAreaBusinessesIncluded: boolean | null; + CHADEMO = 'CHADEMO', /** - * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. + * J1772 type 1 connector. See the web service documentation for more information. */ - get readonly(): boolean; + J1772 = 'J1772', /** - * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. + * The North American Charging System (NACS), standardized as SAE J3400. See the web service documentation for more information. */ - set readonly(value: boolean | null | undefined); + NACS = 'NACS', /** - * A language identifier for the language in which the results should be returned, if possible. Results in the selected language may be given a higher ranking, but suggestions are not restricted to this language. See the list of supported languages. + * Other connector types. See the web service documentation for more information. */ - requestedLanguage: string | null; + OTHER = 'OTHER', /** - * A region code which is used for result formatting and for result filtering. It does not restrict the suggestions to this country. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * The generic TESLA connector. See the web service documentation for more information. */ - requestedRegion: string | null; + TESLA = 'TESLA', /** - * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. + * IEC 62196 type 2 connector. See the web service documentation for more information. */ - get unitSystem(): google.maps.UnitSystem | null; + TYPE_2 = 'TYPE_2', /** - * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. + * GB/T type corresponds to the GB/T standard in China. See the web service documentation for more information. */ - set unitSystem(value: google.maps.UnitSystem | null | undefined); - addEventListener(type: K, listener: (this: BasicPlaceAutocompleteElement, ev: BasicPlaceAutocompleteElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface BasicPlaceAutocompleteElementEventMap extends HTMLElementEventMap { - "gmp-error": Event; - "gmp-select": google.maps.places.PlaceSelectEvent; - } - /** - * Options for constructing a BasicPlaceAutocompleteElement. - */ - export interface BasicPlaceAutocompleteElementOptions { + UNSPECIFIED_GB_T = 'UNSPECIFIED_GB_T', /** - * The description to be used for the input element. This will be detected by screen readers when the input element is focused. + * Unspecified wall outlet. See the web service documentation for more information. */ - description?: string | null; - - disabled?: boolean | null; - - futureOpeningBusinessesIncluded?: boolean | null; - - includedPrimaryTypes?: string[] | null; - - includedRegionCodes?: string[] | null; - - internalUsageAttributionIds?: Iterable | null; - - locationBias?: google.maps.places.LocationBias | null; - - locationRestriction?: google.maps.places.LocationRestriction | null; - - maxlength?: number | null; - - name?: string | null; - - noClearButton?: boolean | null; - - noInputIcon?: boolean | null; - - origin?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; - - placeholder?: string | null; - - pureServiceAreaBusinessesIncluded?: boolean | null; - - readonly?: boolean | null; - - requestedLanguage?: string | null; - - requestedRegion?: string | null; - - unitSystem?: google.maps.UnitSystem | null; + UNSPECIFIED_WALL_OUTLET = 'UNSPECIFIED_WALL_OUTLET', } + export type EVConnectorTypeString = `${google.maps.places.EVConnectorType}`; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * The list of layouts that the Place Contextual Element supports for the list view. - * - * Access by calling `const {PlaceContextualListLayout} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * EV-related options that can be specified for a place search request. */ - export enum PlaceContextualListLayout { + export interface EVSearchOptions { /** - * Compact list layout: list items are rendered as links across a single line, with overflows in a dropdown list. + * The list of preferred EV connector types. A place that does not support any of the listed connector types is filtered out. */ - COMPACT = 'COMPACT', + connectorTypes?: google.maps.places.EVConnectorTypeString[]; /** - * Vertical list layout: list items are rendered as cards in a vertical list. + * Minimum required charging rate in kilowatts. A place with a charging rate less than the specified rate is filtered out. */ - VERTICAL = 'VERTICAL', + minimumChargingRateKw?: number; } - export type PlaceContextualListLayoutString = `${google.maps.places.PlaceContextualListLayout}`; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * Options for PlaceContextualListConfigElement. + * Options for fetching Place fields. */ - export interface PlaceContextualListConfigElementOptions { + export interface FetchFieldsRequest { /** - * The layout. - * @defaultValue {@link google.maps.places.PlaceContextualListLayout.VERTICAL} + * List of fields to be fetched. */ - layout?: google.maps.places.PlaceContextualListLayoutString | null; + fields: Iterable; /** - * True if the map should be hidden. - * @defaultValue false + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - mapHidden?: boolean | null; + internalUsageAttributionIds?: Iterable | null; } /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * An HTML element that configures options for the Place Contextual Element's list view. - * Access by calling `const {PlaceContextualListConfigElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A find place from text search request to be sent to {@link google.maps.places.PlacesService.findPlaceFromPhoneNumber}. */ - export class PlaceContextualListConfigElement extends HTMLElement implements google.maps.places.PlaceContextualListConfigElementOptions { - /** - * - * @param options - */ - constructor(options?: google.maps.places.PlaceContextualListConfigElementOptions); + export interface FindPlaceFromPhoneNumberRequest { /** - * The layout. + * Fields to be included in the response, which will be billed for. If ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). */ - get layout(): google.maps.places.PlaceContextualListLayoutString; + fields: string[]; /** - * The layout. + * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. */ - set layout(value: google.maps.places.PlaceContextualListLayoutString | null | undefined); + language?: string | null; /** - * Whether the map is hidden. + * The bias used when searching for Place. The result will be biased towards, but not restricted to, the given {@link google.maps.places.LocationBias}. */ - get mapHidden(): boolean; + locationBias?: google.maps.places.LocationBias; /** - * Whether the map is hidden. + * The phone number of the place to look up. Format must be E.164. */ - set mapHidden(value: boolean | null | undefined); - addEventListener(type: K, listener: (this: PlaceContextualListConfigElement, ev: PlaceContextualListConfigElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceContextualListConfigElementEventMap extends HTMLElementEventMap { + phoneNumber: string; } /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * Options for PlaceContextualElement. + * A find place from text search request to be sent to {@link google.maps.places.PlacesService.findPlaceFromQuery}. */ - export interface PlaceContextualElementOptions { + export interface FindPlaceFromQueryRequest { /** - * The context token provided by the Grounding with Google Maps response. + * Fields to be included in the response, which will be billed for. If ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). */ - contextToken?: string | null; + fields: string[]; + /** + * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. + */ + language?: string | null; + /** + * The bias used when searching for Place. The result will be biased towards, but not restricted to, the given {@link google.maps.places.LocationBias}. + */ + locationBias?: google.maps.places.LocationBias; + /** + * The request's query. For example, the name or address of a place. + */ + query: string; } /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * A widget that uses the context token to display a contextual view of the Grounding with Google Maps response. - * Access by calling `const {PlaceContextualElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Text representing a Place prediction. The text may be used as is or formatted. + * Access by calling `const {FormattableText} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceContextualElement extends HTMLElement implements google.maps.places.PlaceContextualElementOptions { + export class FormattableText { /** - * - * @param options + * A list of string ranges identifying where the input request matched in {@link google.maps.places.FormattableText.text}. The ranges can be used to format specific parts of text. The substrings may not be exact matches of {@link google.maps.places.AutocompleteRequest.input} if the matching was determined by criteria other than string matching (for example, spell corrections or transliterations). These values are Unicode character offsets of {@link google.maps.places.FormattableText.text}. The ranges are guaranteed to be ordered in increasing offset values. */ - constructor(options?: google.maps.places.PlaceContextualElementOptions); + get matches(): google.maps.places.StringRange[]; /** - * The context token. + * Text that may be used as is or formatted with {@link google.maps.places.FormattableText.matches}. */ - get contextToken(): string | undefined; + get text(): string; /** - * The context token. + * Returns {@link google.maps.places.FormattableText.text}. */ - set contextToken(value: string | null | undefined); - addEventListener(type: K, listener: (this: PlaceContextualElement, ev: PlaceContextualElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceContextualElementEventMap extends HTMLElementEventMap { + toString(): string; } /** - * This event is created after the user selects a prediction item with the PlaceAutocompleteElement. Access the selection with event.placePrediction.

Convert placePrediction to a {@link google.maps.places.Place} by calling {@link google.maps.places.PlacePrediction.toPlace}. - * Access by calling `const {PlacePredictionSelectEvent} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The most recent information about fuel options in a gas station. This information is updated regularly. + * Access by calling `const {FuelOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlacePredictionSelectEvent extends Event { + export class FuelOptions { /** - * Convert this to a {@link google.maps.places.Place} by calling {@link google.maps.places.PlacePrediction.toPlace}. + * A list of fuel prices for each type of fuel this station has, one entry per fuel type. */ - get placePrediction(): google.maps.places.PlacePrediction; + get fuelPrices(): google.maps.places.FuelPrice[]; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } /** - * PlaceAutocompleteElement is an HTMLElement subclass which provides a UI component for the Places Autocomplete API.

PlaceAutocompleteElement automatically uses {@link google.maps.places.AutocompleteSessionToken}s internally to group the query and selection phases of a user's autocomplete search.

The first call to {@link google.maps.places.Place.fetchFields} on a {@link google.maps.places.Place} returned by {@link google.maps.places.PlacePrediction.toPlace} will automatically include the session token used to fetch the PlacePrediction.

See https://developers.google.com/maps/documentation/places/web-service/place-session-tokens for more details on how sessions work. - * Access by calling `const {PlaceAutocompleteElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Fuel price information for a given type of fuel. + * Access by calling `const {FuelPrice} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class PlaceAutocompleteElement extends HTMLElement implements google.maps.places.PlaceAutocompleteElementOptions { + export class FuelPrice { /** - * - * @param options + * The price of the fuel. */ - constructor(options: google.maps.places.PlaceAutocompleteElementOptions); + get price(): google.maps.places.Money | null; /** - * The description to be used for the input element. This will be detected by screen readers when the input element is focused. See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby for details. + * The type of fuel. */ - description: string | null; + get type(): google.maps.places.FuelTypeString | null; /** - * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. + * The time the fuel price was last updated. */ - get disabled(): boolean; + get updateTime(): Date | null; + } + /** + * Types of fuel. See the web service documentation for more information. + * + * Access by calling `const {FuelType} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum FuelType { /** - * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. + * Bio-diesel. See the web service documentation for more information. */ - set disabled(value: boolean | null | undefined); + BIO_DIESEL = 'BIO_DIESEL', /** - * Whether to include places that are not yet open but are expected to open in the future. + * Diesel fuel. See the web service documentation for more information. */ - futureOpeningBusinessesIncluded: boolean | null; + DIESEL = 'DIESEL', /** - * Included primary Place type (for example, "restaurant" or "gas_station").

A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. + * Diesel plus fuel. See the web service documentation for more information. */ - includedPrimaryTypes: string[] | null; + DIESEL_PLUS = 'DIESEL_PLUS', /** - * Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both locationRestriction and includedRegionCodes are set, the results will be located in the area of intersection. + * E 100. See the web service documentation for more information. */ - includedRegionCodes: string[] | null; + E100 = 'E100', /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * E 80. See the web service documentation for more information. */ - get internalUsageAttributionIds(): string[] | null; + E80 = 'E80', /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * E 85. See the web service documentation for more information. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + E85 = 'E85', /** - * A soft boundary or hint to use when searching for places. + * Liquefied Petroleum Gas. See the web service documentation for more information. */ - locationBias: google.maps.places.LocationBias | null; + LPG = 'LPG', /** - * Bounds to constrain search results. + * Methane. See the web service documentation for more information. */ - locationRestriction: google.maps.places.LocationRestriction | null; + METHANE = 'METHANE', /** - * The maximum number of characters that the user can enter. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength for details. + * Midgrade. See the web service documentation for more information. */ - maxlength: number | null; + MIDGRADE = 'MIDGRADE', /** - * The name to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name for details. Follows the same behavior as the name attribute for inputs. Note that this is the name that will be used when a form is submitted. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form for details. + * Premium. See the web service documentation for more information. */ - name: string | null; + PREMIUM = 'PREMIUM', /** - * Whether to hide the clear button. + * Regular unleaded. See the web service documentation for more information. */ - get noClearButton(): boolean; + REGULAR_UNLEADED = 'REGULAR_UNLEADED', /** - * Whether to hide the clear button. + * SP 100. See the web service documentation for more information. */ - set noClearButton(value: boolean | null | undefined); + SP100 = 'SP100', /** - * Whether to hide the input icon. + * SP 91. See the web service documentation for more information. */ - get noInputIcon(): boolean; + SP91 = 'SP91', /** - * Whether to hide the input icon. + * SP 91 E10. See the web service documentation for more information. */ - set noInputIcon(value: boolean | null | undefined); + SP91_E10 = 'SP91_E10', /** - * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. + * SP 92. See the web service documentation for more information. */ - get origin(): google.maps.LatLngAltitude | null; + SP92 = 'SP92', /** - * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. + * SP 95. See the web service documentation for more information. */ - set origin(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + SP95 = 'SP95', /** - * The placeholder text to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder for details. + * SP95 E10. See the web service documentation for more information. */ - placeholder: string | null; + SP95_E10 = 'SP95_E10', /** - * Whether to include places that are pure service area businesses. + * SP 98. See the web service documentation for more information. */ - pureServiceAreaBusinessesIncluded: boolean | null; + SP98 = 'SP98', /** - * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. + * SP 99. See the web service documentation for more information. */ - get readonly(): boolean; + SP99 = 'SP99', /** - * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. + * Truck diesel. See the web service documentation for more information. */ - set readonly(value: boolean | null | undefined); + TRUCK_DIESEL = 'TRUCK_DIESEL', + } + export type FuelTypeString = `${google.maps.places.FuelType}`; + /** + * AI-generated summary of the place. + * Access by calling `const {GenerativeSummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class GenerativeSummary { /** - * A language identifier for the language in which the results should be returned, if possible. Results in the selected language may be given a higher ranking, but suggestions are not restricted to this language. See the list of supported languages. + * The text for the disclosure relating to this summary. */ - requestedLanguage: string | null; + get disclosureText(): string | null; /** - * A region code which is used for result formatting and for result filtering. It does not restrict the suggestions to this country. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). + * The language code of the disclosure text. */ - requestedRegion: string | null; + get disclosureTextLanguageCode(): string | null; /** - * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. + * A URI to report a problem with the summary. */ - get unitSystem(): google.maps.UnitSystem | null; + get flagContentURI(): string | null; /** - * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. + * The overview of the place. */ - set unitSystem(value: google.maps.UnitSystem | null | undefined); + get overview(): string | null; /** - * The value of the input element. + * The language code of the overview. */ - get value(): string; + get overviewLanguageCode(): string | null; /** - * The value of the input element. + * Converts to a plain object. */ - set value(value: string | null); - addEventListener(type: K, listener: (this: PlaceAutocompleteElement, ev: PlaceAutocompleteElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PlaceAutocompleteElementEventMap extends HTMLElementEventMap { - "gmp-error": Event; - "gmp-select": google.maps.places.PlacePredictionSelectEvent; + toJSON(key?: string): unknown; } /** - * Options for constructing a PlaceAutocompleteElement. For the description of each property, refer to the property of the same name in the PlaceAutocompleteElement class. + * Links to trigger different Google Maps actions. + * Access by calling `const {GoogleMapsLinks} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface PlaceAutocompleteElementOptions { + export class GoogleMapsLinks { /** - * The description to be used for the input element. This will be detected by screen readers when the input element is focused. + * A link to show the directions to the place on Google Maps. The link only populates the destination location and uses the default travel mode DRIVE. */ - description?: string | null; - - disabled?: boolean | null; - - futureOpeningBusinessesIncluded?: boolean | null; - - includedPrimaryTypes?: string[] | null; - - includedRegionCodes?: string[] | null; - - internalUsageAttributionIds?: Iterable | null; - - locationBias?: google.maps.places.LocationBias | null; - - locationRestriction?: google.maps.places.LocationRestriction | null; - - maxlength?: number | null; - - name?: string | null; - - noClearButton?: boolean | null; - - noInputIcon?: boolean | null; - - origin?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; - - placeholder?: string | null; - - pureServiceAreaBusinessesIncluded?: boolean | null; - - readonly?: boolean | null; - - requestedLanguage?: string | null; - - requestedRegion?: string | null; - - unitSystem?: google.maps.UnitSystem | null; + get directionsURI(): string | null; /** - * The value of the input element. + * A link to show the photos for the place on Google Maps. */ - value?: string | null; - } -} - -declare namespace google.maps.addressValidation { - /** - * Represents a single component of an address (ex. street name, city). - * Access by calling `const {AddressComponent} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AddressComponent { + get photosURI(): string | null; /** - * The component name text. For example, "5th Avenue" for a street name or "1253" for a street number, + * A link to show the place on Google Maps. */ - get componentName(): string | null; + get placeURI(): string | null; /** - * The BCP-47 language code. This will not be present if the component name is not associated with a language, such as a street number. + * A link to show the reviews for the place on Google Maps. */ - get componentNameLanguageCode(): string | null; + get reviewsURI(): string | null; /** - * The type of the address component. See Table 2: Additional types returned by the Places service for a list of possible types. + * A link to write a review for the place on Google Maps. */ - get componentType(): string | null; + get writeAReviewURI(): string | null; /** - * Indicates the level of certainty that the component is correct. + * Converts to a plain object. */ - get confirmationLevel(): google.maps.addressValidation.ConfirmationLevelString | null; + toJSON(key?: string): unknown; + } + /** + * Basic landmark information and the landmark's relationship with the target location. Landmarks are prominent places that can be used to describe a location. + * Access by calling `const {Landmark} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Landmark { /** - * If true, this component was not part of the input, but was inferred for the address location. Including this component is recommended for a complete address. + * The landmark's place. */ - get inferred(): boolean; + get place(): google.maps.places.Place; /** - * Indicates the name of the component was replaced with a completely different one. For example, replacing a wrong postal code being with one that is correct for the address. This is not a cosmetic change; the input component has been changed to a different one. + * The spatial relationship between the target location and the landmark. */ - get replaced(): boolean; + get spatialRelationship(): google.maps.places.SpatialRelationshipString; /** - * Indicates a correction to a misspelling in the component name. The API does not always flag changes from one spelling variant to another, such as "centre" to "center". + * The straight line distance, in meters, between the center point of the target and the center point of the landmark. In some situations, this value can be longer than travelDistanceMeters. */ - get spellCorrected(): boolean; + get straightLineDistanceMeters(): number; /** - * If true, this component is not expected to be present in a postal address for the given region. It has been retained only because it was part of the input. + * The travel distance, in meters, along the road network from the target to the landmark, if known. This value does not take into account the mode of transportation, such as walking, driving, biking. */ - get unexpected(): boolean; + get travelDistanceMeters(): number | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } - /** - * The different possible values indicating the level of certainty that the component is correct. - * - * Access by calling `const {ConfirmationLevel} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum ConfirmationLevel { - - CONFIRMED = 'CONFIRMED', - UNCONFIRMED_AND_SUSPICIOUS = 'UNCONFIRMED_AND_SUSPICIOUS', + export type LocationBias = google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | google.maps.Circle | google.maps.CircleLiteral | string; - UNCONFIRMED_BUT_PLAUSIBLE = 'UNCONFIRMED_BUT_PLAUSIBLE', - } - export type ConfirmationLevelString = `${google.maps.addressValidation.ConfirmationLevel}`; + export type LocationRestriction = google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * Details of the post-processed address. Post-processing includes correcting misspelled parts of the address, replacing incorrect parts, and inferring missing parts. - * Access by calling `const {Address} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * The preferred media size in cases where multiple sizes are supported, such as the vertical {@link google.maps.places.PlaceSearchElement}. + * + * Access by calling `const {MediaSize} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Address { + export enum MediaSize { /** - * The individual address components of the formatted and corrected address, along with validation information. This provides information on the validation status of the individual components. + * Large media size. */ - get components(): google.maps.addressValidation.AddressComponent[]; + LARGE = 'LARGE', /** - * The post-processed address, formatted as a single-line address following the address-formatting rules of the region where the address is located. + * Medium media size. */ - get formattedAddress(): string | null; + MEDIUM = 'MEDIUM', /** - * The types of components that were expected to be present in a correctly formatted mailing address but were not found in the input AND could not be inferred. Components of this type are not present in formatted_address, postal_address, or address_components. An example might be ['street_number', 'route'] for an input like "Boulder, Colorado, 80301, USA". The list of possible types can be found here. + * Small media size. */ - get missingComponentTypes(): string[]; + SMALL = 'SMALL', + } + export type MediaSizeString = `${google.maps.places.MediaSize}`; + /** + * A representation of an amount of money with its currency type. + * Access by calling `const {Money} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Money { /** - * The post-processed address represented as a postal address. + * The three-letter currency code, defined in ISO 4217. */ - get postalAddress(): google.maps.places.PostalAddress | null; + get currencyCode(): string; /** - * The types of the components that are present in the address_components but could not be confirmed to be correct. This field is provided for the sake of convenience: its contents are equivalent to iterating through the address_components to find the types of all the components where the {@link google.maps.addressValidation.AddressComponent.confirmationLevel} is not {@link google.maps.addressValidation.ConfirmationLevel.CONFIRMED} or the {@link google.maps.addressValidation.AddressComponent.inferred} flag is not set to true. The list of possible types can be found here. + * Number of nano (10^-9) units of the amount. */ - get unconfirmedComponentTypes(): string[]; + get nanos(): number; /** - * Any tokens in the input that could not be resolved. This might be an input that was not recognized as a valid part of an address (for example in an input like "123235253253 Main St, San Francisco, CA, 94105", the unresolved tokens may look like ["123235253253"] since that does not look like a valid street number. + * The whole units of the amount. For example, if {@link google.maps.places.Money.currencyCode} is "USD", then 1 unit is 1 US dollar. */ - get unresolvedTokens(): string[]; + get units(): number; /** - * Converts to a plain object. + * Returns a human-readable representation of the amount of money with its currency symbol. */ - toJSON(key?: string): unknown; - } - /** - * The metadata for the address. AddressMetadata is not guaranteed to be fully populated for every address sent to the Address Validation API. - * Access by calling `const {AddressMetadata} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AddressMetadata { - - get business(): boolean; - - get poBox(): boolean; - - get residential(): boolean; + toString(): string; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Request interface for {@link google.maps.addressValidation.AddressValidation.fetchAddressValidation}. + * AI-generated summary of points of interest near the place. + * Access by calling `const {NeighborhoodSummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface AddressValidationRequest { + export class NeighborhoodSummary { /** - * The address being validated. Unformatted addresses should be submitted via {@link google.maps.places.PostalAddress.addressLines}. + * A detailed description of the neighborhood. */ - address: google.maps.places.PostalAddressLiteral; + get description(): google.maps.places.ContentBlock | null; /** - * If using a PlaceAutocompleteElement, include it here to link the AddressValidation API calls with the autocomplete session token. + * The text for the disclosure relating to this summary. */ - placeAutocompleteElement?: google.maps.places.PlaceAutocompleteElement; + get disclosureText(): string | null; /** - * This field must not be set for the first address validation request. If more requests are necessary to fully validate a single address (for example if the changes the user makes after the initial validation need to be re-validated), then each followup request must populate this field with the {@link google.maps.addressValidation.AddressValidation.responseId} from the very first response in the validation sequence. + * The language code of the disclosure text. */ - previousResponseId?: string; + get disclosureTextLanguageCode(): string | null; /** - * A token which identifies an Autocomplete session for billing purposes. + * A URI to report a problem with the summary. */ - sessionToken?: google.maps.places.AutocompleteSessionToken; + get flagContentURI(): string | null; + /** + * An overview of the neighborhood. + */ + get overview(): google.maps.places.ContentBlock | null; /** - * Enables USPS CASS compatible mode. This affects only the {@link google.maps.addressValidation.AddressValidation.uspsData} field of {@link google.maps.addressValidation.AddressValidation}. Note: for USPS CASS enabled requests for addresses in Puerto Rico, a {@link google.maps.places.PostalAddress.regionCode} of the address must be provided as "PR", or an {@link google.maps.places.PostalAddress.administrativeArea} of the address must be provided as "Puerto Rico" (case-insensitive) or "PR". + * Converts to a plain object. */ - uspsCASSEnabled?: boolean; + toJSON(key?: string): unknown; } /** - * Contains information about the place the input was geocoded to. - * Access by calling `const {Geocode} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Information about business hours of a Place. + * Access by calling `const {OpeningHours} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Geocode { - /** - * The bounds of the geocoded place. - */ - get bounds(): google.maps.LatLngBounds | null; + export class OpeningHours { /** - * The size of the geocoded place, in meters. This is another measure of the coarseness of the geocoded location, but in physical size rather than in semantic meaning. + * Opening periods covering each day of the week, starting from Sunday, in chronological order. Does not include days where the Place is not open. */ - get featureSizeMeters(): number | null; + get periods(): google.maps.places.OpeningHoursPeriod[]; /** - * The geocoded location of the input. + * An array of dates representing special days that fall within the current period. Special days impact the business hours of a place, e.g. Christmas day or one off closures. Set for currentOpeningHours and currentSecondaryOpeningHours if there are exceptional hours. */ - get location(): google.maps.LatLngAltitude | null; + get specialDays(): Date[]; /** - * The Place ID of the geocoded place. Using Place is preferred over using addresses, latitude/longitude coordinates, or plus codes. Using coordinates for routing or calculating driving directions will always result in the point being snapped to the road nearest to those coordinates. This may not be a road that will quickly or safely lead to the destination and may not be near an access point to the property. Additionally, when a location is reverse geocoded, there is no guarantee that the returned address will match the original. + * An array of seven strings representing the formatted opening hours for each day of the week. The Places Service will format and localize the opening hours appropriately for the current language. The ordering of the elements in this array depends on the language. Some languages start the week on Monday, while others start on Sunday. */ - get placeId(): string | null; + get weekdayDescriptions(): string[]; /** - * The type(s) of place that the input geocoded to. For example, ['locality', 'political']. The full list of types can be found in the Geocoding API documentation. + * Converts to a plain object. */ - get placeTypes(): string[]; + toJSON(key?: string): unknown; + } + /** + * A period where the Place is open. + * Access by calling `const {OpeningHoursPeriod} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class OpeningHoursPeriod { /** - * The plus code corresponding to the location. + * The closing time for the Place. */ - get plusCode(): google.maps.places.PlusCode | null; + get close(): google.maps.places.OpeningHoursPoint | null; /** - * Returns a Place representation of this Geocode. To get full place details, a call to place.fetchFields() should be made. + * The opening time for the Place. */ - fetchPlace(): void; + get open(): google.maps.places.OpeningHoursPoint; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * USPS representation of a US address. - * Access by calling `const {USPSAddress} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A point where the Place changes its opening status. + * Access by calling `const {OpeningHoursPoint} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class USPSAddress { + export class OpeningHoursPoint { /** - * The city name. + * The day of the week, as a number in the range [0, 6], starting on Sunday. For example, 2 means Tuesday. */ - get city(): string | null; + get day(): number; /** - * The address line containing the city, state, and zip code. + * The hour of the OpeningHoursPoint.time as a number, in the range [0, 23]. This will be reported in the Place’s time zone. */ - get cityStateZipAddressLine(): string | null; + get hour(): number; /** - * The name of the firm. + * The minute of the OpeningHoursPoint.time as a number, in the range [0, 59]. This will be reported in the Place’s time zone. */ - get firm(): string | null; + get minute(): number; /** - * The first line of the address. + * Converts to a plain object. */ - get firstAddressLine(): string | null; + toJSON(key?: string): unknown; + } + /** + * Access by calling `const {ParkingOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class ParkingOptions { /** - * The second line of the address. + * Whether a place offers free garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get secondAddressLine(): string | null; + get hasFreeGarageParking(): boolean | null; /** - * The 2-letter state code. + * Whether a place offers free parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get state(): string | null; + get hasFreeParkingLot(): boolean | null; /** - * The Puerto Rican urbanization name. + * Whether a place offers free street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get urbanization(): string | null; + get hasFreeStreetParking(): boolean | null; /** - * The Postal code, e.g. "10009". + * Whether a place offers paid garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get zipCode(): string | null; + get hasPaidGarageParking(): boolean | null; /** - * The 4-digit postal code extension, e.g. "5023". + * Whether a place offers paid parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get zipCodeExtension(): string | null; + get hasPaidParkingLot(): boolean | null; /** - * Converts to a plain object. + * Whether a place offers paid street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - toJSON(key?: string): unknown; + get hasPaidStreetParking(): boolean | null; + /** + * Whether a place offers valet parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. + */ + get hasValetParking(): boolean | null; } /** - * The USPS data for the address. USPSData is not guaranteed to be fully populated for every US or PR address sent to the Address Validation API. It's recommended to integrate the backup address fields in the response if you utilize uspsData as the primary part of the response. - * Access by calling `const {USPSData} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {PaymentOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class USPSData { - /** - * Abbreviated city. - */ - get abbreviatedCity(): string | null; + export class PaymentOptions { /** - * Type of the address record that matches the input address. + * Whether a place only accepts payment via cash. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get addressRecordType(): string | null; + get acceptsCashOnly(): boolean | null; /** - * The carrier route code. A four character code consisting of a one letter prefix and a three digit route designator. + * Whether a place accepts payment via credit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get carrierRoute(): string | null; + get acceptsCreditCards(): boolean | null; /** - * Carrier route rate sort indicator. + * Whether a place accepts payment via debit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get carrierRouteIndicator(): string | null; + get acceptsDebitCards(): boolean | null; /** - * Indicator that the request has been CASS processed. + * Whether a place accepts payment via NFC. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. */ - get cassProcessed(): boolean; + get acceptsNFC(): boolean | null; + } + /** + * Information about a photo of a Place. + * Access by calling `const {Photo} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Photo { /** - * County name. + * Attribution text to be displayed for this photo. */ - get county(): string | null; + get authorAttributions(): google.maps.places.AuthorAttribution[]; /** - * The delivery point check digit. This number is added to the end of the delivery_point_barcode for mechanically scanned mail. Adding all the digits of the delivery_point_barcode, delivery_point_check_digit, postal code, and ZIP+4 together should yield a number divisible by 10. + * A link where user can flag a problem with the photo. */ - get deliveryPointCheckDigit(): string | null; + get flagContentURI(): string | null; /** - * The 2-digit delivery point code. + * A link to show the photo on Google Maps. */ - get deliveryPointCode(): string | null; + get googleMapsURI(): string | null; /** - * Indicates if the address is a CMRA (Commercial Mail Receiving Agency)--a private business receiving mail for clients. Returns a single character. + * The height of the photo in pixels. */ - get dpvCMRA(): string | null; + get heightPx(): number; /** - * The possible values for DPV confirmation. Returns a single character or returns no value. + * The width of the photo in pixels. */ - get dpvConfirmation(): string | null; + get widthPx(): number; /** - * Flag indicates addresses where USPS cannot knock on a door to deliver mail. Returns a single character. + * Returns the image URL corresponding to the specified options. */ - get dpvDoorNotAccessible(): string | null; + getURI(options?: google.maps.places.PhotoOptions): string; /** - * Flag indicates mail is delivered to a single receptable at a site. Returns a single character. + * Converts to a plain object. */ - get dpvDrop(): string | null; + toJSON(key?: string): unknown; + } + /** + * Defines photo-requesting options. + */ + export interface PhotoOptions { /** - * Indicates that more than one DPV return code is valid for the address. Returns a single character. + * The maximum height in pixels of the returned image. */ - get dpvEnhancedDeliveryCode(): string | null; + maxHeight?: number | null; /** - * The footnotes from delivery point validation. Multiple footnotes may be strung together in the same string. + * The maximum width in pixels of the returned image. */ - get dpvFootnote(): string | null; + maxWidth?: number | null; + } + /** + * Access by calling `const {Place} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class Place implements google.maps.places.PlaceOptions { /** - * Flag indicates mail delivery is not performed every day of the week. Returns a single character. + * + * @param options */ - get dpvNonDeliveryDays(): string | null; + constructor(options: google.maps.places.PlaceOptions); /** - * Integer identifying non-delivery days. It can be interrogated using bit flags: 0x40 – Sunday is a non-delivery day 0x20 – Monday is a non-delivery day 0x10 – Tuesday is a non-delivery day 0x08 – Wednesday is a non-delivery day 0x04 – Thursday is a non-delivery day 0x02 – Friday is a non-delivery day 0x01 – Saturday is a non-delivery day + * Accessibility options of this Place. undefined if the accessibility options data have not been called for from the server. */ - get dpvNonDeliveryDaysValues(): number | null; + get accessibilityOptions(): google.maps.places.AccessibilityOptions | null | undefined; /** - * Flag indicates door is accessible, but package will not be left due to security concerns. Returns a single character. + * The collection of address components for this Place’s location. Empty object if there is no known address data. undefined if the address data has not been called for from the server. */ - get dpvNoSecureLocation(): string | null; + get addressComponents(): google.maps.places.AddressComponent[] | undefined; /** - * Indicates whether the address is a no stat address or an active address. No stat addresses are ones which are not continuously occupied or addresses that the USPS does not service. Returns a single character. + * The address descriptor for this place. Address descriptors include additional information that help describe a location using landmarks and areas. See address descriptor regional coverage in https://developers.google.com/maps/documentation/geocoding/address-descriptors/coverage. */ - get dpvNoStat(): string | null; + get addressDescriptor(): google.maps.places.AddressDescriptor | null | undefined; /** - * Indicates the NoStat type. Returns a reason code as int. + * The representation of the Place’s address in the adr microformat. */ - get dpvNoStatReasonCode(): number | null; + get adrFormatAddress(): string | null | undefined; + + get allowsDogs(): boolean | null | undefined; /** - * Indicates the address was matched to PBSA record. Returns a single character. + * Data providers that must be shown for the Place. */ - get dpvPBSA(): string | null; + get attributions(): google.maps.places.Attribution[] | undefined; /** - * Indicates that mail is not delivered to the street address. Returns a single character. + * The location's operational status. null if there is no known status. undefined if the status data has not been loaded from the server. */ - get dpvThrowback(): string | null; + get businessStatus(): google.maps.places.BusinessStatusString | null | undefined; /** - * Indicates whether the address is vacant. Returns a single character. + * The consumer alert for this place. */ - get dpvVacant(): string | null; + get consumerAlert(): google.maps.places.ConsumerAlert | null | undefined; /** - * eLOT Ascending/Descending Flag (A/D). + * The list of containing places for this place. Containing places are places that contain the place. */ - get elotFlag(): string | null; + get containingPlaces(): google.maps.places.Place[] | undefined; /** - * Enhanced Line of Travel (eLOT) number. + * The hours of operation for the next seven days (including today). This includes exceptional hours like holidays and irregular closures. */ - get elotNumber(): string | null; + get currentOpeningHours(): google.maps.places.OpeningHours | null | undefined; /** - * Error message for USPS data retrieval. This is populated when USPS processing is suspended because of the detection of artificially created addresses. + * The current secondary hours of this place which includes exceptional hours like holidays and irregular closures for the next seven days. Secondary hours are different from a place's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. */ - get errorMessage(): string | null; + get currentSecondaryOpeningHours(): google.maps.places.SecondaryOpeningHours[] | undefined; /** - * FIPS county code. + * The location's display name. null if there is no name. undefined if the name data has not been loaded from the server. */ - get fipsCountyCode(): string | null; + get displayName(): string | null | undefined; /** - * Indicator that a default address was found, but more specific addresses exist. + * The language of the location's display name. null if there is no name. undefined if the name data has not been loaded from the server. */ - get hasDefaultAddress(): boolean; + get displayNameLanguageCode(): string | null | undefined; /** - * The delivery address is matchable, but the EWS file indicates that an exact match will be available soon. + * The editorial summary for this place. null if there is no editorial summary. undefined if this field has not yet been requested. */ - get hasNoEWSMatch(): boolean; + get editorialSummary(): string | null | undefined; /** - * LACSLink indicator. + * The language of the editorial summary for this place. null if there is no editorial summary. undefined if this field has not yet been requested. */ - get lacsLinkIndicator(): string | null; + get editorialSummaryLanguageCode(): string | null | undefined; /** - * LACSLink return code. + * The EVChargeAmenitySummary for this place. */ - get lacsLinkReturnCode(): string | null; + get evChargeAmenitySummary(): google.maps.places.EVChargeAmenitySummary | null | undefined; /** - * PMB (Private Mail Box) unit designator. + * EV Charge options provided by the place. undefined if the EV charge options have not been called for from the server. */ - get pmbDesignator(): string | null; + get evChargeOptions(): google.maps.places.EVChargeOptions | null | undefined; /** - * PMB (Private Mail Box) number. + * The location’s full address. */ - get pmbNumber(): string | null; + get formattedAddress(): string | null | undefined; /** - * PO Box only postal code. + * Fuel options provided by the place. undefined if the fuel options have not been called for from the server. */ - get poBoxOnlyPostalCode(): boolean; + get fuelOptions(): google.maps.places.FuelOptions | null | undefined; /** - * Main post office city. + * The date this place will open, if its businessStatus is FUTURE_OPENING. When the field is not requested, this field will be undefined. Otherwise, this field will be populated with the opening date if it is available, and null if it is not. */ - get postOfficeCity(): string | null; + get futureOpeningDate(): Date | null | undefined; /** - * Main post office state. + * The GenerativeSummary for this place. */ - get postOfficeState(): string | null; + get generativeSummary(): google.maps.places.GenerativeSummary | null | undefined; /** - * USPS standardized address. + * Links to trigger different Google Maps actions. */ - get standardizedAddress(): google.maps.addressValidation.USPSAddress | null; + get googleMapsLinks(): google.maps.places.GoogleMapsLinks | null | undefined; /** - * Footnotes from matching a street or highrise record to suite information. If business name match is found, the secondary number is returned. + * URL of the official Google page for this place. This is the Google-owned page that contains the best available information about the Place. */ - get suiteLinkFootnote(): string | null; + get googleMapsURI(): string | null | undefined; /** - * Converts to a plain object. + * Whether a place has curbside pickup. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - toJSON(key?: string): unknown; - } - /** - * Represents the post-processed address for the supplied address. - * Access by calling `const {Verdict} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Verdict { + get hasCurbsidePickup(): boolean | null | undefined; /** - * The address is considered complete if there are no unresolved tokens, no unexpected or missing address components. If unset, indicates that the value is false. See {@link google.maps.addressValidation.Address.missingComponentTypes}, {@link google.maps.addressValidation.Address.unresolvedTokens} or {@link google.maps.addressValidation.AddressComponent.unexpected} fields for more details. + * Whether a place has delivery. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - get addressComplete(): boolean; + get hasDelivery(): boolean | null | undefined; /** - * Information about the granularity of the {@link google.maps.addressValidation.Geocode}. This can be understood as the semantic meaning of how coarse or fine the geocoded location is. + * Whether a place has dine in. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - get geocodeGranularity(): google.maps.addressValidation.GranularityString | null; + get hasDineIn(): boolean | null | undefined; + + get hasLiveMusic(): boolean | null | undefined; + + get hasMenuForChildren(): boolean | null | undefined; + + get hasOutdoorSeating(): boolean | null | undefined; + + get hasRestroom(): boolean | null | undefined; /** - * At least one address component was inferred (i.e. added) that wasn't in the input, see {@link google.maps.addressValidation.AddressComponent} for details. + * Whether a place has takeout. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - get hasInferredComponents(): boolean; + get hasTakeout(): boolean | null | undefined; /** - * At least one address component was replaced - see {@link google.maps.addressValidation.AddressComponent} for details. + * The default HEX color code for the place's category. */ - get hasReplacedComponents(): boolean | null; + get iconBackgroundColor(): string | null | undefined; /** - * At least one address component cannot be categorized or validated, see {@link google.maps.addressValidation.AddressComponent} for details. + * The unique place id. */ - get hasUnconfirmedComponents(): boolean; + get id(): string; /** - * The granularity of the input address. This is the result of parsing the input address and does not give any validation signals. For validation signals, refer to validationGranularity. + * The Place’s phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign. */ - get inputGranularity(): google.maps.addressValidation.GranularityString | null; + get internationalPhoneNumber(): string | null | undefined; + + get isGoodForChildren(): boolean | null | undefined; + + get isGoodForGroups(): boolean | null | undefined; + + get isGoodForWatchingSports(): boolean | null | undefined; /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * A possible next action to take based on other fields in the API response. See {@link google.maps.addressValidation.PossibleNextAction} for details. + * Indicates whether the place is a pure service area business. A pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers may not have a physical address or location on Google Maps. */ - get possibleNextAction(): google.maps.addressValidation.PossibleNextActionString | null; + get isPureServiceAreaBusiness(): boolean | null | undefined; /** - * The granularity level that the API can fully validate the address to. For example, a validationGranularity of PREMISE indicates all address components at the level of PREMISE and broader can be validated. + * Whether a place is reservable. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - get validationGranularity(): google.maps.addressValidation.GranularityString | null; - } - /** - * The various granularities that an address or a geocode can have. When used to indicate granularity for an address, these values indicate with how fine a granularity the address identifies a mailing destination. For example, an address such as "123 Main Street, Redwood City, CA, 94061" identifies a PREMISE while something like "Redwood City, CA, 94061" identifies a LOCALITY. However, if we are unable to find a geocode for "123 Main Street" in Redwood City, the geocode returned might be of LOCALITY granularity even though the address is more granular. - * - * Access by calling `const {Granularity} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum Granularity { + get isReservable(): boolean | null | undefined; /** - * The address or geocode indicates a block. Only used in regions which have block-level addressing, such as Japan. + * The Place’s position. */ - BLOCK = 'BLOCK', + get location(): google.maps.LatLng | null | undefined; /** - * All other granularities, which are bucketed together since they are not deliverable. + * The Place’s phone number, formatted according to the number's regional convention. */ - OTHER = 'OTHER', + get nationalPhoneNumber(): string | null | undefined; /** - * Building-level result. + * The NeighborhoodSummary for this place. */ - PREMISE = 'PREMISE', + get neighborhoodSummary(): google.maps.places.NeighborhoodSummary | null | undefined; /** - * A geocode that approximates the building-level location of the address. + * Options of parking provided by the place. undefined if the parking options data have not been called for from the server. */ - PREMISE_PROXIMITY = 'PREMISE_PROXIMITY', + get parkingOptions(): google.maps.places.ParkingOptions | null | undefined; /** - * The geocode or address is granular to route, such as a street, road, or highway. + * Payment options provided by the place. undefined if the payment options data have not been called for from the server. */ - ROUTE = 'ROUTE', + get paymentOptions(): google.maps.places.PaymentOptions | null | undefined; /** - * Below-building level result, such as an apartment. + * Photos of this Place. The collection will contain up to ten {@link google.maps.places.Photo} objects. */ - SUB_PREMISE = 'SUB_PREMISE', - } - export type GranularityString = `${google.maps.addressValidation.Granularity}`; - /** - * Available only in the v=beta channel: https://goo.gle/3oAthT3. - * Offers an interpretive summary of the API response, intended to assist in determining a potential subsequent action to take. This field is derived from other fields in the API response and should not be considered as a guarantee of address accuracy or deliverability. - * - * Access by calling `const {PossibleNextAction} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum PossibleNextAction { + get photos(): google.maps.places.Photo[] | undefined; + + get plusCode(): google.maps.places.PlusCode | null | undefined; + + get postalAddress(): google.maps.places.PostalAddress | null | undefined; /** - * The API response does not contain signals that warrant one of the other PossibleNextAction values. You might consider using the post-processed address without further prompting your customer, though this does not guarantee the address is valid, and the address might still contain corrections. It is your responsibility to determine if and how to prompt your customer, depending on your own risk assessment. + * The price level of the Place. This property can return any of the following values
  • Free
  • Inexpensive
  • Moderate
  • Expensive
  • Very Expensive
*/ - ACCEPT = 'ACCEPT', + get priceLevel(): google.maps.places.PriceLevelString | null | undefined; /** - * One or more fields of the API response indicate potential minor issues with the post-processed address, for example the postal_code address component was replaced. Prompting your customer to review the address could help improve the quality of the address. + * The price range for this Place. endPrice could be unset, which indicates a range without upper bound (e.g. "More than $100"). */ - CONFIRM = 'CONFIRM', + get priceRange(): google.maps.places.PriceRange | null | undefined; /** - * The API response indicates the post-processed address might be missing a subpremises. Prompting your customer to review the address and consider adding a unit number could help improve the quality of the address. The post-processed address might also have other minor issues. Note: this enum value can only be returned for US addresses. + * The location's primary type. null if there is no type. undefined if the type data has not been loaded from the server. */ - CONFIRM_ADD_SUBPREMISES = 'CONFIRM_ADD_SUBPREMISES', + get primaryType(): string | null | undefined; /** - * One or more fields of the API response indicate a potential issue with the post-processed address, for example the verdict.validation_granularity is OTHER. Prompting your customer to edit the address could help improve the quality of the address. + * The location's primary type display name. null if there is no type. undefined if the type data has not been loaded from the server. */ - FIX = 'FIX', - } - export type PossibleNextActionString = `${google.maps.addressValidation.PossibleNextAction}`; - /** - * Static class for accessing the AddressValidation APIs. - * Access by calling `const {AddressValidation} = await google.maps.importLibrary("addressValidation");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AddressValidation { + get primaryTypeDisplayName(): string | null | undefined; /** - * Information about the address itself as opposed to the geocode. + * The language of the location's primary type display name. null if there is no type. undefined if the type data has not been loaded from the server. */ - get address(): google.maps.addressValidation.Address | null; + get primaryTypeDisplayNameLanguageCode(): string | null | undefined; /** - * Information about the location and place that the address geocoded to. + * A rating, between 1.0 to 5.0, based on user reviews of this Place. */ - get geocode(): google.maps.addressValidation.Geocode | null; + get rating(): number | null | undefined; /** - * Other information relevant to deliverability. metadata is not guaranteed to be fully populated for every address sent to the Address Validation API. + * The regular hours of operation for this place. This does not include exceptional hours like holidays. */ - get metadata(): google.maps.addressValidation.AddressMetadata | null; + get regularOpeningHours(): google.maps.places.OpeningHours | null | undefined; /** - * The UUID that identifies this response. If the address needs to be re-validated, this UUID must accompany the new request. + * The regular secondary hours of this place which excludes exceptional hours like holidays and irregular closures. Secondary hours are different from a place's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. */ - get responseId(): string | null; + get regularSecondaryOpeningHours(): google.maps.places.SecondaryOpeningHours[] | undefined; /** - * Extra deliverability flags provided by USPS. Only provided in region US and PR. + * The requested language for this place. */ - get uspsData(): google.maps.addressValidation.USPSData | null; + requestedLanguage?: string | null; /** - * Overall verdict flags + * The requested region for this place. */ - get verdict(): google.maps.addressValidation.Verdict | null; + requestedRegion?: string | null; /** - * Validates an address. See https://developers.google.com/maps/documentation/javascript/address-validation/validate-address. + * The unique place resource name. */ - static fetchAddressValidation(request: google.maps.addressValidation.AddressValidationRequest): Promise; + get resourceName(): string; /** - * Converts to a plain object. + * A list of reviews for this Place. */ - toJSON(key?: string): unknown; - } -} - -declare namespace google.maps.airQuality { - /** - * AirQualityMeterElement options. - */ - export interface AirQualityMeterElementOptions { + get reviews(): google.maps.places.Review[] | undefined; /** - * See {@link google.maps.airQuality.AirQualityMeterElement.location} + * The ReviewSummary for this place. */ - location?: google.maps.LatLngLiteral | google.maps.LatLng | google.maps.LatLngAltitudeLiteral | google.maps.LatLngAltitude | null; + get reviewSummary(): google.maps.places.ReviewSummary | null | undefined; /** - * See {@link google.maps.airQuality.AirQualityMeterElement.requestedLanguage} + * Whether a place serves beer. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - requestedLanguage?: string | null; - } - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * Displays air quality information for a given location. - * Access by calling `const {AirQualityMeterElement} = await google.maps.importLibrary("airQuality");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class AirQualityMeterElement extends HTMLElement implements google.maps.airQuality.AirQualityMeterElementOptions { + get servesBeer(): boolean | null | undefined; /** - * - * @param options + * Whether a place serves breakfast. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - constructor(options?: google.maps.airQuality.AirQualityMeterElementOptions); + get servesBreakfast(): boolean | null | undefined; /** - * The location to render the air quality meter for. Normalizes to a LatLngAltitude. - * @defaultValue null + * Whether a place serves brunch. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - get location(): google.maps.LatLngAltitude | null; + get servesBrunch(): boolean | null | undefined; + + get servesCocktails(): boolean | null | undefined; + + get servesCoffee(): boolean | null | undefined; + + get servesDessert(): boolean | null | undefined; /** - * The location to render the air quality meter for. Normalizes to a LatLngAltitude. - * @defaultValue null + * Whether a place serves dinner. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - set location(value: google.maps.LatLngLiteral | google.maps.LatLng | google.maps.LatLngAltitudeLiteral | google.maps.LatLngAltitude | null | undefined); + get servesDinner(): boolean | null | undefined; /** - * An override for the language to request from the Air Quality API. See the list of supported languages. - * @defaultValue null + * Whether a place serves lunch. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - requestedLanguage: string | null; - addEventListener(type: K, listener: (this: AirQualityMeterElement, ev: AirQualityMeterElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface AirQualityMeterElementEventMap extends HTMLElementEventMap { - "gmp-error": Event; - "gmp-load": Event; - } -} - -declare namespace google.maps.drawing { - /** - * Allows users to draw markers, polygons, polylines, rectangles, and circles on the map. The DrawingManager's drawing mode defines the type of overlay that will be created by the user. Adds a control to the map, allowing the user to switch drawing mode. - * Access by calling `const {DrawingManager} = await google.maps.importLibrary("drawing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated The DrawingManager functionality in the Maps JavaScript API is no longer available in the Maps JavaScript API as of version 3.65. For more info, see https://developers.google.com/maps/deprecations. - */ - export class DrawingManager extends google.maps.MVCObject { - } - /** - * The types of overlay that may be created by the DrawingManager. Specify these by value, or by using the constant's name. For example, 'polygon' or google.maps.drawing.OverlayType.POLYGON. - * - * Access by calling `const {OverlayType} = await google.maps.importLibrary("drawing");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum OverlayType { + get servesLunch(): boolean | null | undefined; /** - * Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete event is a circle. + * Whether a place serves vegetarian food. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - CIRCLE = 'circle', + get servesVegetarianFood(): boolean | null | undefined; /** - * Specifies that the DrawingManager creates markers, and that the overlay given in the overlaycomplete event is a marker. + * Whether a place serves wine. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. */ - MARKER = 'marker', + get servesWine(): boolean | null | undefined; /** - * Specifies that the DrawingManager creates polygons, and that the overlay given in the overlaycomplete event is a polygon. + * The location’s short address. */ - POLYGON = 'polygon', + get shortFormattedAddress(): string | null | undefined; /** - * Specifies that the DrawingManager creates polylines, and that the overlay given in the overlaycomplete event is a polyline. + * The list of sub-destinations for this place. Sub-destinations are specific places associated with a main place. These provide more specific destinations for users who are searching within a large or complex place, like an airport, national park, university, or stadium. */ - POLYLINE = 'polyline', + get subDestinations(): google.maps.places.Place[] | undefined; /** - * Specifies that the DrawingManager creates rectangles, and that the overlay given in the overlaycomplete event is a rectangle. + * URI to the svg image mask resource that can be used to represent a place’s category. */ - RECTANGLE = 'rectangle', - } - export type OverlayTypeString = `${google.maps.drawing.OverlayType}`; -} - -declare namespace google.maps.marker { - /** - * Options for creating a {@link google.maps.marker.PinElement}. - */ - export interface PinElementOptions { + get svgIconMaskURI(): string | null | undefined; /** - * The background color of the pin shape. Supports any CSS color value. + * The TimeZone for this place. */ - background?: string | null; + get timeZone(): google.maps.places.TimeZone | null | undefined; /** - * The border color of the pin shape. Supports any CSS color value. + * Information about the transit station. undefined if the transit data has not been loaded from the server. */ - borderColor?: string | null; + get transitStation(): google.maps.places.TransitStation | null | undefined; /** - * The color of the glyph. Supports any CSS color value. + * An array of types for this Place (for example, ["political", "locality"] or ["restaurant", "establishment"]). */ - glyphColor?: string | null; + get types(): string[] | undefined; /** - * The source of the glyph image to be displayed in the pin. + * The number of user ratings which contributed to this Place’s {@link google.maps.places.Place.rating}. */ - glyphSrc?: URL | string | null; + get userRatingCount(): number | null | undefined; /** - * The text displayed in the pin. + * The offset from UTC of the Place’s current timezone, in minutes. For example, Austrialian Eastern Standard Time (GMT+10) in daylight savings is 11 hours ahead of UTC, so the utc_offset_minutes will be 660. For timezones behind UTC, the offset is negative. For example, the utc_offset_minutes is -60 for Cape Verde. */ - glyphText?: string | null; + get utcOffsetMinutes(): number | null | undefined; /** - * The scale of the pin. - * @defaultValue 1 + * The preferred viewport when displaying this Place on a map. */ - scale?: number | null; + get viewport(): google.maps.LatLngBounds | null | undefined; /** - * The DOM element displayed in the pin. - * @deprecated Use {@link google.maps.marker.PinElementOptions.glyphText} or {@link google.maps.marker.PinElementOptions.glyphSrc} instead. + * The authoritative website for this Place, such as a business' homepage. */ - glyph?: string | Element | URL | null; - } - /** - * A PinElement represents a DOM element that consists of a shape and a glyph. The shape has the same balloon style as seen in the default {@link google.maps.marker.AdvancedMarkerElement} or {@link google.maps.maps3d.Marker3DElement}. The glyph is an optional DOM element displayed in the balloon shape. A PinElement may have a different aspect ratio depending on its {@link google.maps.marker.PinElement.scale}.

- * Access by calling `const {PinElement} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PinElement extends HTMLElement implements google.maps.marker.PinElementOptions { + get websiteURI(): string | null | undefined; /** - * - * @param options + * @deprecated Use {@link google.maps.places.Place.regularOpeningHours} instead. */ - constructor(options?: google.maps.marker.PinElementOptions); + get openingHours(): google.maps.places.OpeningHours | null | undefined; /** - * The background color of the pin shape. See {@link google.maps.marker.PinElementOptions.background}. + * @deprecated This field was accidentally documented, but has never actually been populated. */ - background?: string | null; + get hasWiFi(): boolean | null | undefined; /** - * The border color of the pin shape. See {@link google.maps.marker.PinElementOptions.borderColor}. + * Text query based place search. */ - borderColor?: string | null; + static searchByText(request: google.maps.places.SearchByTextRequest): Promise<{places: google.maps.places.Place[]}>; /** - * The color of the pin glyph. See {@link google.maps.marker.PinElementOptions.glyphColor}. + * Search for nearby places. */ - glyphColor?: string | null; + static searchNearby(request: google.maps.places.SearchNearbyRequest): Promise<{places: google.maps.places.Place[]}>; + + fetchFields(options: google.maps.places.FetchFieldsRequest): Promise<{place: google.maps.places.Place}>; /** - * The source of the glyph image to be displayed in the pin. See {@link google.maps.marker.PinElementOptions.glyphSrc}. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Calculates the Date for the next opening time using the Place's {@link google.maps.places.Place.regularOpeningHours}. Returns undefined if the data is insufficient to calculate the result, or this place is not operational. */ - glyphSrc?: URL | string | null; + getNextOpeningTime(date?: Date): Promise; /** - * The text displayed in the pin. See {@link google.maps.marker.PinElementOptions.glyphText}. + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Check if the place is open at the given Date. Resolves with undefined if the known data for the location is insufficient to calculate this, e.g. if the opening hours are unregistered. */ - glyphText?: string | null; + isOpen(date?: Date): Promise; /** - * See {@link google.maps.marker.PinElementOptions.scale}. + * Converts to a plain object. */ - scale?: number | null; + toJSON(key?: string): unknown; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a wheelchair icon if the place has an accessible entrance. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>
</gmp-place-content-config>
+ * Access by calling `const {PlaceAccessibleEntranceIconElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceAccessibleEntranceIconElement extends HTMLElement implements google.maps.places.PlaceAccessibleEntranceIconElementOptions { /** - * This field is read-only. The DOM Element backing the view. - * @deprecated Use the PinElement directly. + * + * @param options */ - get element(): HTMLElement; + constructor(options?: google.maps.places.PlaceAccessibleEntranceIconElementOptions); + addEventListener(type: K, listener: (this: PlaceAccessibleEntranceIconElement, ev: PlaceAccessibleEntranceIconElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceAccessibleEntranceIconElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceAccessibleEntranceIconElement. + */ + export interface PlaceAccessibleEntranceIconElementOptions { + } + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's address. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-address></gmp-place-address>
</gmp-place-content-config>
+ * Access by calling `const {PlaceAddressElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceAddressElement extends HTMLElement implements google.maps.places.PlaceAddressElementOptions { /** - * See {@link google.maps.marker.PinElementOptions.glyph}. - * @deprecated Use {@link google.maps.marker.PinElementOptions.glyphText} or {@link google.maps.marker.PinElementOptions.glyphSrc} instead. + * + * @param options */ - glyph?: string | Element | URL | null; + constructor(options?: google.maps.places.PlaceAddressElementOptions); + addEventListener(type: K, listener: (this: PlaceAddressElement, ev: PlaceAddressElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceAddressElementEventMap extends HTMLElementEventMap { } /** - * This event is created from clicking an Advanced Marker. Access the marker's position with event.target.position. - * Access by calling `const {AdvancedMarkerClickEvent} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Options for PlaceAddressElement. */ - export class AdvancedMarkerClickEvent extends Event { + export interface PlaceAddressElementOptions { } /** - * Options for constructing an {@link google.maps.marker.AdvancedMarkerElement}. + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show all available content. Append this element as a child to use it. For example:
 <gmp-place-details>
  <gmp-place-all-content></gmp-place-all-content>
</gmp-place-details>
+ * Access by calling `const {PlaceAllContentElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface AdvancedMarkerElementOptions { + export class PlaceAllContentElement extends HTMLElement implements google.maps.places.PlaceAllContentElementOptions { /** - * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. - * @defaultValue "-50%" + * + * @param options */ - anchorLeft?: string | null; + constructor(options?: google.maps.places.PlaceAllContentElementOptions); + addEventListener(type: K, listener: (this: PlaceAllContentElement, ev: PlaceAllContentElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceAllContentElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceAllContentElement. + */ + export interface PlaceAllContentElementOptions { + } + /** + * Defines information about an aspect of the place that users have reviewed. + * @deprecated This interface is no longer used. + */ + export interface PlaceAspectRating { /** - * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. - * @defaultValue "-100%" + * The rating of this aspect. For individual reviews this is an integer from 0 to 3. For aggregated ratings of a place this is an integer from 0 to 30. */ - anchorTop?: string | null; + rating: number; /** - * An enumeration specifying how an AdvancedMarkerElement should behave when it collides with another AdvancedMarkerElement or with the basemap labels on a vector map.

Note: AdvancedMarkerElement to AdvancedMarkerElement collision works on both raster and vector maps, however, AdvancedMarkerElement to base map's label collision only works on vector maps. + * The aspect type. For example, "food", "decor", "service", or "overall". */ - collisionBehavior?: google.maps.CollisionBehaviorString | null; + type: string; + } + /** + * Allows customization of the Google Maps attribution text in a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement}. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. If this element is omitted, attribution will still be shown with default colors. For example:

 <gmp-place-content-config>
  <gmp-place-attribution
     light-scheme-color="black"
     dark-scheme-color="white"
  ></gmp-place-attribution>
</gmp-place-content-config>
+ * Access by calling `const {PlaceAttributionElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceAttributionElement extends HTMLElement implements google.maps.places.PlaceAttributionElementOptions { /** - * The DOM Element backing the visual of an AdvancedMarkerElement.

Note: AdvancedMarkerElement does not clone the passed-in DOM element. Once the DOM element is passed to an AdvancedMarkerElement, passing the same DOM element to another AdvancedMarkerElement will move the DOM element and cause the previous AdvancedMarkerElement to look empty. - * @defaultValue {@link google.maps.marker.PinElement} + * + * @param options */ - content?: Node | null; + constructor(options?: google.maps.places.PlaceAttributionElementOptions); /** - * If true, the AdvancedMarkerElement will be clickable and trigger the gmp-click event, and will be interactive for accessibility purposes (e.g. allowing keyboard navigation via arrow keys). - * @defaultValue false + * The color of the Google Maps attribution in dark mode. + * @defaultValue AttributionColor.WHITE */ - gmpClickable?: boolean | null; + get darkSchemeColor(): google.maps.places.AttributionColorString; /** - * If true, the AdvancedMarkerElement can be dragged.

Note: AdvancedMarkerElement with altitude is not draggable. - * @defaultValue false + * The color of the Google Maps attribution in dark mode. + * @defaultValue AttributionColor.WHITE */ - gmpDraggable?: boolean | null; + set darkSchemeColor(value: google.maps.places.AttributionColorString | null | undefined); /** - * Map on which to display the AdvancedMarkerElement. The map is required to display the AdvancedMarkerElement and can be provided by setting {@link google.maps.marker.AdvancedMarkerElement.map} if not provided at the construction. + * The color of the Google Maps attribution in light mode. + * @defaultValue AttributionColor.GRAY */ - map?: google.maps.Map | null; + get lightSchemeColor(): google.maps.places.AttributionColorString; /** - * Sets the AdvancedMarkerElement's position. An AdvancedMarkerElement may be constructed without a position, but will not be displayed until its position is provided - for example, by a user's actions or choices. An AdvancedMarkerElement's position can be provided by setting {@link google.maps.marker.AdvancedMarkerElement.position} if not provided at the construction.

Note: AdvancedMarkerElement with altitude is only supported on vector maps. + * The color of the Google Maps attribution in light mode. + * @defaultValue AttributionColor.GRAY */ - position?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + set lightSchemeColor(value: google.maps.places.AttributionColorString | null | undefined); + addEventListener(type: K, listener: (this: PlaceAttributionElement, ev: PlaceAttributionElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceAttributionElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceAttributionElement. + */ + export interface PlaceAttributionElementOptions { /** - * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the AdvancedMarkerElement with the provided value. + * See {@link google.maps.places.PlaceAttributionElement.darkSchemeColor}. */ - title?: string | null; + darkSchemeColor?: google.maps.places.AttributionColorString | null; /** - * All AdvancedMarkerElements are displayed on the map in order of their zIndex, with higher values displaying in front of AdvancedMarkerElements with lower values. By default, AdvancedMarkerElements are displayed according to their vertical position on screen, with lower AdvancedMarkerElements appearing in front of AdvancedMarkerElements farther up the screen. Mixing markers with an explicit zIndex and markers without one can lead to unexpected visual results. To ensure predictable behavior, it is recommended to either set the zIndex for all markers or leave it unset. Note that zIndex is also used to help determine relative priority between {@link google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY} Advanced Markers. A higher zIndex value indicates higher priority. + * See {@link google.maps.places.PlaceAttributionElement.lightSchemeColor}. */ - zIndex?: number | null; + lightSchemeColor?: google.maps.places.AttributionColorString | null; } /** - * Shows a position on a map. Note that the position must be set for the AdvancedMarkerElement to display. - * Access by calling `const {AdvancedMarkerElement} = await google.maps.importLibrary("marker");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * PlaceAutocompleteElement is an HTMLElement subclass which provides a UI component for the Places Autocomplete API.

PlaceAutocompleteElement automatically uses {@link google.maps.places.AutocompleteSessionToken}s internally to group the query and selection phases of a user's autocomplete search.

The first call to {@link google.maps.places.Place.fetchFields} on a {@link google.maps.places.Place} returned by {@link google.maps.places.PlacePrediction.toPlace} will automatically include the session token used to fetch the PlacePrediction.

See https://developers.google.com/maps/documentation/places/web-service/place-session-tokens for more details on how sessions work. + * Access by calling `const {PlaceAutocompleteElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class AdvancedMarkerElement extends HTMLElement implements google.maps.marker.AdvancedMarkerElementOptions { + export class PlaceAutocompleteElement extends HTMLElement implements google.maps.places.PlaceAutocompleteElementOptions { /** - * Creates an AdvancedMarkerElement with the options specified. If a map is specified, the AdvancedMarkerElement is added to the map upon construction. + * * @param options */ - constructor(options?: google.maps.marker.AdvancedMarkerElementOptions); + constructor(options?: google.maps.places.PlaceAutocompleteElementOptions); /** - * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. - * @defaultValue "-50%" + * The description to be used for the input element. This will be detected by screen readers when the input element is focused. See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-describedby for details. */ - anchorLeft?: string | null; + description: string | null; /** - * A CSS length-percentage value which is used to offset the anchor point of the marker from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different than the typical bottom center point of the default marker. - * @defaultValue "-100%" + * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. */ - anchorTop?: string | null; + get disabled(): boolean; /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.collisionBehavior}. + * Whether the input element is disabled. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#disabled for details. */ - collisionBehavior?: google.maps.CollisionBehaviorString | null; + set disabled(value: boolean | null | undefined); + /** + * Whether to include places that are not yet open but are expected to open in the future. + */ + futureOpeningBusinessesIncluded: boolean | null; + /** + * Included primary Place type (for example, "restaurant" or "gas_station").

A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. + */ + includedPrimaryTypes: string[] | null; + /** + * Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both locationRestriction and includedRegionCodes are set, the results will be located in the area of intersection. + */ + includedRegionCodes: string[] | null; + /** + * Identifiers used to attribute calls to specific packages or OSS libraries. + */ + get internalUsageAttributionIds(): string[] | null; + /** + * Identifiers used to attribute calls to specific packages or OSS libraries. + */ + set internalUsageAttributionIds(value: Iterable | null | undefined); /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.gmpClickable}. + * A soft boundary or hint to use when searching for places. */ - gmpClickable?: boolean | null; + locationBias: google.maps.places.LocationBias | null; /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.gmpDraggable}. + * Bounds to constrain search results. */ - gmpDraggable?: boolean | null; + locationRestriction: google.maps.places.LocationRestriction | null; /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.map}. + * The maximum number of characters that the user can enter. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength for details. */ - map?: google.maps.Map | null; + maxlength: number | null; /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.position}. + * The name to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name for details. Follows the same behavior as the name attribute for inputs. Note that this is the name that will be used when a form is submitted. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form for details. */ - position?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + name: string | null; /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.title}. + * Whether to hide the clear button. */ - title: string; + get noClearButton(): boolean; /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.zIndex}. + * Whether to hide the clear button. */ - zIndex?: number | null; + set noClearButton(value: boolean | null | undefined); /** - * This field is read-only. The DOM Element backing the view. - * @deprecated Use the AdvancedMarkerElement directly. + * Whether to hide the input icon. */ - get element(): HTMLElement; + get noInputIcon(): boolean; /** - * See {@link google.maps.marker.AdvancedMarkerElementOptions.content}. - * @deprecated Use .children instead. + * Whether to hide the input icon. */ - content?: Node | null; + set noInputIcon(value: boolean | null | undefined); /** - * Adds the given listener function to the given event name in the Maps Eventing system. + * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. */ - addListener(eventName: string, handler: Function): google.maps.MapsEventListener; - addEventListener(type: K, listener: (this: AdvancedMarkerElement, ev: AdvancedMarkerElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface AdvancedMarkerElementEventMap extends HTMLElementEventMap { - "gmp-click": google.maps.marker.AdvancedMarkerClickEvent; - } -} - -declare namespace google.maps.maps3d { - /** - * Specifies how altitude components in the coordinates are interpreted. - * - * Access by calling `const {AltitudeMode} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum AltitudeMode { + get origin(): google.maps.LatLngAltitude | null; /** - * Allows to express objects relative to the average mean sea level. That also means that if the terrain level of detail changes underneath the object, its absolute position will remain the same. + * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation. */ - ABSOLUTE = 'ABSOLUTE', + set origin(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); /** - * Allows to express objects placed on the ground. They will remain at ground level following the terrain regardless of what altitude is provided. If the object is positioned over a major body of water, it will be placed at sea level. + * The placeholder text to be used for the input element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder for details. */ - CLAMP_TO_GROUND = 'CLAMP_TO_GROUND', + placeholder: string | null; /** - * Allows to express objects relative to the ground surface. If the terrain level of detail changes, the position of the object will remain constant relative to the ground. When over water, the altitude will be interpreted as a value in meters above sea level. + * Whether to include places that are pure service area businesses. */ - RELATIVE_TO_GROUND = 'RELATIVE_TO_GROUND', + pureServiceAreaBusinessesIncluded: boolean | null; /** - * Allows to express objects relative to the highest of ground+building+water surface. When over water, this will be water surface; when over terrain, this will be the building surface (if present) or ground surface (if no buildings). + * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. */ - RELATIVE_TO_MESH = 'RELATIVE_TO_MESH', - } - export type AltitudeModeString = `${google.maps.maps3d.AltitudeMode}`; - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * CirclePathElementOptions object used to define the properties that can be set on a CirclePathElement. - */ - export interface CirclePathElementOptions { + get readonly(): boolean; /** - * See {@link google.maps.maps3d.CirclePathElement.center}. + * Whether the input element is read-only. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly for details. */ - center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; + set readonly(value: boolean | null | undefined); /** - * See {@link google.maps.maps3d.CirclePathElement.radius}. + * A language identifier for the language in which the results should be returned, if possible. Results in the selected language may be given a higher ranking, but suggestions are not restricted to this language. See the list of supported languages. */ - radius?: number | null; - } - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * A 3D circle overlay on a 3D map. - * Access by calling `const {CirclePathElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class CirclePathElement extends HTMLElement implements google.maps.maps3d.CirclePathElementOptions { + requestedLanguage: string | null; /** - * Creates a CirclePathElement with the options specified. - * @param options + * A region code which is used for result formatting and for result filtering. It does not restrict the suggestions to this country. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - constructor(options?: google.maps.maps3d.CirclePathElementOptions); + requestedRegion: string | null; /** - * The center of the circle. + * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. */ - get center(): google.maps.LatLngAltitude | null; + get unitSystem(): google.maps.UnitSystem | null; /** - * The center of the circle. + * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion. */ - set center(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined); + set unitSystem(value: google.maps.UnitSystem | null | undefined); /** - * The radius of the circle in meters. + * The value of the input element. */ - get radius(): number | null; + get value(): string; /** - * The radius of the circle in meters. + * The value of the input element. */ - set radius(value: number | null | undefined); - addEventListener(type: K, listener: (this: CirclePathElement, ev: CirclePathElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + set value(value: string | null); + addEventListener(type: K, listener: (this: PlaceAutocompleteElement, ev: PlaceAutocompleteElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface CirclePathElementEventMap extends HTMLElementEventMap { + export interface PlaceAutocompleteElementEventMap extends HTMLElementEventMap { + "gmp-error": Event; + "gmp-select": google.maps.places.PlacePredictionSelectEvent; } /** - * Specifies a mode the map should be rendered in. - * - * Access by calling `const {MapMode} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Options for constructing a PlaceAutocompleteElement. For the description of each property, refer to the property of the same name in the PlaceAutocompleteElement class. */ - export enum MapMode { - /** - * This map mode displays a transparent layer of major streets on satellite, or photorealistic imagery. - */ - HYBRID = 'HYBRID', + export interface PlaceAutocompleteElementOptions { /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * This map mode displays a normal street map. + * The description to be used for the input element. This will be detected by screen readers when the input element is focused. */ - ROADMAP = 'ROADMAP', + description?: string | null; + + disabled?: boolean | null; + + futureOpeningBusinessesIncluded?: boolean | null; + + includedPrimaryTypes?: string[] | null; + + includedRegionCodes?: string[] | null; + + internalUsageAttributionIds?: Iterable | null; + + locationBias?: google.maps.places.LocationBias | null; + + locationRestriction?: google.maps.places.LocationRestriction | null; + + maxlength?: number | null; + + name?: string | null; + + noClearButton?: boolean | null; + + noInputIcon?: boolean | null; + + origin?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + + placeholder?: string | null; + + pureServiceAreaBusinessesIncluded?: boolean | null; + + readonly?: boolean | null; + + requestedLanguage?: string | null; + + requestedRegion?: string | null; + + unitSystem?: google.maps.UnitSystem | null; /** - * This map mode displays satellite, or photorealistic imagery where available. + * The value of the input element. */ - SATELLITE = 'SATELLITE', + value?: string | null; } - export type MapModeString = `${google.maps.maps3d.MapMode}`; /** - * FlattenerElementOptions object used to define the properties that can be set on a FlattenerElement. + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement} or {@link google.maps.places.PlaceSearchElement} to show a custom set of content. Append this element as a child to use it.

For {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement} or {@link google.maps.places.PlaceSearchElement}, append any of the following elements to the {@link google.maps.places.PlaceContentConfigElement} to show the corresponding content:
{@link google.maps.places.PlaceAddressElement}, {@link google.maps.places.PlaceAccessibleEntranceIconElement}, {@link google.maps.places.PlaceAttributionElement} {@link google.maps.places.PlaceMediaElement}, {@link google.maps.places.PlaceOpenNowStatusElement}, {@link google.maps.places.PlacePriceElement}, {@link google.maps.places.PlaceRatingElement}, {@link google.maps.places.PlaceTypeElement}.

Specific to {@link google.maps.places.PlaceDetailsElement}, you may also append any of the following elements:
{@link google.maps.places.PlaceFeatureListElement} {@link google.maps.places.PlaceOpeningHoursElement}, {@link google.maps.places.PlacePhoneNumberElement}, {@link google.maps.places.PlacePlusCodeElement}, {@link google.maps.places.PlaceReviewSummaryElement}, {@link google.maps.places.PlaceReviewsElement}, {@link google.maps.places.PlaceSummaryElement}, {@link google.maps.places.PlaceTypeSpecificHighlightsElement}, {@link google.maps.places.PlaceWebsiteElement}.

The order of the children does not matter; the element renders content in a standard order which is not customizable. Example:

 <gmp-place-details>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
    <gmp-place-address></gmp-place-address>
  </gmp-place-content-config>
</gmp-place-details>
+ * Access by calling `const {PlaceContentConfigElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface FlattenerElementOptions { - /** - * See {@link google.maps.maps3d.FlattenerElement.innerPaths}. - */ - innerPaths?: Iterable> | null; + export class PlaceContentConfigElement extends HTMLElement implements google.maps.places.PlaceContentConfigElementOptions { /** - * See {@link google.maps.maps3d.FlattenerElement.path}. + * + * @param options */ - path?: Iterable | null; + constructor(options?: google.maps.places.PlaceContentConfigElementOptions); + addEventListener(type: K, listener: (this: PlaceContentConfigElement, ev: PlaceContentConfigElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceContentConfigElementEventMap extends HTMLElementEventMap { } /** - * A flattener element is used to flatten a specified area on the map. - * Access by calling `const {FlattenerElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Options for PlaceContentConfigElement. */ - export class FlattenerElement extends HTMLElement implements google.maps.maps3d.FlattenerElementOptions { + export interface PlaceContentConfigElementOptions { + } + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * A widget that uses the context token to display a contextual view of the Grounding with Google Maps response. + * Access by calling `const {PlaceContextualElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceContextualElement extends HTMLElement implements google.maps.places.PlaceContextualElementOptions { /** * * @param options */ - constructor(options?: google.maps.maps3d.FlattenerElementOptions); - /** - * The ordered sequence of coordinates that designates a closed loop. These paths define Exclusion Holes within the polygon's main path, which is the Flattening Zone. Areas within an innerPath are exempt from flattening. - */ - get innerPaths(): google.maps.LatLngAltitude[][] | null; - /** - * The ordered sequence of coordinates that designates a closed loop. These paths define Exclusion Holes within the polygon's main path, which is the Flattening Zone. Areas within an innerPath are exempt from flattening. - */ - set innerPaths(value: Iterable> | null | undefined); + constructor(options?: google.maps.places.PlaceContextualElementOptions); /** - * The ordered sequence of coordinates that designates a closed loop. This loop defines the Flattening Zone. + * The context token. */ - get path(): google.maps.LatLngAltitude[] | null; + get contextToken(): string | undefined; /** - * The ordered sequence of coordinates that designates a closed loop. This loop defines the Flattening Zone. + * The context token. */ - set path(value: Iterable | null | undefined); - addEventListener(type: K, listener: (this: FlattenerElement, ev: FlattenerElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + set contextToken(value: string | null | undefined); + addEventListener(type: K, listener: (this: PlaceContextualElement, ev: PlaceContextualElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface FlattenerElementEventMap extends HTMLElementEventMap { + export interface PlaceContextualElementEventMap extends HTMLElementEventMap { } /** - * Marker3DElementOptions object used to define the properties that can be set on a Marker3DElement. + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Options for PlaceContextualElement. */ - export interface Marker3DElementOptions { + export interface PlaceContextualElementOptions { /** - * See {@link google.maps.maps3d.Marker3DElement.altitudeMode}. + * The context token provided by the Grounding with Google Maps response. */ - altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + contextToken?: string | null; + } + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * An HTML element that configures options for the Place Contextual Element's list view. + * Access by calling `const {PlaceContextualListConfigElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceContextualListConfigElement extends HTMLElement implements google.maps.places.PlaceContextualListConfigElementOptions { /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * See {@link google.maps.maps3d.Marker3DElement.autofitsCamera}. + * + * @param options */ - autofitsCamera?: boolean | null; + constructor(options?: google.maps.places.PlaceContextualListConfigElementOptions); /** - * See {@link google.maps.maps3d.Marker3DElement.collisionBehavior}. + * The layout. */ - collisionBehavior?: google.maps.CollisionBehaviorString | null; + get layout(): google.maps.places.PlaceContextualListLayoutString; /** - * See {@link google.maps.maps3d.Marker3DElement.collisionPriority}. + * The layout. */ - collisionPriority?: number | null; + set layout(value: google.maps.places.PlaceContextualListLayoutString | null | undefined); /** - * See {@link google.maps.maps3d.Marker3DElement.drawsWhenOccluded}. + * Whether the map is hidden. */ - drawsWhenOccluded?: boolean | null; + get mapHidden(): boolean; /** - * See {@link google.maps.maps3d.Marker3DElement.extruded}. + * Whether the map is hidden. */ - extruded?: boolean | null; + set mapHidden(value: boolean | null | undefined); + addEventListener(type: K, listener: (this: PlaceContextualListConfigElement, ev: PlaceContextualListConfigElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceContextualListConfigElementEventMap extends HTMLElementEventMap { + } + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Options for PlaceContextualListConfigElement. + */ + export interface PlaceContextualListConfigElementOptions { /** - * See {@link google.maps.maps3d.Marker3DElement.label}. + * The layout. + * @defaultValue {@link google.maps.places.PlaceContextualListLayout.VERTICAL} */ - label?: string | null; + layout?: google.maps.places.PlaceContextualListLayoutString | null; /** - * See {@link google.maps.maps3d.Marker3DElement.position}. + * True if the map should be hidden. + * @defaultValue false */ - position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + mapHidden?: boolean | null; + } + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * The list of layouts that the Place Contextual Element supports for the list view. + * + * Access by calling `const {PlaceContextualListLayout} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum PlaceContextualListLayout { /** - * See {@link google.maps.maps3d.Marker3DElement.sizePreserved}. + * Compact list layout: list items are rendered as links across a single line, with overflows in a dropdown list. */ - sizePreserved?: boolean | null; + COMPACT = 'COMPACT', /** - * See {@link google.maps.maps3d.Marker3DElement.zIndex}. + * Vertical list layout: list items are rendered as cards in a vertical list. */ - zIndex?: number | null; + VERTICAL = 'VERTICAL', } + export type PlaceContextualListLayoutString = `${google.maps.places.PlaceContextualListLayout}`; /** - * Shows a position on a 3D map. Note that the position must be set for the Marker3DElement to display. - * Access by calling `const {Marker3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Displays details for a place in a compact layout. Append a {@link google.maps.places.PlaceDetailsPlaceRequestElement} or {@link google.maps.places.PlaceDetailsLocationRequestElement} to specify the place to be rendered. Append a {@link google.maps.places.PlaceContentConfigElement}, {@link google.maps.places.PlaceStandardContentElement}, or {@link google.maps.places.PlaceAllContentElement} to specify which content to render.

Example:
 <gmp-place-details-compact>
  <gmp-place-details-place-request
    place="PLACE_ID"
  ></gmp-place-details-place-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-details-compact>

To use this element, enable the Places UI Kit API for your project in the Google Cloud console. + * Access by calling `const {PlaceDetailsCompactElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Marker3DElement extends HTMLElement implements google.maps.maps3d.Marker3DElementOptions { + export class PlaceDetailsCompactElement extends HTMLElement implements google.maps.places.PlaceDetailsCompactElementOptions { /** - * Creates an Marker3DElement with the options specified. + * * @param options */ - constructor(options?: google.maps.maps3d.Marker3DElementOptions); + constructor(options?: google.maps.places.PlaceDetailsCompactElementOptions); /** - * Specifies how the altitude component of the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - get altitudeMode(): google.maps.maps3d.AltitudeModeString; + get internalUsageAttributionIds(): string[] | null; /** - * Specifies how the altitude component of the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + set internalUsageAttributionIds(value: Iterable | null | undefined); /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * If provided, the specified marker will be made visible within the map viewport, alongside any other elements that have opted in. + * The orientation variant (vertical or horizontal) of the element. + * @defaultValue PlaceDetailsOrientation.VERTICAL + */ + orientation?: google.maps.places.PlaceDetailsOrientationString | null; + /** + * Read only. Place object containing the ID, location, and viewport of the currently rendered place. + */ + get place(): google.maps.places.Place | undefined; + /** + * If true, truncates the place name and address to fit on one line instead of wrapping. * @defaultValue false */ - get autofitsCamera(): boolean; + get truncationPreferred(): boolean; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * If provided, the specified marker will be made visible within the map viewport, alongside any other elements that have opted in. + * If true, truncates the place name and address to fit on one line instead of wrapping. * @defaultValue false */ - set autofitsCamera(value: boolean | null | undefined); + set truncationPreferred(value: boolean | null | undefined); + addEventListener(type: K, listener: (this: PlaceDetailsCompactElement, ev: PlaceDetailsCompactElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceDetailsCompactElementEventMap extends HTMLElementEventMap { + "gmp-error": Event; + "gmp-load": Event; + } + /** + * Options for PlaceDetailsCompactElement. + */ + export interface PlaceDetailsCompactElementOptions { /** - * An enumeration specifying how a Marker3DElement should behave when it collides with another Marker3DElement or with the basemap labels. - * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - get collisionBehavior(): google.maps.CollisionBehaviorString; + internalUsageAttributionIds?: Iterable | null; /** - * An enumeration specifying how a Marker3DElement should behave when it collides with another Marker3DElement or with the basemap labels. - * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} + * See {@link google.maps.places.PlaceDetailsCompactElement.orientation}. */ - set collisionBehavior(value: google.maps.CollisionBehaviorString | null | undefined); + orientation?: google.maps.places.PlaceDetailsOrientationString | null; /** - * The collision priority used for collision detection. + * See {@link google.maps.places.PlaceDetailsCompactElement.truncationPreferred}. */ - get collisionPriority(): number | null; + truncationPreferred?: boolean | null; + } + /** + * Displays details for a place in a full layout. Append either a {@link google.maps.places.PlaceDetailsPlaceRequestElement} or {@link google.maps.places.PlaceDetailsLocationRequestElement} to specify the place to be rendered. Append a {@link google.maps.places.PlaceContentConfigElement}, {@link google.maps.places.PlaceStandardContentElement}, or {@link google.maps.places.PlaceAllContentElement} to specify which content to render.

Example:
 <gmp-place-details>
  <gmp-place-details-place-request
    place="PLACE_ID"
  ></gmp-place-details-place-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-details>

To use this element, enable the Places UI Kit API for your project in the Google Cloud console. + * Access by calling `const {PlaceDetailsElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceDetailsElement extends HTMLElement implements google.maps.places.PlaceDetailsElementOptions { /** - * The collision priority used for collision detection. + * + * @param options */ - set collisionPriority(value: number | null | undefined); + constructor(options?: google.maps.places.PlaceDetailsElementOptions); /** - * Specifies whether this marker should be drawn or not when it's occluded. The marker can be occluded by map geometry (e.g. buildings). - * @defaultValue false + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - get drawsWhenOccluded(): boolean; + get internalUsageAttributionIds(): string[] | null; /** - * Specifies whether this marker should be drawn or not when it's occluded. The marker can be occluded by map geometry (e.g. buildings). - * @defaultValue false + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - set drawsWhenOccluded(value: boolean | null | undefined); + set internalUsageAttributionIds(value: Iterable | null | undefined); /** - * Specifies whether to connect the marker to the ground. To extrude a marker, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. - * @defaultValue false + * Read only. Place object containing the ID, location, and viewport of the currently rendered place. */ - get extruded(): boolean; + get place(): google.maps.places.Place | undefined; + addEventListener(type: K, listener: (this: PlaceDetailsElement, ev: PlaceDetailsElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceDetailsElementEventMap extends HTMLElementEventMap { + "gmp-error": Event; + "gmp-load": Event; + } + /** + * Options for PlaceDetailsElement. + */ + export interface PlaceDetailsElementOptions { /** - * Specifies whether to connect the marker to the ground. To extrude a marker, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. - * @defaultValue false + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - set extruded(value: boolean | null | undefined); + internalUsageAttributionIds?: Iterable | null; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data based on a location. Append this element as a child of a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data for the specified location. For example:
 <gmp-place-details>
  <gmp-place-details-location-request
    location="37.6207665,-122.4284806"
  ></gmp-place-details-location-request>
</gmp-place-details>
+ * Access by calling `const {PlaceDetailsLocationRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceDetailsLocationRequestElement extends HTMLElement implements google.maps.places.PlaceDetailsLocationRequestElementOptions { /** - * Text to be displayed by this marker. + * + * @param options */ - get label(): string | null; + constructor(options?: google.maps.places.PlaceDetailsLocationRequestElementOptions); /** - * Text to be displayed by this marker. + * The location to render details for in the Place Details element. Normalizes to a LatLngAltitude. + * @defaultValue null */ - set label(value: string | null | undefined); + get location(): google.maps.LatLngAltitude | null; /** - * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. + * The location to render details for in the Place Details element. Normalizes to a LatLngAltitude. + * @defaultValue null */ - get position(): google.maps.LatLngAltitude | null; + set location(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + addEventListener(type: K, listener: (this: PlaceDetailsLocationRequestElement, ev: PlaceDetailsLocationRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceDetailsLocationRequestElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceDetailsLocationRequestElement. + */ + export interface PlaceDetailsLocationRequestElementOptions { /** - * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. + * The location to render the place for. */ - set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + location?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + } + /** + * Orientation variants for {@link google.maps.places.PlaceDetailsCompactElement}. + * + * Access by calling `const {PlaceDetailsOrientation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum PlaceDetailsOrientation { /** - * Specifies whether this marker should preserve its size or not regardless of distance from camera. By default, the marker is scaled based on distance from camera/tilt. - * @defaultValue false + * Horizontal orientation. */ - get sizePreserved(): boolean; + HORIZONTAL = 'HORIZONTAL', /** - * Specifies whether this marker should preserve its size or not regardless of distance from camera. By default, the marker is scaled based on distance from camera/tilt. - * @defaultValue false + * Vertical orientation. */ - set sizePreserved(value: boolean | null | undefined); + VERTICAL = 'VERTICAL', + } + export type PlaceDetailsOrientationString = `${google.maps.places.PlaceDetailsOrientation}`; + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data based on a place object, ID, or resource name. Append this element as a child of a {@link google.maps.places.PlaceDetailsCompactElement} or {@link google.maps.places.PlaceDetailsElement} to load data for the specified place. For example:
 <gmp-place-details>
  <gmp-place-details-place-request
    place="PLACE_ID"
  ></gmp-place-details-place-request>
</gmp-place-details>
+ * Access by calling `const {PlaceDetailsPlaceRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceDetailsPlaceRequestElement extends HTMLElement implements google.maps.places.PlaceDetailsPlaceRequestElementOptions { /** - * The zIndex compared to other markers. + * + * @param options */ - get zIndex(): number | null; + constructor(options?: google.maps.places.PlaceDetailsPlaceRequestElementOptions); /** - * The zIndex compared to other markers. + * The place object, ID, or resource name to render details for in the Place Details Compact element. This property reflects to the attribute as a resource name. + * @defaultValue null */ - set zIndex(value: number | null | undefined); - addEventListener(type: K, listener: (this: Marker3DElement, ev: Marker3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + get place(): google.maps.places.Place | null; + /** + * The place object, ID, or resource name to render details for in the Place Details Compact element. This property reflects to the attribute as a resource name. + * @defaultValue null + */ + set place(value: google.maps.places.Place | string | null | undefined); + addEventListener(type: K, listener: (this: PlaceDetailsPlaceRequestElement, ev: PlaceDetailsPlaceRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface Marker3DElementEventMap extends HTMLElementEventMap { + export interface PlaceDetailsPlaceRequestElementEventMap extends HTMLElementEventMap { } /** - * This event is created from clicking a Map3DElement. - * Access by calling `const {LocationClickEvent} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Options for PlaceDetailsPlaceRequestElement. */ - export class LocationClickEvent extends Event { + export interface PlaceDetailsPlaceRequestElementOptions { /** - * The latitude/longitude/altitude that was below the cursor when the event occurred. Please note, that at coarser levels, less accurate data will be returned. Also, sea floor elevation may be returned for the altitude value when clicking at the water surface from higher camera positions. This event bubbles up through the DOM tree. + * See {@link google.maps.places.PlaceDetailsPlaceRequestElement.place} */ - position: google.maps.LatLngAltitude | null; + place?: google.maps.places.Place | string | null; } /** - * This event is created from monitoring a steady state of Map3DElement. This event bubbles up through the DOM tree. - * Access by calling `const {SteadyChangeEvent} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A Place details query to be sent to the PlacesService. */ - export class SteadyChangeEvent extends Event { + export interface PlaceDetailsRequest { /** - * Indicates whether Map3DElement is steady (i.e. all rendering for the current scene has completed) or not. + * Fields to be included in the details response, which will be billed for. If no fields are specified or ['ALL'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). For a list of fields see {@link google.maps.places.PlaceResult}. Nested fields can be specified with dot-paths (for example, "geometry.location"). */ - isSteady: boolean; - } - /** - * Shows a position on a 3D map. Note that the position must be set for the Marker3DInteractiveElement to display. Unlike Marker3DElement, Marker3DInteractiveElement receives a gmp-click event. - * Access by calling `const {Marker3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Marker3DInteractiveElement extends google.maps.maps3d.Marker3DElement implements google.maps.maps3d.Marker3DInteractiveElementOptions { + fields?: string[]; /** - * Creates an Marker3DInteractiveElement with the options specified. - * @param options + * A language identifier for the language in which details should be returned. See the list of supported languages. */ - constructor(options?: google.maps.maps3d.Marker3DInteractiveElementOptions); + language?: string | null; /** - * When set, the popover element will be open on this marker's click. + * The Place ID of the Place for which details are being requested. */ - get gmpPopoverTargetElement(): google.maps.maps3d.PopoverElement | null; + placeId: string; /** - * When set, the popover element will be open on this marker's click. + * A region code of the user's region. This can affect which photos may be returned, and possibly other things. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - set gmpPopoverTargetElement(value: google.maps.maps3d.PopoverElement | null | undefined); + region?: string | null; /** - * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the Marker3DInteractiveElement with the provided value. + * Unique reference used to bundle the details request with an autocomplete session. */ - title: string; - addEventListener(type: K, listener: (this: Marker3DInteractiveElement, ev: Marker3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + sessionToken?: google.maps.places.AutocompleteSessionToken; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's feature list in the "About" tab. Feature list can include accessibility options, amenities, accepted payment methods, and more. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-feature-list></gmp-place-feature-list>
</gmp-place-content-config>
+ * Access by calling `const {PlaceFeatureListElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceFeatureListElement extends HTMLElement implements google.maps.places.PlaceFeatureListElementOptions { + addEventListener(type: K, listener: (this: PlaceFeatureListElement, ev: PlaceFeatureListElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface Marker3DInteractiveElementEventMap extends google.maps.maps3d.Marker3DElementEventMap { - "gmp-click": google.maps.maps3d.LocationClickEvent; + export interface PlaceFeatureListElementEventMap extends HTMLElementEventMap { } /** - * Marker3DInteractiveElementOptions object used to define the properties that can be set on a Marker3DInteractiveElement. + * Options for PlaceFeatureListElement. */ - export interface Marker3DInteractiveElementOptions extends google.maps.maps3d.Marker3DElementOptions { + export interface PlaceFeatureListElementOptions { + } + /** + * Defines information about the geometry of a Place. + */ + export interface PlaceGeometry { /** - * See {@link google.maps.maps3d.Marker3DInteractiveElement.gmpPopoverTargetElement}. + * The Place’s position. */ - gmpPopoverTargetElement?: google.maps.maps3d.PopoverElement | null; + location?: google.maps.LatLng; /** - * See {@link google.maps.maps3d.Marker3DInteractiveElement.title}. + * The preferred viewport when displaying this Place on a map. This property will be null if the preferred viewport for the Place is not known. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - title?: string; + viewport?: google.maps.LatLngBounds; } /** - * MarkerElementOptions object used to define the properties that can be set on a MarkerElement. + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's media, such as photos. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-media lightbox-preferred></gmp-place-media>
</gmp-place-content-config>
+ * Access by calling `const {PlaceMediaElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface MarkerElementOptions { - /** - * See {@link google.maps.maps3d.MarkerElement.altitudeMode}. - */ - altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + export class PlaceMediaElement extends HTMLElement implements google.maps.places.PlaceMediaElementOptions { /** - * See {@link google.maps.maps3d.MarkerElement.anchorLeft}. + * + * @param options */ - anchorLeft?: string | null; + constructor(options?: google.maps.places.PlaceMediaElementOptions); /** - * See {@link google.maps.maps3d.MarkerElement.anchorTop}. + * Whether to enable or disable the media lightbox, in cases where both options are supported. + * @defaultValue false */ - anchorTop?: string | null; + get lightboxPreferred(): boolean; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * See {@link google.maps.maps3d.MarkerElement.autofitsCamera}. + * Whether to enable or disable the media lightbox, in cases where both options are supported. + * @defaultValue false */ - autofitsCamera?: boolean | null; + set lightboxPreferred(value: boolean | null | undefined); /** - * See {@link google.maps.maps3d.MarkerElement.collisionBehavior}. + * The preferred media size in cases where multiple sizes are supported, such as the vertical {@link google.maps.places.PlaceSearchElement}. The vertical PlaceSearchElement will use MediaSize.SMALL by default if this is not specified. + * @defaultValue null */ - collisionBehavior?: google.maps.CollisionBehaviorString | null; + get preferredSize(): google.maps.places.MediaSizeString | null; /** - * See {@link google.maps.maps3d.MarkerElement.collisionPriority}. + * The preferred media size in cases where multiple sizes are supported, such as the vertical {@link google.maps.places.PlaceSearchElement}. The vertical PlaceSearchElement will use MediaSize.SMALL by default if this is not specified. + * @defaultValue null */ - collisionPriority?: number | null; + set preferredSize(value: google.maps.places.MediaSizeString | null | undefined); + addEventListener(type: K, listener: (this: PlaceMediaElement, ev: PlaceMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceMediaElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceMediaElement. + */ + export interface PlaceMediaElementOptions { /** - * See {@link google.maps.maps3d.MarkerElement.position}. + * See {@link google.maps.places.PlaceMediaElement.lightboxPreferred}. */ - position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + lightboxPreferred?: boolean | null; /** - * See {@link google.maps.maps3d.MarkerElement.title}. + * See {@link google.maps.places.PlaceMediaElement.preferredSize}. */ - title?: string; + preferredSize?: google.maps.places.MediaSizeString | null; } /** - * Shows a position on a 3D map. Note that the position must be set for the MarkerElement to display.

MarkerElement supports high customization via custom HTML elements, but has lower interaction performance than Marker3DElement, especially when handling more than 1000 markers on a map. - * Access by calling `const {MarkerElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Configures a {@link google.maps.places.PlaceSearchElement} to load results based on a nearby search request. The locationRestriction property is required for the search element to load. Any other configured properties will be ignored if locationRestriction is not set. Append this element as a child of a {@link google.maps.places.PlaceSearchElement} to load results. For example:
 <gmp-place-search>
  <gmp-place-nearby-search-request
    location-restriction="RADIUS@LAT,LNG"
  ></gmp-place-nearby-search-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-search>
+ * Access by calling `const {PlaceNearbySearchRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class MarkerElement extends HTMLElement implements google.maps.maps3d.MarkerElementOptions { + export class PlaceNearbySearchRequestElement extends HTMLElement implements google.maps.places.PlaceNearbySearchRequestElementOptions { /** - * Creates an MarkerElement with the options specified. + * * @param options */ - constructor(options?: google.maps.maps3d.MarkerElementOptions); - /** - * Specifies how the altitude component of the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} - */ - get altitudeMode(): google.maps.maps3d.AltitudeModeString; + constructor(options?: google.maps.places.PlaceNearbySearchRequestElementOptions); /** - * Specifies how the altitude component of the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * Excluded primary place types. + * @defaultValue null */ - set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + get excludedPrimaryTypes(): string[] | null; /** - * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. - * @defaultValue -50% + * Excluded primary place types. + * @defaultValue null */ - get anchorLeft(): string; + set excludedPrimaryTypes(value: string[] | null | undefined); /** - * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. - * @defaultValue -50% + * Excluded place types. + * @defaultValue null */ - set anchorLeft(value: string | null | undefined); + get excludedTypes(): string[] | null; /** - * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. - * @defaultValue -100% + * Excluded place types. + * @defaultValue null */ - get anchorTop(): string; + set excludedTypes(value: string[] | null | undefined); /** - * A CSS length-percentage value which is used to offset the anchor point from the top left corner of the marker. This is useful when using a visual which has an anchor point that is different from the typical bottom center point of the default marker. - * @defaultValue -100% + * Include place predictions for businesses that are not yet open but are expected to open in the future. */ - set anchorTop(value: string | null | undefined); + get futureOpeningBusinessesIncluded(): boolean | null; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * If provided, the specified marker will be made visible within the map viewport, alongside any other elements that have opted in. - * @defaultValue false + * Include place predictions for businesses that are not yet open but are expected to open in the future. */ - autofitsCamera?: boolean | null; + set futureOpeningBusinessesIncluded(value: boolean | null | undefined); /** - * An enumeration specifying how a MarkerElement should behave when it collides with another MarkerElement, Marker3DElement, or with the basemap labels. - * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} + * Included primary place type. + * @defaultValue null */ - get collisionBehavior(): google.maps.CollisionBehaviorString; + get includedPrimaryTypes(): string[] | null; /** - * An enumeration specifying how a MarkerElement should behave when it collides with another MarkerElement, Marker3DElement, or with the basemap labels. - * @defaultValue {@link google.maps.CollisionBehavior.REQUIRED} + * Included primary place type. + * @defaultValue null */ - set collisionBehavior(value: google.maps.CollisionBehaviorString | null | undefined); + set includedPrimaryTypes(value: string[] | null | undefined); /** - * A number which is used to help determine relative priority between {@link google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY} markers (including {@link google.maps.maps3d.Marker3DElement} ). A higher collisionPriority value indicates higher priority. + * Included place type. + * @defaultValue null */ - get collisionPriority(): number | null; + get includedTypes(): string[] | null; /** - * A number which is used to help determine relative priority between {@link google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY} markers (including {@link google.maps.maps3d.Marker3DElement} ). A higher collisionPriority value indicates higher priority. + * Included place type. + * @defaultValue null */ - set collisionPriority(value: number | null | undefined); + set includedTypes(value: string[] | null | undefined); /** - * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. + * The region to search. Normalizes to a Circle. + * @defaultValue null */ - get position(): google.maps.LatLngAltitude | null; + get locationRestriction(): google.maps.Circle | null; /** - * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional. + * The region to search. Normalizes to a Circle. + * @defaultValue null */ - set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + set locationRestriction(value: google.maps.Circle | google.maps.CircleLiteral | null | undefined); /** - * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the MarkerElement with the provided value. + * Maximum number of results to return. + * @defaultValue null */ - title: string; - addEventListener(type: K, listener: (this: MarkerElement, ev: MarkerElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface MarkerElementEventMap extends HTMLElementEventMap { - } - /** - * Shows a position on a 3D map. Note that the position must be set for the MarkerInteractiveElement to display. Unlike MarkerElement, MarkerInteractiveElement receives a gmp-click event. - * Access by calling `const {MarkerInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class MarkerInteractiveElement extends google.maps.maps3d.MarkerElement implements google.maps.maps3d.MarkerInteractiveElementOptions { + get maxResultCount(): number | null; /** - * Creates a MarkerInteractiveElement with the options specified. - * @param options + * Maximum number of results to return. + * @defaultValue null */ - constructor(options?: google.maps.maps3d.MarkerInteractiveElementOptions); + set maxResultCount(value: number | null | undefined); /** - * When set, the popover element will be open on this marker's click. + * How results will be ranked in the response. + * @defaultValue null */ - get gmpPopoverTargetElement(): google.maps.maps3d.PopoverElement | null; + get rankPreference(): google.maps.places.SearchNearbyRankPreferenceString | null; /** - * When set, the popover element will be open on this marker's click. + * How results will be ranked in the response. + * @defaultValue null */ - set gmpPopoverTargetElement(value: google.maps.maps3d.PopoverElement | null | undefined); - addEventListener(type: K, listener: (this: MarkerInteractiveElement, ev: MarkerInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + set rankPreference(value: google.maps.places.SearchNearbyRankPreferenceString | null | undefined); + addEventListener(type: K, listener: (this: PlaceNearbySearchRequestElement, ev: PlaceNearbySearchRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface MarkerInteractiveElementEventMap extends google.maps.maps3d.MarkerElementEventMap { - "gmp-click": google.maps.maps3d.LocationClickEvent; + export interface PlaceNearbySearchRequestElementEventMap extends HTMLElementEventMap { } /** - * MarkerInteractiveElementOptions object used to define the properties that can be set on a MarkerInteractiveElement. + * Options for PlaceNearbySearchRequestElement. */ - export interface MarkerInteractiveElementOptions extends google.maps.maps3d.MarkerElementOptions { + export interface PlaceNearbySearchRequestElementOptions { /** - * See {@link google.maps.maps3d.MarkerInteractiveElement.gmpPopoverTargetElement}. + * Excluded primary place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.excludedPrimaryTypes} and {@link google.maps.places.SearchNearbyRequest.excludedPrimaryTypes} for more details. */ - gmpPopoverTargetElement?: google.maps.maps3d.PopoverElement | null; - } - /** - * Model3DElementOptions object used to define the properties that can be set on a Model3DElement. - */ - export interface Model3DElementOptions { + excludedPrimaryTypes?: string[] | null; /** - * See {@link google.maps.maps3d.Model3DElement.altitudeMode}. + * Excluded place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.excludedTypes} and {@link google.maps.places.SearchNearbyRequest.excludedTypes} for more details. */ - altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + excludedTypes?: string[] | null; /** - * See {@link google.maps.maps3d.Model3DElement.orientation}. + * Include place predictions for businesses that are not yet open but are expected to open in the future. */ - orientation?: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null; + futureOpeningBusinessesIncluded?: boolean | null; /** - * See {@link google.maps.maps3d.Model3DElement.position}. + * Included primary place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.includedPrimaryTypes} and {@link google.maps.places.SearchNearbyRequest.includedPrimaryTypes} for more details. */ - position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null; + includedPrimaryTypes?: string[] | null; /** - * See {@link google.maps.maps3d.Model3DElement.scale}. + * Included place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.includedTypes} and {@link google.maps.places.SearchNearbyRequest.includedTypes} for more details. */ - scale?: number | google.maps.Vector3D | google.maps.Vector3DLiteral | null; + includedTypes?: string[] | null; /** - * See {@link google.maps.maps3d.Model3DElement.src}. + * The region to search. See {@link google.maps.places.PlaceNearbySearchRequestElement.locationRestriction} and {@link google.maps.places.SearchNearbyRequest.locationRestriction} for more details. */ - src?: string | URL | null; + locationRestriction?: google.maps.Circle | google.maps.CircleLiteral | null; + /** + * Maximum number of results to return. See {@link google.maps.places.PlaceNearbySearchRequestElement.maxResultCount} and {@link google.maps.places.SearchNearbyRequest.maxResultCount} for more details. + */ + maxResultCount?: number | null; + /** + * How results will be ranked in the response. See {@link google.maps.places.PlaceNearbySearchRequestElement.rankPreference} and {@link google.maps.places.SearchNearbyRankPreference} for more details. + */ + rankPreference?: google.maps.places.SearchNearbyRankPreferenceString | null; } /** - * A 3D model which allows the rendering of gLTF models. Note that the position and the src must be set for the Model3DElement to display.

Core properties of the gLTF PBR should be supported. No extensions or extension properties are currently supported. - * Access by calling `const {Model3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Defines information about the opening hours of a Place. */ - export class Model3DElement extends HTMLElement implements google.maps.maps3d.Model3DElementOptions { + export interface PlaceOpeningHours { /** - * Creates an Model3DElement with the options specified. - * @param options + * Opening periods covering for each day of the week, starting from Sunday, in chronological order. Days in which the Place is not open are not included. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - constructor(options?: google.maps.maps3d.Model3DElementOptions); + periods?: google.maps.places.PlaceOpeningHoursPeriod[]; /** - * Specifies how altitude in the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * An array of seven strings representing the formatted opening hours for each day of the week. The Places Service will format and localize the opening hours appropriately for the current language. The ordering of the elements in this array depends on the language. Some languages start the week on Monday while others start on Sunday. Only available with {@link google.maps.places.PlacesService.getDetails}. Other calls may return an empty array. */ - get altitudeMode(): google.maps.maps3d.AltitudeModeString; + weekday_text?: string[]; /** - * Specifies how altitude in the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * Whether the Place is open at the current time. + * @deprecated open_now is deprecated as of November 2019. Use the {@link google.maps.places.PlaceOpeningHours.isOpen} method from a {@link google.maps.places.PlacesService.getDetails} result instead. See https://goo.gle/js-open-now */ - set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + open_now?: boolean; /** - * Describes rotation of a 3D model's coordinate system to position the model on the 3D Map.

Rotations are applied to the model in the following order: roll, tilt and then heading. + * Check whether the place is open now (when no date is passed), or at the given date. If this place does not have {@link google.maps.places.PlaceResult.utc_offset_minutes} or {@link google.maps.places.PlaceOpeningHours.periods} then undefined is returned ({@link google.maps.places.PlaceOpeningHours.periods} is only available via {@link google.maps.places.PlacesService.getDetails}). This method does not take exceptional hours, such as holiday hours, into consideration. */ - get orientation(): google.maps.Orientation3D | null; + isOpen(date?: Date): boolean | undefined; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's opening hours. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-opening-hours></gmp-place-opening-hours>
</gmp-place-content-config>
+ * Access by calling `const {PlaceOpeningHoursElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceOpeningHoursElement extends HTMLElement implements google.maps.places.PlaceOpeningHoursElementOptions { + addEventListener(type: K, listener: (this: PlaceOpeningHoursElement, ev: PlaceOpeningHoursElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceOpeningHoursElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceOpeningHoursElement. + */ + export interface PlaceOpeningHoursElementOptions { + } + /** + * Defines structured information about the opening hours of a Place. Note: If a Place is always open, the close section will be missing from the response. Clients can rely on always-open being represented as an open period containing day with value 0 and time with value "0000", and no close. + */ + export interface PlaceOpeningHoursPeriod { /** - * Describes rotation of a 3D model's coordinate system to position the model on the 3D Map.

Rotations are applied to the model in the following order: roll, tilt and then heading. + * The closing time for the Place. */ - set orientation(value: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null | undefined); + close?: google.maps.places.PlaceOpeningHoursTime; /** - * Sets the Model3DElement's position. Altitude is ignored in certain modes and thus optional. + * The opening time for the Place. */ - get position(): google.maps.LatLngAltitude | null; + open: google.maps.places.PlaceOpeningHoursTime; + } + /** + * Defines when a Place opens or closes. + */ + export interface PlaceOpeningHoursTime { /** - * Sets the Model3DElement's position. Altitude is ignored in certain modes and thus optional. + * The days of the week, as a number in the range [0, 6], starting on Sunday. For example, 2 means Tuesday. */ - set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined); + day: number; /** - * Scales the model along the x, y, and z axes in the model's coordinate space. - * @defaultValue 1 + * The hours of the {@link google.maps.places.PlaceOpeningHoursTime.time} as a number, in the range [0, 23]. This will be reported in the Place’s time zone. */ - get scale(): google.maps.Vector3D | null; + hours: number; /** - * Scales the model along the x, y, and z axes in the model's coordinate space. - * @defaultValue 1 + * The minutes of the {@link google.maps.places.PlaceOpeningHoursTime.time} as a number, in the range [0, 59]. This will be reported in the Place’s time zone. */ - set scale(value: number | google.maps.Vector3D | google.maps.Vector3DLiteral | null | undefined); + minutes: number; /** - * Specifies the url of the 3D model. At this time, only models in the .glb format are supported.

Any relative HTTP urls will be resolved to their corresponding absolute ones.

Please note that If you're hosting your .glb model files on a different website or server than your main application, make sure to set up the correct CORS HTTP headers. This allows your application to securely access the model files from the other domain. + * The timestamp (as milliseconds since the epoch, suitable for use with new Date()) representing the next occurrence of this PlaceOpeningHoursTime. It is calculated from the {@link google.maps.places.PlaceOpeningHoursTime.day} of week, the {@link google.maps.places.PlaceOpeningHoursTime.time}, and the {@link google.maps.places.PlaceResult.utc_offset_minutes}. If the {@link google.maps.places.PlaceResult.utc_offset_minutes} is undefined, then nextDate will be undefined. */ - get src(): URL | null; + nextDate?: number; /** - * Specifies the url of the 3D model. At this time, only models in the .glb format are supported.

Any relative HTTP urls will be resolved to their corresponding absolute ones.

Please note that If you're hosting your .glb model files on a different website or server than your main application, make sure to set up the correct CORS HTTP headers. This allows your application to securely access the model files from the other domain. + * The time of day in 24-hour "hhmm" format. Values are in the range ["0000", "2359"]. The time will be reported in the Place’s time zone. */ - set src(value: string | URL | null | undefined); - addEventListener(type: K, listener: (this: Model3DElement, ev: Model3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface Model3DElementEventMap extends HTMLElementEventMap { + time: string; } /** - * A 3D model which allows the rendering of gLTF models. Note that the position and the src must be set for the Model3DElement to display.

Core properties of the gLTF PBR should be supported. No extensions or extension properties are currently supported.

Unlike Model3DElement, Model3DInteractiveElement receives a gmp-click event. - * Access by calling `const {Model3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show the current open or closed status of a place. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-open-now-status></gmp-place-open-now-status>
</gmp-place-content-config>
+ * Access by calling `const {PlaceOpenNowStatusElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Model3DInteractiveElement extends google.maps.maps3d.Model3DElement implements google.maps.maps3d.Model3DInteractiveElementOptions { + export class PlaceOpenNowStatusElement extends HTMLElement implements google.maps.places.PlaceOpenNowStatusElementOptions { /** - * Creates a Model3DInteractiveElement with the options specified. + * * @param options */ - constructor(options?: google.maps.maps3d.Model3DElementOptions); - addEventListener(type: K, listener: (this: Model3DInteractiveElement, ev: Model3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + constructor(options?: google.maps.places.PlaceOpenNowStatusElementOptions); + addEventListener(type: K, listener: (this: PlaceOpenNowStatusElement, ev: PlaceOpenNowStatusElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface Model3DInteractiveElementEventMap extends google.maps.maps3d.Model3DElementEventMap { - "gmp-click": google.maps.maps3d.LocationClickEvent; + export interface PlaceOpenNowStatusElementEventMap extends HTMLElementEventMap { } /** - * Model3DInteractiveElementOptions object used to define the properties that can be set on a Model3DInteractiveElement. + * Options for PlaceOpenNowStatusElement. */ - export interface Model3DInteractiveElementOptions extends google.maps.maps3d.Model3DElementOptions { + export interface PlaceOpenNowStatusElementOptions { } /** - * Polygon3DElementOptions object used to define the properties that can be set on a Polygon3DElement. + * Options for constructing a Place. */ - export interface Polygon3DElementOptions { - /** - * See {@link google.maps.maps3d.Polygon3DElement.altitudeMode}. - */ - altitudeMode?: google.maps.maps3d.AltitudeModeString | null; - /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * See {@link google.maps.maps3d.Polygon3DElement.autofitsCamera}. - */ - autofitsCamera?: boolean | null; - /** - * See {@link google.maps.maps3d.Polygon3DElement.drawsOccludedSegments}. - */ - drawsOccludedSegments?: boolean | null; + export interface PlaceOptions { /** - * See {@link google.maps.maps3d.Polygon3DElement.extruded}. + * The unique place id. */ - extruded?: boolean | null; + id?: string; /** - * See {@link google.maps.maps3d.Polygon3DElement.fillColor}. + * A language identifier for the language in which details should be returned. See the list of supported languages. */ - fillColor?: string | null; + requestedLanguage?: string | null; /** - * See {@link google.maps.maps3d.Polygon3DElement.geodesic}. + * A region code of the user's region. This can affect which photos may be returned, and possibly other things. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - geodesic?: boolean | null; + requestedRegion?: string | null; /** - * See {@link google.maps.maps3d.Polygon3DElement.innerCoordinates}. + * The unique place resource name. */ - innerCoordinates?: Iterable | Iterable> | null; + resourceName?: string; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's phone number. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-phone-number></gmp-place-phone-number>
</gmp-place-content-config>
+ * Access by calling `const {PlacePhoneNumberElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlacePhoneNumberElement extends HTMLElement implements google.maps.places.PlacePhoneNumberElementOptions { + addEventListener(type: K, listener: (this: PlacePhoneNumberElement, ev: PlacePhoneNumberElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlacePhoneNumberElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlacePhoneNumberElement. + */ + export interface PlacePhoneNumberElementOptions { + } + /** + * Represents a photo element of a Place. + */ + export interface PlacePhoto { /** - * See {@link google.maps.maps3d.Polygon3DElement.innerPaths}. + * The height of the photo in pixels. */ - innerPaths?: Iterable | Iterable> | null; + height: number; /** - * See {@link google.maps.maps3d.Polygon3DElement.outerCoordinates}. + * Attribution text to be displayed for this photo. */ - outerCoordinates?: Iterable | null; + html_attributions: string[]; /** - * See {@link google.maps.maps3d.Polygon3DElement.path}. + * The width of the photo in pixels. */ - path?: Iterable | null; + width: number; /** - * See {@link google.maps.maps3d.Polygon3DElement.strokeColor}. + * Returns the image URL corresponding to the specified options. */ - strokeColor?: string | null; + getUrl(opts?: google.maps.places.PhotoOptions): string; + } + /** + * Defines Open Location Codes or "plus codes" for a Place. Plus codes can be used as a replacement for street addresses in places where they do not exist (where buildings are not numbered or streets are not named). + */ + export interface PlacePlusCode { /** - * See {@link google.maps.maps3d.Polygon3DElement.strokeWidth}. + * A plus code with a 1/8000th of a degree by 1/8000th of a degree area where the first four characters (the area code) are dropped and replaced with a locality description. For example, "9G8F+5W Zurich, Switzerland". If no suitable locality that can be found to shorten the code then this field is omitted. */ - strokeWidth?: number | null; + compound_code?: string; /** - * See {@link google.maps.maps3d.Polygon3DElement.zIndex}. + * A plus code with a 1/8000th of a degree by 1/8000th of a degree area. For example, "8FVC9G8F+5W". */ - zIndex?: number | null; + global_code: string; } /** - * A 3D polygon (like a 3D polyline) defines a series of connected coordinates in an ordered sequence. Additionally, polygons form a closed loop and define a filled region. - * Access by calling `const {Polygon3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's plus code. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-plus-code></gmp-place-plus-code>
</gmp-place-content-config>
+ * Access by calling `const {PlacePlusCodeElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Polygon3DElement extends HTMLElement implements google.maps.maps3d.Polygon3DElementOptions { + export class PlacePlusCodeElement extends HTMLElement implements google.maps.places.PlacePlusCodeElementOptions { + addEventListener(type: K, listener: (this: PlacePlusCodeElement, ev: PlacePlusCodeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlacePlusCodeElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlacePlusCodeElement. + */ + export interface PlacePlusCodeElementOptions { + } + /** + * Prediction results for a Place Autocomplete prediction. + * Access by calling `const {PlacePrediction} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlacePrediction { /** - * Creates an Polygon3DElement with the options specified. - * @param options + * The length of the geodesic in meters from origin if origin is specified. */ - constructor(options?: google.maps.maps3d.Polygon3DElementOptions); + get distanceMeters(): number | null; /** - * Specifies how altitude components in the coordinates are interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * Represents the name of the Place. */ - get altitudeMode(): google.maps.maps3d.AltitudeModeString; + get mainText(): google.maps.places.FormattableText | null; /** - * Specifies how altitude components in the coordinates are interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * The unique identifier of the suggested Place. This identifier can be used in other APIs that accept Place IDs. */ - set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + get placeId(): string; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * If provided, the specified polygon will be made visible within the map viewport, alongside any other elements that have opted in. - * @defaultValue false + * Represents additional disambiguating features (such as a city or region) to further identify the Place. */ - get autofitsCamera(): boolean; + get secondaryText(): google.maps.places.FormattableText | null; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * If provided, the specified polygon will be made visible within the map viewport, alongside any other elements that have opted in. - * @defaultValue false + * Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address.

text is recommended for developers who wish to show a single UI element. Developers who wish to show two separate, but related, UI elements may want to use {@link google.maps.places.PlacePrediction.mainText} and {@link google.maps.places.PlacePrediction.secondaryText} instead. */ - set autofitsCamera(value: boolean | null | undefined); + get text(): google.maps.places.FormattableText; /** - * Specifies whether parts of the polygon which could be occluded are drawn or not. Polygons can be occluded by map geometry (e.g. buildings). - * @defaultValue false + * List of types that apply to this Place from Table A or Table B in https://developers.google.com/maps/documentation/places/web-service/place-types. */ - get drawsOccludedSegments(): boolean; + get types(): string[]; /** - * Specifies whether parts of the polygon which could be occluded are drawn or not. Polygons can be occluded by map geometry (e.g. buildings). - * @defaultValue false + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * Sends an Address Validation request associated with this autocomplete session (internally populating the request with the autocomplete session token). No place information from the PlacePrediction is included automatically - this is a convenience method to help with autocomplete session management. */ - set drawsOccludedSegments(value: boolean | null | undefined); + fetchAddressValidation(request: google.maps.addressValidation.AddressValidationRequest): Promise; /** - * Specifies whether to connect the polygon to the ground. To extrude a polygon, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. - * @defaultValue false + * Returns a {@link google.maps.places.Place} representation of this PlacePrediction. A subsequent call to {@link google.maps.places.Place.fetchFields} is required to get full Place details.

If a {@link google.maps.places.AutocompleteRequest.sessionToken} was provided in the {@link google.maps.places.AutocompleteRequest} used to fetch this PlacePrediction, the same token will automatically be included when calling fetchFields.

Alternatively, when using {@link google.maps.places.PlaceAutocompleteElement} the first call to {@link google.maps.places.Place.fetchFields} on a {@link google.maps.places.Place} returned by {@link google.maps.places.PlacePrediction.toPlace} will automatically include the session token. */ - get extruded(): boolean; + toPlace(): google.maps.places.Place; + } + /** + * This event is created after the user selects a prediction item with the PlaceAutocompleteElement. Access the selection with event.placePrediction.

Convert placePrediction to a {@link google.maps.places.Place} by calling {@link google.maps.places.PlacePrediction.toPlace}. + * Access by calling `const {PlacePredictionSelectEvent} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlacePredictionSelectEvent extends Event { + /** + * Convert this to a {@link google.maps.places.Place} by calling {@link google.maps.places.PlacePrediction.toPlace}. + */ + get placePrediction(): google.maps.places.PlacePrediction; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's price level or price range. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-price></gmp-place-price>
</gmp-place-content-config>
+ * Access by calling `const {PlacePriceElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlacePriceElement extends HTMLElement implements google.maps.places.PlacePriceElementOptions { /** - * Specifies whether to connect the polygon to the ground. To extrude a polygon, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. - * @defaultValue false + * + * @param options */ - set extruded(value: boolean | null | undefined); + constructor(options?: google.maps.places.PlacePriceElementOptions); + addEventListener(type: K, listener: (this: PlacePriceElement, ev: PlacePriceElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlacePriceElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlacePriceElement. + */ + export interface PlacePriceElementOptions { + } + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's rating. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-rating></gmp-place-rating>
</gmp-place-content-config>
+ * Access by calling `const {PlaceRatingElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceRatingElement extends HTMLElement implements google.maps.places.PlaceRatingElementOptions { /** - * The fill color. All CSS3 colors are supported. + * + * @param options */ - get fillColor(): string | null; + constructor(options?: google.maps.places.PlaceRatingElementOptions); + addEventListener(type: K, listener: (this: PlaceRatingElement, ev: PlaceRatingElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceRatingElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceRatingElement. + */ + export interface PlaceRatingElementOptions { + } + /** + * Defines information about a Place. + */ + export interface PlaceResult { /** - * The fill color. All CSS3 colors are supported. + * The collection of address components for this Place’s location. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - set fillColor(value: string | null | undefined); + address_components?: google.maps.GeocoderAddressComponent[]; /** - * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. - * @defaultValue false + * The representation of the Place’s address in the adr microformat. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - get geodesic(): boolean; + adr_address?: string; /** - * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space. - * @defaultValue false + * The rated aspects of this Place, based on Google and Zagat user reviews. The ratings are on a scale of 0 to 30. */ - set geodesic(value: boolean | null | undefined); + aspects?: google.maps.places.PlaceAspectRating[]; /** - * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths, which create multiple cut-outs inside the polygon. + * A flag indicating the operational status of the Place, if it is a business (indicates whether the place is operational, or closed either temporarily or permanently). If no data is available, the flag is not present in search or details responses. */ - get innerPaths(): google.maps.LatLngAltitude[][] | null; + business_status?: google.maps.places.BusinessStatusString; /** - * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths, which create multiple cut-outs inside the polygon. + * The Place’s full address. */ - set innerPaths(value: Iterable> | null | undefined); + formatted_address?: string; /** - * The ordered sequence of coordinates that designates a closed loop. Altitude is ignored in certain modes and thus optional. + * The Place’s phone number, formatted according to the number's regional convention. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - get path(): google.maps.LatLngAltitude[] | null; + formatted_phone_number?: string; /** - * The ordered sequence of coordinates that designates a closed loop. Altitude is ignored in certain modes and thus optional. + * The Place’s geometry-related information. */ - set path(value: Iterable | null | undefined); + geometry?: google.maps.places.PlaceGeometry; /** - * The stroke color. All CSS3 colors are supported. + * Attribution text to be displayed for this Place result. Available html_attributions are always returned regardless of what fields have been requested, and must be displayed. */ - get strokeColor(): string | null; + html_attributions?: string[]; /** - * The stroke color. All CSS3 colors are supported. + * URL to an image resource that can be used to represent this Place’s category. */ - set strokeColor(value: string | null | undefined); + icon?: string; /** - * The stroke width in pixels. + * Background color for use with a Place's icon. See also {@link google.maps.places.PlaceResult.icon_mask_base_uri}. */ - get strokeWidth(): number | null; + icon_background_color?: string; /** - * The stroke width in pixels. + * A truncated URL to an icon mask. Access different icon types by appending a file extension to the end (i.e. .svg or .png). */ - set strokeWidth(value: number | null | undefined); + icon_mask_base_uri?: string; /** - * The zIndex compared to other polys. + * The Place’s phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - get zIndex(): number | null; + international_phone_number?: string; /** - * The zIndex compared to other polys. + * The Place’s name. Note: In the case of user entered Places, this is the raw text, as typed by the user. Please exercise caution when using this data, as malicious users may try to use it as a vector for code injection attacks (See http://en.wikipedia.org/wiki/Code_injection). */ - set zIndex(value: number | null | undefined); + name?: string; /** - * The ordered sequence of coordinates that designates a closed loop. Altitude is ignored in certain modes and thus optional. - * @deprecated Use path instead. This property will be removed in a future release. + * Defines when the Place opens or closes. */ - outerCoordinates?: Iterable | null; + opening_hours?: google.maps.places.PlaceOpeningHours; /** - * The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths, which create multiple cut-outs inside the polygon. - * @deprecated Use innerPaths instead. This property will be removed in a future release. + * Photos of this Place. The collection will contain up to ten {@link google.maps.places.PlacePhoto} objects. */ - innerCoordinates?: Iterable> | null; - addEventListener(type: K, listener: (this: Polygon3DElement, ev: Polygon3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface Polygon3DElementEventMap extends HTMLElementEventMap { - } - /** - * A 3D polygon (like a 3D polyline) defines a series of connected coordinates in an ordered sequence. Additionally, polygons form a closed loop and define a filled region. Unlike Polygon3DElement, Polygon3DInteractiveElement receives a gmp-click event. - * Access by calling `const {Polygon3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Polygon3DInteractiveElement extends google.maps.maps3d.Polygon3DElement implements google.maps.maps3d.Polygon3DInteractiveElementOptions { + photos?: google.maps.places.PlacePhoto[]; /** - * Creates a Polygon3DInteractiveElement with the options specified. - * @param options + * A unique identifier for the Place. */ - constructor(options?: google.maps.maps3d.Polygon3DElementOptions); - addEventListener(type: K, listener: (this: Polygon3DInteractiveElement, ev: Polygon3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface Polygon3DInteractiveElementEventMap extends google.maps.maps3d.Polygon3DElementEventMap { - "gmp-click": google.maps.maps3d.LocationClickEvent; - } - /** - * Polygon3DInteractiveElementOptions object used to define the properties that can be set on a Polygon3DInteractiveElement. - */ - export interface Polygon3DInteractiveElementOptions extends google.maps.maps3d.Polygon3DElementOptions { - } - /** - * Polyline3DElementOptions object used to define the properties that can be set on a Polyline3DElement. - */ - export interface Polyline3DElementOptions { + place_id?: string; /** - * See {@link google.maps.maps3d.Polyline3DElement.altitudeMode}. + * Defines Open Location Codes or "plus codes" for the Place. */ - altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + plus_code?: google.maps.places.PlacePlusCode; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * See {@link google.maps.maps3d.Polyline3DElement.autofitsCamera}. + * The price level of the Place, on a scale of 0 to 4. Price levels are interpreted as follows:
  • 0: Free
  • 1: Inexpensive
  • 2: Moderate
  • 3: Expensive
  • 4: Very Expensive
*/ - autofitsCamera?: boolean | null; + price_level?: number; /** - * See {@link google.maps.maps3d.Polyline3DElement.coordinates}. + * A rating, between 1.0 to 5.0, based on user reviews of this Place. */ - coordinates?: Iterable | null; + rating?: number; /** - * See {@link google.maps.maps3d.Polyline3DElement.drawsOccludedSegments}. + * A list of reviews of this Place. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - drawsOccludedSegments?: boolean | null; + reviews?: google.maps.places.PlaceReview[]; /** - * See {@link google.maps.maps3d.Polyline3DElement.extruded}. + * An array of types for this Place (for example, ["political", "locality"] or ["restaurant", "establishment"]). */ - extruded?: boolean | null; + types?: string[]; /** - * See {@link google.maps.maps3d.Polyline3DElement.geodesic}. + * URL of the official Google page for this place. This is the Google-owned page that contains the best available information about the Place. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - geodesic?: boolean | null; + url?: string; /** - * See {@link google.maps.maps3d.Polyline3DElement.outerColor}. + * The number of user ratings which contributed to this Place’s {@link google.maps.places.PlaceResult.rating}. */ - outerColor?: string | null; + user_ratings_total?: number; /** - * See {@link google.maps.maps3d.Polyline3DElement.outerWidth}. + * The offset from UTC of the Place’s current timezone, in minutes. For example, Sydney, Australia in daylight savings is 11 hours ahead of UTC, so the utc_offset_minutes will be 660. For timezones behind UTC, the offset is negative. For example, the utc_offset_minutes is -60 for Cape Verde. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - outerWidth?: number | null; + utc_offset_minutes?: number; /** - * See {@link google.maps.maps3d.Polyline3DElement.path}. + * The simplified address for the Place, including the street name, street number, and locality, but not the province/state, postal code, or country. For example, Google's Sydney, Australia office has a vicinity value of "48 Pirrama Road, Pyrmont". Only available with {@link google.maps.places.PlacesService.getDetails}. */ - path?: Iterable | null; + vicinity?: string; /** - * See {@link google.maps.maps3d.Polyline3DElement.strokeColor}. + * The authoritative website for this Place, such as a business' homepage. Only available with {@link google.maps.places.PlacesService.getDetails}. */ - strokeColor?: string | null; + website?: string; /** - * See {@link google.maps.maps3d.Polyline3DElement.strokeWidth}. + * The offset from UTC of the Place’s current timezone, in minutes. For example, Sydney, Australia in daylight savings is 11 hours ahead of UTC, so the utc_offset will be 660. For timezones behind UTC, the offset is negative. For example, the utc_offset is -60 for Cape Verde. Only available with {@link google.maps.places.PlacesService.getDetails}. + * @deprecated utc_offset is deprecated as of November 2019. Use {@link google.maps.places.PlaceResult.utc_offset_minutes} instead. See https://goo.gle/js-open-now */ - strokeWidth?: number | null; + utc_offset?: number; /** - * See {@link google.maps.maps3d.Polyline3DElement.zIndex}. + * A flag indicating whether the Place is closed, either permanently or temporarily. If the place is operational, or if no data is available, the flag is absent from the response. + * @deprecated permanently_closed is deprecated as of May 2020 and will be turned off in May 2021. Use {@link google.maps.places.PlaceResult.business_status} instead as permanently_closed does not distinguish between temporary and permanent closures. */ - zIndex?: number | null; + permanently_closed?: boolean; } /** - * A 3D polyline is a linear overlay of connected line segments on a 3D map. - * Access by calling `const {Polyline3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a single review of a place. */ - export class Polyline3DElement extends HTMLElement implements google.maps.maps3d.Polyline3DElementOptions { - /** - * Creates an Polyline3DElement with the options specified. - * @param options - */ - constructor(options?: google.maps.maps3d.Polyline3DElementOptions); - /** - * Specifies how altitude components in the coordinates are interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} - */ - get altitudeMode(): google.maps.maps3d.AltitudeModeString; + export interface PlaceReview { /** - * Specifies how altitude components in the coordinates are interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * The name of the reviewer. */ - set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + author_name: string; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * If provided, the specified polyline will be made visible within the map viewport, alongside any other elements that have opted in. - * @defaultValue false + * A URL to the reviewer's profile. This will be undefined when the reviewer's profile is unavailable. */ - get autofitsCamera(): boolean; + author_url?: string; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * If provided, the specified polyline will be made visible within the map viewport, alongside any other elements that have opted in. - * @defaultValue false + * An IETF language code indicating the language in which this review is written. Note that this code includes only the main language tag without any secondary tag indicating country or region. For example, all the English reviews are tagged as 'en' rather than 'en-AU' or 'en-UK'. */ - set autofitsCamera(value: boolean | null | undefined); + language: string; /** - * Specifies whether parts of the polyline which could be occluded are drawn or not. Polylines can be occluded by map geometry (e.g. buildings). - * @defaultValue false + * A URL to the reviwer's profile image. */ - get drawsOccludedSegments(): boolean; + profile_photo_url: string; /** - * Specifies whether parts of the polyline which could be occluded are drawn or not. Polylines can be occluded by map geometry (e.g. buildings). - * @defaultValue false + * The rating of this review, a number between 1.0 and 5.0 (inclusive). */ - set drawsOccludedSegments(value: boolean | null | undefined); + rating?: number; /** - * Specifies whether to connect the polyline to the ground. To extrude a polyline, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. - * @defaultValue false + * A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. For example "a month ago". */ - get extruded(): boolean; + relative_time_description: string; /** - * Specifies whether to connect the polyline to the ground. To extrude a polyline, the altitudeMode must be either RELATIVE_TO_GROUND or ABSOLUTE. - * @defaultValue false + * The text of a review. */ - set extruded(value: boolean | null | undefined); + text: string; /** - * When true, edges of the polyline are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polyline are rendered as straight lines in screen space. - * @defaultValue false + * Timestamp for the review, expressed in seconds since epoch. */ - get geodesic(): boolean; + time: number; /** - * When true, edges of the polyline are interpreted as geodesic and will follow the curvature of the Earth. When false, edges of the polyline are rendered as straight lines in screen space. - * @defaultValue false + * The aspects rated by the review. The ratings on a scale of 0 to 3. + * @deprecated This field is no longer available. */ - set geodesic(value: boolean | null | undefined); + aspects?: google.maps.places.PlaceAspectRating[]; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's reviews. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-reviews></gmp-place-reviews>
</gmp-place-content-config>
+ * Access by calling `const {PlaceReviewsElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceReviewsElement extends HTMLElement implements google.maps.places.PlaceReviewsElementOptions { + addEventListener(type: K, listener: (this: PlaceReviewsElement, ev: PlaceReviewsElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceReviewsElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceReviewsElement. + */ + export interface PlaceReviewsElementOptions { + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's review summary. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-review-summary></gmp-place-review-summary>
</gmp-place-content-config>
+ * Access by calling `const {PlaceReviewSummaryElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceReviewSummaryElement extends HTMLElement implements google.maps.places.PlaceReviewSummaryElementOptions { + addEventListener(type: K, listener: (this: PlaceReviewSummaryElement, ev: PlaceReviewSummaryElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceReviewSummaryElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceReviewSummaryElement. + */ + export interface PlaceReviewSummaryElementOptions { + } + /** + * Attribution positions for {@link google.maps.places.PlaceSearchElement}. + * + * Access by calling `const {PlaceSearchAttributionPosition} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum PlaceSearchAttributionPosition { /** - * The outer color. All CSS3 colors are supported. + * Attribution at the bottom of the PlaceSearchElement */ - get outerColor(): string | null; + BOTTOM = 'BOTTOM', /** - * The outer color. All CSS3 colors are supported. + * Attribution at the top of the PlaceSearchElement */ - set outerColor(value: string | null | undefined); + TOP = 'TOP', + } + export type PlaceSearchAttributionPositionString = `${google.maps.places.PlaceSearchAttributionPosition}`; + /** + * Displays the results of a place search in a list. Append a {@link google.maps.places.PlaceTextSearchRequestElement} or {@link google.maps.places.PlaceNearbySearchRequestElement} to specify the request to render results for. Append a {@link google.maps.places.PlaceContentConfigElement}, {@link google.maps.places.PlaceStandardContentElement}, or {@link google.maps.places.PlaceAllContentElement} to specify which content to render.

Example:
 <gmp-place-search>
  <gmp-place-text-search-request
    text-query="QUERY"
  ></gmp-place-text-search-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-search>

To use the Place Search Element, enable the Places UI Kit API for your project in the Google Cloud console. + * Access by calling `const {PlaceSearchElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceSearchElement extends HTMLElement implements google.maps.places.PlaceSearchElementOptions { /** - * The outer width is between 0.0 and 1.0. This is a percentage of the strokeWidth. + * + * @param options */ - get outerWidth(): number | null; + constructor(options?: google.maps.places.PlaceSearchElementOptions); /** - * The outer width is between 0.0 and 1.0. This is a percentage of the strokeWidth. + * The position of the attribution logo and legal disclosure button. + * @defaultValue PlaceSearchAttributionPosition.TOP */ - set outerWidth(value: number | null | undefined); + get attributionPosition(): google.maps.places.PlaceSearchAttributionPositionString; /** - * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional. + * The position of the attribution logo and legal disclosure button. + * @defaultValue PlaceSearchAttributionPosition.TOP */ - get path(): google.maps.LatLngAltitude[] | null; + set attributionPosition(value: google.maps.places.PlaceSearchAttributionPositionString | null | undefined); /** - * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional. + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - set path(value: Iterable | null | undefined); + get internalUsageAttributionIds(): string[] | null; /** - * The stroke color. All CSS3 colors are supported. + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - get strokeColor(): string | null; + set internalUsageAttributionIds(value: Iterable | null | undefined); /** - * The stroke color. All CSS3 colors are supported. + * The orientation variant (vertical or horizontal) of the element. + * @defaultValue PlaceSearchOrientation.VERTICAL */ - set strokeColor(value: string | null | undefined); + get orientation(): google.maps.places.PlaceSearchOrientationString; /** - * The stroke width in pixels. + * The orientation variant (vertical or horizontal) of the element. + * @defaultValue PlaceSearchOrientation.VERTICAL */ - get strokeWidth(): number | null; + set orientation(value: google.maps.places.PlaceSearchOrientationString | null | undefined); /** - * The stroke width in pixels. + * Read only. Array of Place objects containing the IDs, locations, and viewports of the currently rendered places. */ - set strokeWidth(value: number | null | undefined); + get places(): google.maps.places.Place[]; /** - * The zIndex compared to other polys. + * Whether or not the list items are selectable. If true, the list items will be buttons that dispatch the gmp-select event when clicked. Accessible keyboard navigation and selection is also supported. + * @defaultValue false */ - get zIndex(): number | null; + get selectable(): boolean; /** - * The zIndex compared to other polys. + * Whether or not the list items are selectable. If true, the list items will be buttons that dispatch the gmp-select event when clicked. Accessible keyboard navigation and selection is also supported. + * @defaultValue false */ - set zIndex(value: number | null | undefined); + set selectable(value: boolean | null | undefined); /** - * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional. - * @deprecated Use path instead. This property will be removed in a future release. + * If true, truncates certain lines of content to fit on one line instead of wrapping. + * @defaultValue false */ - coordinates?: Iterable | null; - addEventListener(type: K, listener: (this: Polyline3DElement, ev: Polyline3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface Polyline3DElementEventMap extends HTMLElementEventMap { - } - /** - * A 3D polyline is a linear overlay of connected line segments on a 3D map. Unlike Polyline3DElement, Polyline3DInteractiveElement receives a gmp-click event. - * Access by calling `const {Polyline3DInteractiveElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Polyline3DInteractiveElement extends google.maps.maps3d.Polyline3DElement implements google.maps.maps3d.Polyline3DInteractiveElementOptions { + get truncationPreferred(): boolean; /** - * Creates a Polyline3DInteractiveElement with the options specified. - * @param options + * If true, truncates certain lines of content to fit on one line instead of wrapping. + * @defaultValue false */ - constructor(options?: google.maps.maps3d.Polyline3DElementOptions); - addEventListener(type: K, listener: (this: Polyline3DInteractiveElement, ev: Polyline3DInteractiveElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + set truncationPreferred(value: boolean | null | undefined); + addEventListener(type: K, listener: (this: PlaceSearchElement, ev: PlaceSearchElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } - export interface Polyline3DInteractiveElementEventMap extends google.maps.maps3d.Polyline3DElementEventMap { - "gmp-click": google.maps.maps3d.LocationClickEvent; - } - /** - * Polyline3DInteractiveElementOptions object used to define the properties that can be set on a Polyline3DInteractiveElement. - */ - export interface Polyline3DInteractiveElementOptions extends google.maps.maps3d.Polyline3DElementOptions { + export interface PlaceSearchElementEventMap extends HTMLElementEventMap { + "gmp-error": Event; + "gmp-load": Event; + "gmp-select": google.maps.places.PlaceSelectEvent; } /** - * Customization options for the FlyCameraTo Animation. + * Options for PlaceSearchElement. */ - export interface FlyToAnimationOptions { - /** - * The duration of the animation in milliseconds. A duration of 0 will teleport the camera straight to the end position. - */ - durationMillis?: number; + export interface PlaceSearchElementOptions { /** - * The location at which the camera should point at the end of the animation. + * See {@link google.maps.places.PlaceSearchElement.attributionPosition}. */ - endCamera: google.maps.maps3d.CameraOptions; - } - /** - * Customization options for the FlyCameraAround Animation. - */ - export interface FlyAroundAnimationOptions { + attributionPosition?: google.maps.places.PlaceSearchAttributionPositionString | null; /** - * The central point at which the camera should look at during the orbit animation. Note that the map heading will change as the camera orbits around this center point. + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - camera: google.maps.maps3d.CameraOptions; + internalUsageAttributionIds?: Iterable | null; /** - * The duration of one animation cycle in milliseconds. + * See {@link google.maps.places.PlaceSearchElement.orientation}. */ - durationMillis?: number; + orientation?: google.maps.places.PlaceSearchOrientationString | null; /** - * Specifies the number of times an animation should repeat. If the number is zero, the animation will complete immediately after it starts. If Number.Infinity is passed, the animation will repeat forever. + * See {@link google.maps.places.PlaceSearchElement.selectable} */ - repeatCount?: number; + selectable?: boolean | null; /** - * The number of rounds to rotate around the center in the given duration. This controls the overall speed of rotation. Passing a negative number to rounds will cause the camera to rotate in a counter-clockwise direction instead of the default clockwise direction. - * @deprecated Please use {@link google.maps.maps3d.FlyAroundAnimationOptions.repeatCount} instead. + * See {@link google.maps.places.PlaceSearchElement.truncationPreferred}. */ - rounds?: number; + truncationPreferred?: boolean | null; } /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * Specifies how the camera should behave when it moves to a new position to center itself according to its opted-in child elements. + * Orientation variants for {@link google.maps.places.PlaceSearchElement}. * - * Access by calling `const {AutofitsCameraAnimation} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {PlaceSearchOrientation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum AutofitsCameraAnimation { + export enum PlaceSearchOrientation { /** - * Flies to the new position. + * Horizontal orientation. */ - FLY_TO = 'FLY_TO', + HORIZONTAL = 'HORIZONTAL', /** - * Snaps to the new position without an animation. + * Vertical orientation. */ - NONE = 'NONE', + VERTICAL = 'VERTICAL', } - export type AutofitsCameraAnimationString = `${google.maps.maps3d.AutofitsCameraAnimation}`; + export type PlaceSearchOrientationString = `${google.maps.places.PlaceSearchOrientation}`; /** - * CameraOptions object used to define the properties that can be set on a camera object. The camera object can be anything that has a camera position, e.g. a current map state, or a future requested animation state. + * An object used to fetch additional pages of Places results. */ - export interface CameraOptions { + export interface PlaceSearchPagination { /** - * An enum specifying how to interpret the altitude value of the given CameraOptions object. This reuses the existing {@link google.maps.maps3d.AltitudeMode} enum. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.ABSOLUTE} + * Indicates if further results are available. true when there is an additional results page. */ - altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + hasNextPage: boolean; /** - * See {@link google.maps.maps3d.Map3DElement.cameraPosition}. + * Fetches the next page of results. Uses the same callback function that was provided to the first search request. */ - cameraPosition?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; + nextPage(): void; + } + /** + * A Place search query to be sent to the PlacesService. + */ + export interface PlaceSearchRequest { /** - * See {@link google.maps.maps3d.Map3DElement.center}. + * The bounds within which to search for Places. Both location and radius will be ignored if bounds is set. */ - center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * See {@link google.maps.maps3d.Map3DElement.fov}. + * A term to be matched against all available fields, including but not limited to name, type, and address, as well as customer reviews and other third-party content. */ - fov?: number | null; + keyword?: string; /** - * See {@link google.maps.maps3d.Map3DElement.heading}. + * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. */ - heading?: number | null; + language?: string | null; /** - * See {@link google.maps.maps3d.Map3DElement.range}. + * The location around which to search for Places. */ - range?: number | null; + location?: google.maps.LatLng | google.maps.LatLngLiteral; /** - * See {@link google.maps.maps3d.Map3DElement.roll}. + * Restricts results to only those places at the specified price level or lower. Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive. Must be greater than or equal to minPrice , if specified. */ - roll?: number | null; + maxPriceLevel?: number; /** - * See {@link google.maps.maps3d.Map3DElement.tilt}. + * Restricts results to only those places at the specified price level or higher. Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive. Must be less than or equal to maxPrice, if specified. */ - tilt?: number | null; - } - /** - * This event is created from clicking on a place icon on a Map3DElement. To prevent the default popover from showing up, call the preventDefault() method on this event to prevent it being handled by the Map3DElement. - * Access by calling `const {PlaceClickEvent} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PlaceClickEvent extends google.maps.maps3d.LocationClickEvent { + minPriceLevel?: number; /** - * The place id of the map feature. + * Restricts results to only those places that are open right now. */ - placeId: string; + openNow?: boolean; /** - * Fetches a Place for this place id. In the resulting Place object, the id property will be populated. Additional fields can be subsequently requested via Place.fetchFields() subject to normal Places API enablement and billing. The promise is rejected if there was an error fetching the Place. + * The distance from the given location within which to search for Places, in meters. The maximum allowed value is 50 000. */ - fetchPlace(): Promise; - } - /** - * Map3DElementOptions object used to define the properties that can be set on a Map3DElement. - */ - export interface Map3DElementOptions { + radius?: number; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * See {@link google.maps.maps3d.Map3DElement.autofitsCameraAnimation}. + * Specifies the ranking method to use when returning results. Note that when rankBy is set to DISTANCE, you must specify a location but you cannot specify a radius or bounds. + * @defaultValue {@link google.maps.places.RankBy.PROMINENCE} */ - autofitsCameraAnimation?: google.maps.maps3d.AutofitsCameraAnimationString | null; + rankBy?: google.maps.places.RankBy; /** - * See {@link google.maps.maps3d.Map3DElement.bounds}. + * Searches for places of the given type. The type is translated to the local language of the request's target location and used as a query string. If a query is also provided, it is concatenated to the localized type string. Results of a different type are dropped from the response. Use this field to perform language and region independent categorical searches. Valid types are given here. */ - bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; + type?: string; /** - * See {@link google.maps.maps3d.Map3DElement.cameraPosition}. + * Equivalent to keyword. Values in this field are combined with values in the keyword field and passed as part of the same search string. + * @deprecated Use keyword instead. */ - cameraPosition?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; + name?: string; + } + /** + * This event fires when a place is selected from a list of places. Access the selection with event.place. + * Access by calling `const {PlaceSelectEvent} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceSelectEvent extends Event { /** - * See {@link google.maps.maps3d.Map3DElement.center}. + * The selected place. */ - center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null; + get place(): google.maps.places.Place; + } + /** + * Contains methods related to searching for places and retrieving details about a place. + * Access by calling `const {PlacesService} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated As of March 1st, 2025, google.maps.places.PlacesService is not available to new customers. Please use {@link google.maps.places.Place} instead. At this time, google.maps.places.PlacesService is not scheduled to be discontinued, but {@link google.maps.places.Place} is recommended over google.maps.places.PlacesService. While google.maps.places.PlacesService will continue to receive bug fixes for any major regressions, existing bugs in google.maps.places.PlacesService will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details and https://developers.google.com/maps/documentation/javascript/places-migration-overview for the migration guide. + */ + export class PlacesService { /** - * See {@link google.maps.maps3d.Map3DElement.defaultUIHidden}. + * Creates a new instance of the PlacesService that renders attributions in the specified container. + * @param attrContainer */ - defaultUIHidden?: boolean | null; + constructor(attrContainer: HTMLDivElement | google.maps.Map); /** - * See {@link google.maps.maps3d.Map3DElement.description}. + * Retrieves a list of places based on a phone number. In most cases there should be just one item in the result list, however if the request is ambiguous more than one result may be returned. The {@link google.maps.places.PlaceResult}s passed to the callback are subsets of a full {@link google.maps.places.PlaceResult}. Your app can get a more detailed {@link google.maps.places.PlaceResult} for each place by calling {@link google.maps.places.PlacesService.getDetails} and passing the {@link google.maps.places.PlaceResult.place_id} for the desired place. */ - description?: string | null; + findPlaceFromPhoneNumber(request: google.maps.places.FindPlaceFromPhoneNumberRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; /** - * See {@link google.maps.maps3d.Map3DElement.fov}. + * Retrieves a list of places based on a query string. In most cases there should be just one item in the result list, however if the request is ambiguous more than one result may be returned. The {@link google.maps.places.PlaceResult}s passed to the callback are subsets of a full {@link google.maps.places.PlaceResult}. Your app can get a more detailed {@link google.maps.places.PlaceResult} for each place by calling {@link google.maps.places.PlacesService.getDetails} and passing the {@link google.maps.places.PlaceResult.place_id} for the desired place. */ - fov?: number | null; + findPlaceFromQuery(request: google.maps.places.FindPlaceFromQueryRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; /** - * See {@link google.maps.maps3d.Map3DElement.gestureHandling}. + * Retrieves details about the place identified by the given placeId. */ - gestureHandling?: google.maps.maps3d.GestureHandlingString | null; + getDetails(request: google.maps.places.PlaceDetailsRequest, callback: (arg0: google.maps.places.PlaceResult | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void; /** - * See {@link google.maps.maps3d.Map3DElement.heading}. + * Retrieves a list of places near a particular location, based on keyword or type. Location must always be specified, either by passing a LatLngBounds, or location and radius parameters. The {@link google.maps.places.PlaceResult}s passed to the callback are subsets of the full {@link google.maps.places.PlaceResult}. Your app can get a more detailed {@link google.maps.places.PlaceResult} for each place by sending a Place Details request passing the {@link google.maps.places.PlaceResult.place_id} for the desired place. The {@link google.maps.places.PlaceSearchPagination} object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results). */ - heading?: number | null; + nearbySearch(request: google.maps.places.PlaceSearchRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString, arg2: google.maps.places.PlaceSearchPagination | null) => void): void; /** - * See {@link google.maps.maps3d.Map3DElement.internalUsageAttributionIds}. + * Retrieves a list of places based on a query string (for example, "pizza in New York", or "shoe stores near Ottawa"). Location parameters are optional; when the location is specified, results are only biased toward nearby results rather than restricted to places inside the area. Use textSearch when you want to search for places using an arbitrary string, and in cases where you may not want to restrict search results to a particular location. The PlaceSearchPagination object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results). */ - internalUsageAttributionIds?: Iterable | null; + textSearch(request: google.maps.places.TextSearchRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString, arg2: google.maps.places.PlaceSearchPagination | null) => void): void; + } + /** + * The status returned by the PlacesService on the completion of its searches. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.places.PlacesServiceStatus.OK. + * + * Access by calling `const {PlacesServiceStatus} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum PlacesServiceStatus { /** - * See {@link google.maps.maps3d.Map3DElement.language}. + * This request was invalid. */ - language?: string | null; + INVALID_REQUEST = 'INVALID_REQUEST', /** - * See {@link google.maps.maps3d.Map3DElement.mapId}. + * The place referenced was not found. */ - mapId?: string | null; + NOT_FOUND = 'NOT_FOUND', /** - * See {@link google.maps.maps3d.Map3DElement.maxAltitude}. + * The response contains a valid result. */ - maxAltitude?: number | null; + OK = 'OK', /** - * See {@link google.maps.maps3d.Map3DElement.maxHeading}. + * The application has gone over its request quota. */ - maxHeading?: number | null; + OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT', /** - * See {@link google.maps.maps3d.Map3DElement.maxTilt}. + * The application is not allowed to use the PlacesService. */ - maxTilt?: number | null; + REQUEST_DENIED = 'REQUEST_DENIED', /** - * See {@link google.maps.maps3d.Map3DElement.minAltitude}. + * The PlacesService request could not be processed due to a server error. The request may succeed if you try again. */ - minAltitude?: number | null; + UNKNOWN_ERROR = 'UNKNOWN_ERROR', /** - * See {@link google.maps.maps3d.Map3DElement.minHeading}. + * No result was found for this request. */ - minHeading?: number | null; + ZERO_RESULTS = 'ZERO_RESULTS', + } + export type PlacesServiceStatusString = `${google.maps.places.PlacesServiceStatus}`; + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a standard set of content. Append this element as a child to use it.
For {@link google.maps.places.PlaceDetailsElement}, standard content consists of:
  • media
  • address
  • rating
  • type
  • price
  • accessible entrance icon
  • website
  • phone number
  • opening hours
  • summary
  • type specific highlights
  • reviews
  • feature list

For {@link google.maps.places.PlaceDetailsCompactElement}, standard content consists of:
  • media
  • rating
  • type
  • price
  • accessible entrance icon
  • open now status

For {@link google.maps.places.PlaceSearchElement}, standard content consists of:
  • media
  • rating
  • type
  • price
  • accessible entrance icon

For example:
 <gmp-place-details>
  <gmp-place-standard-content></gmp-place-standard-content>
</gmp-place-details>
+ * Access by calling `const {PlaceStandardContentElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceStandardContentElement extends HTMLElement implements google.maps.places.PlaceStandardContentElementOptions { /** - * See {@link google.maps.maps3d.Map3DElement.minTilt}. + * + * @param options */ - minTilt?: number | null; + constructor(options?: google.maps.places.PlaceStandardContentElementOptions); + addEventListener(type: K, listener: (this: PlaceStandardContentElement, ev: PlaceStandardContentElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceStandardContentElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceStandardContentElement. + */ + export interface PlaceStandardContentElementOptions { + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's summary. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-summary></gmp-place-summary>
</gmp-place-content-config>
+ * Access by calling `const {PlaceSummaryElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceSummaryElement extends HTMLElement implements google.maps.places.PlaceSummaryElementOptions { + addEventListener(type: K, listener: (this: PlaceSummaryElement, ev: PlaceSummaryElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceSummaryElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceSummaryElement. + */ + export interface PlaceSummaryElementOptions { + } + /** + * Configures a {@link google.maps.places.PlaceSearchElement} to load results based on a text search request. The textQuery property is required for the search element to load. Any other configured properties will be ignored if textQuery is not set. Append this element as a child of a {@link google.maps.places.PlaceSearchElement} to load results. For example:
 <gmp-place-search>
  <gmp-place-text-search-request
    text-query="QUERY"
  ></gmp-place-text-search-request>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
  </gmp-place-content-config>
</gmp-place-search>
+ * Access by calling `const {PlaceTextSearchRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceTextSearchRequestElement extends HTMLElement implements google.maps.places.PlaceTextSearchRequestElementOptions { /** - * See {@link google.maps.maps3d.Map3DElement.mode}. + * + * @param options */ - mode?: google.maps.maps3d.MapModeString | null; + constructor(options?: google.maps.places.PlaceTextSearchRequestElementOptions); /** - * See {@link google.maps.maps3d.Map3DElement.range}. + * The list of preferred EV connector types. + * @defaultValue null */ - range?: number | null; + get evConnectorTypes(): google.maps.places.EVConnectorTypeString[] | null; /** - * See {@link google.maps.maps3d.Map3DElement.region}. + * The list of preferred EV connector types. + * @defaultValue null */ - region?: string | null; + set evConnectorTypes(value: google.maps.places.EVConnectorTypeString[] | null | undefined); /** - * See {@link google.maps.maps3d.Map3DElement.roll}. + * Minimum required charging rate in kilowatts. + * @defaultValue null */ - roll?: number | null; + get evMinimumChargingRateKw(): number | null; /** - * See {@link google.maps.maps3d.Map3DElement.tilt}. + * Minimum required charging rate in kilowatts. + * @defaultValue null */ - tilt?: number | null; + set evMinimumChargingRateKw(value: number | null | undefined); /** - * See {@link google.maps.maps3d.Map3DElement.defaultUIDisabled}. - * @deprecated Please use {@link google.maps.maps3d.Map3DElement.defaultUIHidden} instead. This property will be removed in a future release. + * Include place predictions for businesses that are not yet open but are expected to open in the future. */ - defaultUIDisabled?: boolean | null; - } - /** - * Specifies how gesture events should be handled on the map element. - * - * Access by calling `const {GestureHandling} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum GestureHandling { + get futureOpeningBusinessesIncluded(): boolean | null; /** - * This lets the map choose whether to use cooperative or greedy gesture handling. This is the default behavior if not specified.

This will cause the map to enter cooperative mode if the map is dominating its scroll parent (usually the host page) to where the user cannot scroll away from the map to other content. + * Include place predictions for businesses that are not yet open but are expected to open in the future. */ - AUTO = 'AUTO', + set futureOpeningBusinessesIncluded(value: boolean | null | undefined); /** - * This forces cooperative mode, where modifier keys or two-finger gestures are required to scroll the map. + * The requested place type. + * @defaultValue null */ - COOPERATIVE = 'COOPERATIVE', + get includedType(): string | null; /** - * This forces greedy mode, where the host page cannot be scrolled from user events on the map element. + * The requested place type. + * @defaultValue null */ - GREEDY = 'GREEDY', - } - export type GestureHandlingString = `${google.maps.maps3d.GestureHandling}`; - /** - * Map3DElement is an HTML interface for the 3D Map view. Note that the mode must be set for the 3D Map to start rendering. - * Access by calling `const {Map3DElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Map3DElement extends HTMLElement implements google.maps.maps3d.Map3DElementOptions { + set includedType(value: string | null | undefined); /** - * - * @param options + * Used to restrict the search to places that are currently open. + * @defaultValue null */ - constructor(options?: google.maps.maps3d.Map3DElementOptions); + get isOpenNow(): boolean | null; /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * The animation to use for automatic camera fitting. - * @defaultValue none + * Used to restrict the search to places that are currently open. + * @defaultValue null */ - get autofitsCameraAnimation(): google.maps.maps3d.AutofitsCameraAnimationString | null; + set isOpenNow(value: boolean | null | undefined); /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * The animation to use for automatic camera fitting. - * @defaultValue none + * Location bias for the search. + * @defaultValue null */ - set autofitsCameraAnimation(value: google.maps.maps3d.AutofitsCameraAnimationString | null | undefined); + get locationBias(): google.maps.LatLngAltitude | google.maps.LatLngBounds | google.maps.Circle | string | null; /** - * When set, restricts the position of the camera within the specified lat/lng bounds. Note that objects outside the bounds are still rendered. Bounds can restrict both longitude and latitude, or can restrict either latitude or longitude only. For latitude-only bounds use west and east longitudes of -180 and 180, respectively. For longitude-only bounds use north and south latitudes of 90 and -90, respectively. + * Location bias for the search. + * @defaultValue null */ - get bounds(): google.maps.LatLngBounds | null; + set locationBias(value: google.maps.places.LocationBias | null | undefined); /** - * When set, restricts the position of the camera within the specified lat/lng bounds. Note that objects outside the bounds are still rendered. Bounds can restrict both longitude and latitude, or can restrict either latitude or longitude only. For latitude-only bounds use west and east longitudes of -180 and 180, respectively. For longitude-only bounds use north and south latitudes of 90 and -90, respectively. + * Location restriction for the search. Normalizes to a LatLngBounds. + * @defaultValue null */ - set bounds(value: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null | undefined); + get locationRestriction(): google.maps.LatLngBounds | null; /** - * The position of the camera given as a LatLngAltitude. Will be derived if omitted. If center is omitted but cameraPosition is specified, center will derive from cameraPosition. If both are updated in the same run loop, cameraPosition will be favored. The fields cameraPosition and center can be one-to-one-derived from each other in context of the given shared heading, range, roll, and tilt. + * Location restriction for the search. Normalizes to a LatLngBounds. + * @defaultValue null */ - get cameraPosition(): google.maps.LatLngAltitude | null; + set locationRestriction(value: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null | undefined); /** - * The position of the camera given as a LatLngAltitude. Will be derived if omitted. If center is omitted but cameraPosition is specified, center will derive from cameraPosition. If both are updated in the same run loop, cameraPosition will be favored. The fields cameraPosition and center can be one-to-one-derived from each other in context of the given shared heading, range, roll, and tilt. + * Maximum number of results to return. + * @defaultValue null */ - set cameraPosition(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined); + get maxResultCount(): number | null; /** - * The center of the map given as a LatLngAltitude, where altitude is in meters above the mean sea level. Note that this is not necessarily where the camera is located, as the range field affects the camera's distance from the map center. If not set, defaults to {lat: 0, lng: 0, altitude: 63170000}. 63170000 meters is a maximum allowed altitude (Earth radius multiplied by 10). + * Maximum number of results to return. + * @defaultValue null */ - get center(): google.maps.LatLngAltitude | null; + set maxResultCount(value: number | null | undefined); /** - * The center of the map given as a LatLngAltitude, where altitude is in meters above the mean sea level. Note that this is not necessarily where the camera is located, as the range field affects the camera's distance from the map center. If not set, defaults to {lat: 0, lng: 0, altitude: 63170000}. 63170000 meters is a maximum allowed altitude (Earth radius multiplied by 10). + * Filter out results whose average user rating is strictly less than this limit. + * @defaultValue null */ - set center(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined); + get minRating(): number | null; /** - * When true, all default UI buttons are hidden. - * @defaultValue false + * Filter out results whose average user rating is strictly less than this limit. + * @defaultValue null */ - get defaultUIHidden(): boolean; + set minRating(value: number | null | undefined); /** - * When true, all default UI buttons are hidden. - * @defaultValue false + * Used to restrict the search to places that are marked as certain price levels. + * @defaultValue null */ - set defaultUIHidden(value: boolean | null | undefined); + get priceLevels(): google.maps.places.PriceLevelString[] | null; /** - * If provided, an accessibility description (e.g. for use with screen readers) will be added to the map with the provided value. + * Used to restrict the search to places that are marked as certain price levels. + * @defaultValue null */ - get description(): string | null; + set priceLevels(value: google.maps.places.PriceLevelString[] | null | undefined); /** - * If provided, an accessibility description (e.g. for use with screen readers) will be added to the map with the provided value. + * How results will be ranked in the response. + * @defaultValue null */ - set description(value: string | null | undefined); + get rankPreference(): google.maps.places.SearchByTextRankPreferenceString | null; /** - * Specifies the vertical field of view in degrees. Valid values range from 5.0 to 80.0. Higher values increase the visible area but may introduce perspective distortion. Default: 35.0. + * How results will be ranked in the response. + * @defaultValue null */ - get fov(): number | null; + set rankPreference(value: google.maps.places.SearchByTextRankPreferenceString | null | undefined); /** - * Specifies the vertical field of view in degrees. Valid values range from 5.0 to 80.0. Higher values increase the visible area but may introduce perspective distortion. Default: 35.0. + * The text query for textual search. + * @defaultValue null */ - set fov(value: number | null | undefined); + get textQuery(): string | null; /** - * Controls cooperative gesture handling. When set to COOPERATIVE, modifier keys or two-finger gestures are required to scroll the map. When set to GREEDY, the host page cannot be scrolled from user events on the map element. When set to AUTO, the gesture handling is determined by the scrollability of the host page. - * @defaultValue {@link google.maps.maps3d.GestureHandling.GREEDY} + * The text query for textual search. + * @defaultValue null */ - get gestureHandling(): google.maps.maps3d.GestureHandlingString; + set textQuery(value: string | null | undefined); /** - * Controls cooperative gesture handling. When set to COOPERATIVE, modifier keys or two-finger gestures are required to scroll the map. When set to GREEDY, the host page cannot be scrolled from user events on the map element. When set to AUTO, the gesture handling is determined by the scrollability of the host page. - * @defaultValue {@link google.maps.maps3d.GestureHandling.GREEDY} + * Used to set strict type filtering for 'includedType'. + * @defaultValue null */ - set gestureHandling(value: google.maps.maps3d.GestureHandlingString | null | undefined); + get useStrictTypeFiltering(): boolean | null; /** - * The compass heading of the map, in degrees, where due north is zero. When there is no tilt, any roll will be interpreted as heading. + * Used to set strict type filtering for 'includedType'. + * @defaultValue null */ - get heading(): number | null; + set useStrictTypeFiltering(value: boolean | null | undefined); + addEventListener(type: K, listener: (this: PlaceTextSearchRequestElement, ev: PlaceTextSearchRequestElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceTextSearchRequestElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceTextSearchRequestElement. + */ + export interface PlaceTextSearchRequestElementOptions { /** - * The compass heading of the map, in degrees, where due north is zero. When there is no tilt, any roll will be interpreted as heading. + * The list of preferred EV connector types. See {@link google.maps.places.SearchByTextRequest.evSearchOptions} and {@link google.maps.places.PlaceTextSearchRequestElement.evConnectorTypes} for more details. */ - set heading(value: number | null | undefined); + evConnectorTypes?: google.maps.places.EVConnectorTypeString[] | null; /** - * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property. Only unique values will be sent. Changes to this value after instantiation may be ignored. + * Minimum required charging rate in kilowatts. See {@link google.maps.places.SearchByTextRequest.evSearchOptions} and {@link google.maps.places.PlaceTextSearchRequestElement.evMinimumChargingRateKw} for more details. */ - get internalUsageAttributionIds(): string[] | null; + evMinimumChargingRateKw?: number | null; /** - * Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this property. Only unique values will be sent. Changes to this value after instantiation may be ignored. + * Include place predictions for businesses that are not yet open but are expected to open in the future. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + futureOpeningBusinessesIncluded?: boolean | null; /** - * Language in which to attempt to render the base map's language. Will default to the language requested by the developer when loading the Maps JS API. + * The requested place type. See {@link google.maps.places.SearchByTextRequest.includedType} and {@link google.maps.places.PlaceTextSearchRequestElement.includedType} for more details. */ - get language(): string | null; + includedType?: string | null; /** - * Language in which to attempt to render the base map's language. Will default to the language requested by the developer when loading the Maps JS API. + * Used to restrict the search to places that are currently open. See {@link google.maps.places.SearchByTextRequest.isOpenNow} and {@link google.maps.places.PlaceTextSearchRequestElement.isOpenNow} for more details. */ - set language(value: string | null | undefined); + isOpenNow?: boolean | null; /** - * Specifies a map ID which will be used to fetch cloud-based map style for the map. + * Location bias for the search. See {@link google.maps.places.SearchByTextRequest.locationBias} and {@link google.maps.places.PlaceTextSearchRequestElement.locationBias} for more details. */ - get mapId(): string | null; + locationBias?: google.maps.places.LocationBias | null; /** - * Specifies a map ID which will be used to fetch cloud-based map style for the map. + * Location restriction for the search. See {@link google.maps.places.SearchByTextRequest.locationRestriction} and {@link google.maps.places.PlaceTextSearchRequestElement.locationRestriction} for more details. */ - set mapId(value: string | null | undefined); + locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; /** - * The maximum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). + * Maximum number of results to return. See {@link google.maps.places.SearchByTextRequest.maxResultCount} and {@link google.maps.places.PlaceTextSearchRequestElement.maxResultCount} for more details. */ - get maxAltitude(): number | null; + maxResultCount?: number | null; /** - * The maximum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). + * Filter out results whose average user rating is strictly less than this limit. See {@link google.maps.places.SearchByTextRequest.minRating} and {@link google.maps.places.PlaceTextSearchRequestElement.minRating} for more details. */ - set maxAltitude(value: number | null | undefined); + minRating?: number | null; /** - * The maximum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. + * Used to restrict the search to places that are marked as certain price levels. See {@link google.maps.places.SearchByTextRequest.priceLevels} and {@link google.maps.places.PlaceTextSearchRequestElement.priceLevels} for more details. */ - get maxHeading(): number | null; + priceLevels?: google.maps.places.PriceLevelString[] | null; /** - * The maximum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. + * How results will be ranked in the response. See {@link google.maps.places.SearchByTextRequest.rankPreference} and {@link google.maps.places.PlaceTextSearchRequestElement.rankPreference} for more details. */ - set maxHeading(value: number | null | undefined); + rankPreference?: google.maps.places.SearchByTextRankPreferenceString | null; /** - * The maximum angle of incidence of the map. A valid value is between 0 and 90 degrees. + * The text query for textual search. See {@link google.maps.places.SearchByTextRequest.textQuery} and {@link google.maps.places.PlaceTextSearchRequestElement.textQuery} for more details. */ - get maxTilt(): number | null; + textQuery?: string | null; /** - * The maximum angle of incidence of the map. A valid value is between 0 and 90 degrees. + * Used to set strict type filtering for {@link google.maps.places.SearchByTextRequest.includedType}. See {@link google.maps.places.SearchByTextRequest.useStrictTypeFiltering} and {@link google.maps.places.PlaceTextSearchRequestElement.useStrictTypeFiltering} for more details. */ - set maxTilt(value: number | null | undefined); + useStrictTypeFiltering?: boolean | null; + } + /** + * Configures a {@link google.maps.places.PlaceDetailsCompactElement}, {@link google.maps.places.PlaceDetailsElement}, or {@link google.maps.places.PlaceSearchElement} to show a place's type. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-type></gmp-place-type>
</gmp-place-content-config>
+ * Access by calling `const {PlaceTypeElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceTypeElement extends HTMLElement implements google.maps.places.PlaceTypeElementOptions { /** - * The minimum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). + * + * @param options */ - get minAltitude(): number | null; + constructor(options?: google.maps.places.PlaceTypeElementOptions); + addEventListener(type: K, listener: (this: PlaceTypeElement, ev: PlaceTypeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceTypeElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceTypeElement. + */ + export interface PlaceTypeElementOptions { + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's type-specific highlights, such as gas prices and EV charger availability. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-type-specific-highlights></gmp-place-type-specific-highlights>
</gmp-place-content-config>
+ * Access by calling `const {PlaceTypeSpecificHighlightsElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceTypeSpecificHighlightsElement extends HTMLElement implements google.maps.places.PlaceTypeSpecificHighlightsElementOptions { + addEventListener(type: K, listener: (this: PlaceTypeSpecificHighlightsElement, ev: PlaceTypeSpecificHighlightsElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceTypeSpecificHighlightsElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceTypeSpecificHighlightsElement. + */ + export interface PlaceTypeSpecificHighlightsElementOptions { + } + /** + * Configures a {@link google.maps.places.PlaceDetailsElement} to show a place's website. Append this element as a child of a {@link google.maps.places.PlaceContentConfigElement} to use it. For example:
 <gmp-place-content-config>
  <gmp-place-website></gmp-place-website>
</gmp-place-content-config>
+ * Access by calling `const {PlaceWebsiteElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlaceWebsiteElement extends HTMLElement implements google.maps.places.PlaceWebsiteElementOptions { + addEventListener(type: K, listener: (this: PlaceWebsiteElement, ev: PlaceWebsiteElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface PlaceWebsiteElementEventMap extends HTMLElementEventMap { + } + /** + * Options for PlaceWebsiteElement. + */ + export interface PlaceWebsiteElementOptions { + } + /** + * Plus code for the Place. See https://plus.codes/ for more information. + * Access by calling `const {PlusCode} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PlusCode { /** - * The minimum altitude above the ground which will be displayed on the map. A valid value is between 0 and 63170000 meters (Earth radius multiplied by 10). + * A plus code with a 1/8000th of a degree by 1/8000th of a degree area where the first four characters (the area code) are dropped and replaced with a locality description. For example, "9G8F+5W Zurich, Switzerland". */ - set minAltitude(value: number | null | undefined); + get compoundCode(): string | null; /** - * The minimum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. + * A plus code with a 1/8000th of a degree by 1/8000th of a degree area. For example, "8FVC9G8F+5W". */ - get minHeading(): number | null; + get globalCode(): string | null; /** - * The minimum angle of heading (rotation) of the map. A valid value is between 0 and 360 degrees. minHeading and maxHeading represent an interval of <= 360 degrees in which heading gestures will be allowed. minHeading = 180 and maxHeading = 90 will allow heading in [0, 90] and heading in [180, 360]. minHeading = 90 and maxHeading = 180 will allow heading in [90, 180]. + * Converts to a plain object. */ - set minHeading(value: number | null | undefined); + toJSON(key?: string): unknown; + } + /** + * Represents a postal address (e.g. for a postal service to deliver items to). Note: PostalAddress is used by the JavaScript API to instantiate objects that represent data returned by the Web Service. + * Access by calling `const {PostalAddress} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PostalAddress implements google.maps.places.PostalAddressLiteral { /** - * The minimum angle of incidence of the map. A valid value is between 0 and 90 degrees. + * Unstructured address lines describing the lower levels of an address. */ - get minTilt(): number | null; + get addressLines(): string[]; /** - * The minimum angle of incidence of the map. A valid value is between 0 and 90 degrees. + * The highest administrative subdivision which is used for postal addresses of a country or region. */ - set minTilt(value: number | null | undefined); + get administrativeArea(): string | null; /** - * Specifies a mode the map should be rendered in. If not set, the map won't be rendered. + * BCP-47 language code of the contents of this address. Examples: "zh-Hant", "ja", "ja-Latn", "en". */ - get mode(): google.maps.maps3d.MapModeString | null; + get languageCode(): string | null; /** - * Specifies a mode the map should be rendered in. If not set, the map won't be rendered. + * Generally refers to the city/town portion of the address. */ - set mode(value: google.maps.maps3d.MapModeString | null | undefined); + get locality(): string | null; /** - * The distance from camera to the center of the map, in meters. + * The name of the organization at the address. */ - get range(): number | null; + get organization(): string | null; /** - * The distance from camera to the center of the map, in meters. + * Postal code of the address. */ - set range(value: number | null | undefined); + get postalCode(): string | null; /** - * Region with which to attempt to render the base map's POIs. Will default to the region requested by the developer when loading the Maps JS API. + * The recipient at the address. */ - get region(): string | null; + get recipients(): string[]; /** - * Region with which to attempt to render the base map's POIs. Will default to the region requested by the developer when loading the Maps JS API. + * CLDR region code of the country/region of the address. Example: "CH" for Switzerland. See https://cldr.unicode.org/ and https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. */ - set region(value: string | null | undefined); + get regionCode(): string; /** - * The roll of the camera around the view vector in degrees. To resolve ambiguities, when there is no tilt, any roll will be interpreted as heading. + * Sorting code of the address. */ - get roll(): number | null; + get sortingCode(): string | null; /** - * The roll of the camera around the view vector in degrees. To resolve ambiguities, when there is no tilt, any roll will be interpreted as heading. + * Sublocality of the address such as neighborhoods, boroughs, or districts. */ - set roll(value: number | null | undefined); + get sublocality(): string | null; /** - * The tilt of the camera's view vector in degrees. A view vector looking directly down at the earth would have a tilt of zero degrees. A view vector pointing away from the earth would have a tilt of 180 degrees. + * Converts to a plain object. */ - get tilt(): number | null; + toJSON(key?: string): unknown; + } + /** + * Data for hydrating a PostalAddress. + */ + export interface PostalAddressLiteral { /** - * The tilt of the camera's view vector in degrees. A view vector looking directly down at the earth would have a tilt of zero degrees. A view vector pointing away from the earth would have a tilt of 180 degrees. + * See {@link google.maps.places.PostalAddress.addressLines}. */ - set tilt(value: number | null | undefined); + addressLines?: Iterable; /** - * When true, all default UI buttons are disabled. Does not disable the keyboard and gesture controls. - * @defaultValue false - * @deprecated Please use {@link google.maps.maps3d.Map3DElement.defaultUIHidden} instead. This property will be removed in a future release. + * See {@link google.maps.places.PostalAddress.administrativeArea}. */ - defaultUIDisabled?: boolean | null; + administrativeArea?: string | null; /** - * This method orbits the camera around a given location for a given duration. The animation can be repeated by the given number of {@link google.maps.maps3d.FlyAroundAnimationOptions.repeatCount} times.

The camera will move in a clockwise direction.

The location being orbited around is specified via {@link google.maps.maps3d.CameraOptions.center}. This is the location that will show in the center of the viewport during the orbit animation, while the camera moves around it.

The method is asynchronous because animations can only start after the map has loaded a minimum amount. The method returns once the animation has been started.

If the number of {@link google.maps.maps3d.FlyAroundAnimationOptions.repeatCount} times is zero, no spin will occur, and the animation will complete immediately after it starts. + * See {@link google.maps.places.PostalAddress.languageCode}. */ - flyCameraAround(options: google.maps.maps3d.FlyAroundAnimationOptions): void; + languageCode?: string | null; /** - * This method moves the camera parabolically from the current location to a given end location over a given duration. End location can be specified via {@link google.maps.maps3d.CameraOptions.cameraPosition}, which controls the exact camera position, or via {@link google.maps.maps3d.CameraOptions.center}, which controls the visible viewport center of the map.

The method is asynchronous because animations can only start after the map has loaded a minimum amount. The method returns once the animation has been started. + * See {@link google.maps.places.PostalAddress.locality}. */ - flyCameraTo(options: google.maps.maps3d.FlyToAnimationOptions): void; + locality?: string | null; /** - * This method stops any fly animation that might happen to be running. The camera stays wherever it is mid-animation; it does not teleport to the end point.

The method is asynchronous because animations can only start or stop after the map has loaded a minimum amount. The method returns once the animation has stopped. + * See {@link google.maps.places.PostalAddress.organization}. */ - stopCameraAnimation(): void; - addEventListener(type: K, listener: (this: Map3DElement, ev: Map3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface Map3DElementEventMap extends HTMLElementEventMap { - "gmp-animationend": Event; - "gmp-camerapositionchange": Event; - "gmp-centerchange": Event; - "gmp-click": google.maps.maps3d.LocationClickEvent | google.maps.maps3d.PlaceClickEvent; - "gmp-error": Event; - "gmp-fovchange": Event; - "gmp-headingchange": Event; - "gmp-map-id-error": Event; - "gmp-rangechange": Event; - "gmp-rollchange": Event; - "gmp-steadychange": google.maps.maps3d.SteadyChangeEvent; - "gmp-tiltchange": Event; - } - /** - * PopoverElementOptions object used to define the properties that can be set on a PopoverElement. - */ - export interface PopoverElementOptions { + organization?: string | null; /** - * See {@link google.maps.maps3d.PopoverElement.altitudeMode}. + * See {@link google.maps.places.PostalAddress.postalCode}. */ - altitudeMode?: google.maps.maps3d.AltitudeModeString | null; + postalCode?: string | null; /** - * See {@link google.maps.maps3d.PopoverElement.autoPanDisabled}. + * See {@link google.maps.places.PostalAddress.recipients}. */ - autoPanDisabled?: boolean | null; + recipients?: Iterable; /** - * See {@link google.maps.maps3d.PopoverElement.lightDismissDisabled}. + * See {@link google.maps.places.PostalAddress.regionCode}. */ - lightDismissDisabled?: boolean | null; + regionCode: string; /** - * See {@link google.maps.maps3d.PopoverElement.open}. + * See {@link google.maps.places.PostalAddress.sortingCode}. */ - open?: boolean | null; + sortingCode?: string | null; /** - * See {@link google.maps.maps3d.PopoverElement.positionAnchor}. + * See {@link google.maps.places.PostalAddress.sublocality}. */ - positionAnchor?: google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | string | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | null; + sublocality?: string | null; } /** - * A custom HTML element that renders a popover. It looks like a bubble and is often connected to a marker. - * Access by calling `const {PopoverElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a prediction substring. */ - export class PopoverElement extends HTMLElement implements google.maps.maps3d.PopoverElementOptions { + export interface PredictionSubstring { /** - * - * @param options + * The length of the substring. */ - constructor(options?: google.maps.maps3d.PopoverElementOptions); + length: number; /** - * Specifies how the altitude component of the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * The offset to the substring's start within the description string. */ - get altitudeMode(): google.maps.maps3d.AltitudeModeString; + offset: number; + } + /** + * Represents a prediction term. + */ + export interface PredictionTerm { /** - * Specifies how the altitude component of the position is interpreted. - * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND} + * The offset, in unicode characters, of the start of this term in the description of the place. */ - set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined); + offset: number; /** - * If set to true, disables panning the map to make the popover fully visible when it opens. - * @defaultValue false + * The value of this term, for example, "Taco Bell". */ - get autoPanDisabled(): boolean; + value: string; + } + /** + * Price level of the place. See the web service documentation for more information. + * + * Access by calling `const {PriceLevel} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum PriceLevel { /** - * If set to true, disables panning the map to make the popover fully visible when it opens. - * @defaultValue false + * Place provides expensive services. See the web service documentation for more information. */ - set autoPanDisabled(value: boolean | null | undefined); + EXPENSIVE = 'EXPENSIVE', /** - * Specifies whether this popover should be "light dismissed" or not. The "light dismiss" behavior is similar to setting the popover="auto" attribute which is part of the browser Popover API. - * @defaultValue false + * Place provides free services. See the web service documentation for more information. */ - get lightDismissDisabled(): boolean; + FREE = 'FREE', /** - * Specifies whether this popover should be "light dismissed" or not. The "light dismiss" behavior is similar to setting the popover="auto" attribute which is part of the browser Popover API. - * @defaultValue false + * Place provides inexpensive services. See the web service documentation for more information. */ - set lightDismissDisabled(value: boolean | null | undefined); + INEXPENSIVE = 'INEXPENSIVE', /** - * Specifies whether this popover should be open or not. - * @defaultValue false + * Place provides moderately priced services. See the web service documentation for more information. */ - get open(): boolean; + MODERATE = 'MODERATE', /** - * Specifies whether this popover should be open or not. - * @defaultValue false + * Place provides very expensive services. See the web service documentation for more information. */ - set open(value: boolean | null | undefined); + VERY_EXPENSIVE = 'VERY_EXPENSIVE', + } + export type PriceLevelString = `${google.maps.places.PriceLevel}`; + /** + * The price range associated with a Place. endPrice could be unset, which indicates a range without upper bound (e.g. "More than $100"). + * Access by calling `const {PriceRange} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PriceRange { /** - * The position at which to display this popover. If the popover is anchored to an interactive marker, the marker's position will be used instead. + * The upper end of the price range (inclusive). Price should be lower than this amount. */ - get positionAnchor(): google.maps.LatLngAltitude | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | null; + get endPrice(): google.maps.places.Money | null; /** - * The position at which to display this popover. If the popover is anchored to an interactive marker, the marker's position will be used instead. + * The low end of the price range (inclusive). Price should be at or above this amount. */ - set positionAnchor(value: google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | string | null | undefined); - addEventListener(type: K, listener: (this: PopoverElement, ev: PopoverElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface PopoverElementEventMap extends HTMLElementEventMap { + get startPrice(): google.maps.places.Money; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } -} - -declare namespace google.maps.routes { /** - * The classification of polyline speed based on traffic data. See the web service documentation for more information. - * - * Access by calling `const {Speed} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a single Query Autocomplete prediction. */ - export enum Speed { + export interface QueryAutocompletePrediction { /** - * Normal speed, no traffic delays. See the web service documentation for more information. + * This is the unformatted version of the query suggested by the Places service. */ - NORMAL = 'NORMAL', + description: string; /** - * Slowdown detected, medium amount of traffic. See the web service documentation for more information. + * A set of substrings in the place's description that match elements in the user's input, suitable for use in highlighting those substrings. Each substring is identified by an offset and a length, expressed in unicode characters. */ - SLOW = 'SLOW', + matched_substrings: google.maps.places.PredictionSubstring[]; /** - * Traffic delays. See the web service documentation for more information. + * Only available if prediction is a place. A place ID that can be used to retrieve details about this place using the place details service (see {@link google.maps.places.PlacesService.getDetails}). */ - TRAFFIC_JAM = 'TRAFFIC_JAM', + place_id?: string; + /** + * Information about individual terms in the above description. Categorical terms come first (for example, "restaurant"). Address terms appear from most to least specific. For example, "San Francisco", and "CA". + */ + terms: google.maps.places.PredictionTerm[]; } - export type SpeedString = `${google.maps.routes.Speed}`; /** - * Traffic density indicator on a contiguous segment of a polyline or path. Given a path with points P_0, P_1, ... , P_N (zero-based index), the SpeedReadingInterval describes the traffic density of an interval. - * Access by calling `const {SpeedReadingInterval} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A QueryAutocompletion request to be sent to the QueryAutocompleteService. */ - export class SpeedReadingInterval { + export interface QueryAutocompletionRequest { /** - * The ending index of this interval in the polyline. + * Bounds for prediction biasing. Predictions will be biased towards, but not restricted to, the given bounds. Both location and radius will be ignored if bounds is set. */ - get endPolylinePointIndex(): number | null | undefined; + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * Traffic speed in this interval. + * The user entered input string. */ - get speed(): google.maps.routes.SpeedString | null | undefined; + input: string; /** - * The starting index of this interval in the polyline. + * Location for prediction biasing. Predictions will be biased towards the given location and radius. Alternatively, bounds can be used. */ - get startPolylinePointIndex(): number | null | undefined; - } - /** - * Encapsulates toll information on a {@link google.maps.routes.Route} or {@link google.maps.routes.RouteLeg}. - * Access by calling `const {TollInfo} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class TollInfo { + location?: google.maps.LatLng; /** - * The monetary amount of tolls for the corresponding {@link google.maps.routes.Route} or {@link google.maps.routes.RouteLeg}. This list contains an amount for each currency that is expected to be charged by toll stations. Typically this list will contain only one item for routes with tolls in one currency. For international trips, this list may contain multiple items to reflect tolls in different currencies. This field may be an empty array if tolls are expected but the estimated price is unknown. + * The character position in the input term at which the service uses text for predictions (the position of the cursor in the input field). */ - get estimatedPrices(): google.maps.places.Money[] | null | undefined; + offset?: number; /** - * Converts to a plain object. + * The radius of the area used for prediction biasing. The radius is specified in meters, and must always be accompanied by a location property. Alternatively, bounds can be used. */ - toJSON(key?: string): unknown; + radius?: number; } /** - * Extra computations to perform while completing the request. See the web service documentation for more information. + * Ranking options for a PlaceSearchRequest. * - * Access by calling `const {ComputeRouteMatrixExtraComputation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {RankBy} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum ComputeRouteMatrixExtraComputation { + export enum RankBy { /** - * Toll information for the matrix element(s). See the web service documentation for more information. + * Ranks place results by distance from the location. */ - TOLLS = 'TOLLS', + DISTANCE = 0, + /** + * Ranks place results by their prominence. + */ + PROMINENCE = 0, } - export type ComputeRouteMatrixExtraComputationString = `${google.maps.routes.ComputeRouteMatrixExtraComputation}`; /** - * A set of values describing the vehicle's emission type. See the web service documentation for more information. - * - * Access by calling `const {VehicleEmissionType} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Information about a review of a Place. + * Access by calling `const {Review} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum VehicleEmissionType { + export class Review { /** - * Diesel fueled vehicle. See the web service documentation for more information. + * The reviewer. */ - DIESEL = 'DIESEL', + get authorAttribution(): google.maps.places.AuthorAttribution | null; /** - * Electricity powered vehicle. See the web service documentation for more information. + * A link where user can flag a problem with the review. */ - ELECTRIC = 'ELECTRIC', + get flagContentURI(): string | null; /** - * Gasoline/petrol fueled vehicle. See the web service documentation for more information. + * A link to show the review on Google Maps. */ - GASOLINE = 'GASOLINE', + get googleMapsURI(): string | null; /** - * Hybrid fuel (such as gasoline + electric) vehicle. See the web service documentation for more information. + * The review text in its original language. */ - HYBRID = 'HYBRID', - } - export type VehicleEmissionTypeString = `${google.maps.routes.VehicleEmissionType}`; - /** - * Contains the vehicle information, such as the vehicle emission type. - */ - export interface VehicleInfo { + get originalText(): string | null; /** - * Describes the vehicle's emission type. Applies only to the DRIVING travel mode. + * An IETF language code indicating the original language of the review. */ - emissionType?: google.maps.routes.VehicleEmissionTypeString | null; - } - /** - * Encapsulates a set of optional conditions to satisfy when calculating routes. - */ - export interface RouteModifiers { + get originalTextLanguageCode(): string | null; + + get publishTime(): Date | null; /** - * When set to true, avoids ferries where reasonable, giving preference to routes not containing ferries. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. + * The rating of this review, a number between 1.0 and 5.0 (inclusive). */ - avoidFerries?: boolean | null; + get rating(): number | null; /** - * When set to true, avoids highways where reasonable, giving preference to routes not containing highways. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. + * A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. For example `"a month ago"'. */ - avoidHighways?: boolean | null; + get relativePublishTimeDescription(): string | null; /** - * When set to true, avoids navigating indoors where reasonable, giving preference to routes not containing indoor navigation. Applies only to WALKING {@link google.maps.TravelMode}. + * The localized text of the review. */ - avoidIndoor?: boolean | null; + get text(): string | null; /** - * When set to true, avoids toll roads where reasonable, giving preference to routes not containing toll roads. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. + * An IETF language code indicating the localized language of the review. */ - avoidTolls?: boolean | null; + get textLanguageCode(): string | null; /** - * Encapsulates information about toll passes. If toll passes are provided, the API tries to return the pass price. If toll passes are not provided, the API treats the toll pass as unknown and tries to return the cash price. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. See TollPass for a list of valid values. + * The month of the date when the review author visited the place. This field is 0-based; 0 is January, and 11 is December. */ - tollPasses?: Iterable | null; + get visitDateMonth(): number | null; /** - * Specifies the vehicle information. + * The year of the date when the review author visited the place. */ - vehicleInfo?: google.maps.routes.VehicleInfo | null; + get visitDateYear(): number | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } /** - * A set of values that specify factors to take into consideration when calculating the route. See the web service documentation for more information. - * - * Access by calling `const {RoutingPreference} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * AI-generated summary of the place user reviews. + * Access by calling `const {ReviewSummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum RoutingPreference { + export class ReviewSummary { /** - * Calculates routes taking live traffic conditions into consideration. See the web service documentation for more information. + * The text for the disclosure relating to this summary. + */ + get disclosureText(): string | null; + /** + * The language code of the disclosure text. + */ + get disclosureTextLanguageCode(): string | null; + /** + * A URI to report a problem with the summary. + */ + get flagContentURI(): string | null; + /** + * A URI to show reviews of this place on Google Maps. + */ + get reviewsURI(): string | null; + /** + * The summary of user reviews. */ - TRAFFIC_AWARE = 'TRAFFIC_AWARE', + get text(): string | null; /** - * Calculates the routes taking live traffic conditions into consideration, without applying most performance optimizations. See the web service documentation for more information. + * The language code of the summary of user reviews. */ - TRAFFIC_AWARE_OPTIMAL = 'TRAFFIC_AWARE_OPTIMAL', + get textLanguageCode(): string | null; /** - * Computes routes without taking live traffic conditions into consideration. See the web service documentation for more information. + * Converts to a plain object. */ - TRAFFIC_UNAWARE = 'TRAFFIC_UNAWARE', + toJSON(key?: string): unknown; } - export type RoutingPreferenceString = `${google.maps.routes.RoutingPreference}`; /** - * Preferences for TRANSIT based routes that influence the route that is returned. + * A widget that provides query predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered. + * Access by calling `const {SearchBox} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated As of March 1st, 2025, google.maps.places.SearchBox is not available to new customers. At this time, google.maps.places.SearchBox is not scheduled to be discontinued and will continue to receive bug fixes for any major regressions. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/legacy for additional details. */ - export interface TransitPreference { + export class SearchBox extends google.maps.MVCObject { /** - * A set of travel modes to use when getting a TRANSIT route. Defaults to all supported modes of travel. + * Creates a new instance of SearchBox that attaches to the specified input text field with the given options. + * @param inputField + * @param opts */ - allowedTransitModes?: Iterable; + constructor(inputField: HTMLInputElement, opts?: google.maps.places.SearchBoxOptions | null); /** - * A routing preference that, when specified, influences the TRANSIT route returned. + * Returns the bounds to which query predictions are biased. */ - routingPreference?: google.maps.TransitRoutePreferenceString; + getBounds(): google.maps.LatLngBounds | undefined; + /** + * Returns the query selected by the user to be used with places_changed event. + */ + getPlaces(): google.maps.places.PlaceResult[] | undefined; + /** + * Sets the region to use for biasing query predictions. Results will only be biased towards this area and not be completely restricted to it. + */ + setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): void; } /** - * Object literals are accepted in place of {@link google.maps.routes.DirectionalLocation} instances as a convenience. These are converted to {@link google.maps.routes.DirectionalLocation} when the Maps JS API encounters them. + * The options that can be set on a SearchBox object. */ - export interface DirectionalLocationLiteral extends google.maps.LatLngAltitudeLiteral { + export interface SearchBoxOptions { /** - * The compass heading associated with the direction of the flow of traffic. Heading values can be numbers from 0 to 360, where 0 specifies a heading of due North, 90 specifies a heading of due East, and so on. You can use this field only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode}. + * The area towards which to bias query predictions. Predictions are biased towards, but not restricted to, queries targeting these bounds. */ - heading?: number | null; + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null; } /** - * Encapsulates a geographic point and an optional heading. - * Access by calling `const {DirectionalLocation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * How results will be ranked in the response. See the web service documentation for more information. + * + * Access by calling `const {SearchByTextRankPreference} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class DirectionalLocation extends google.maps.LatLngAltitude implements google.maps.routes.DirectionalLocationLiteral { + export enum SearchByTextRankPreference { /** - * The compass heading associated with the direction of the flow of traffic. Heading values can be numbers from 0 to 360, where 0 specifies a heading of due North, 90 specifies a heading of due East, and so on. You can use this field only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode}. + * Ranks results by distance. See the web service documentation for more information. */ - get heading(): number | null | undefined; + DISTANCE = 'DISTANCE', /** - * Converts to a plain object. + * Ranks results by relevance. See the web service documentation for more information. */ - toJSON(key?: string): google.maps.routes.DirectionalLocationLiteral; + RELEVANCE = 'RELEVANCE', } + export type SearchByTextRankPreferenceString = `${google.maps.places.SearchByTextRankPreference}`; /** - * Represents a waypoint in a route. + * Request interface for {@link google.maps.places.Place.searchByText}. */ - export interface Waypoint { + export interface SearchByTextRequest { /** - * The location of the waypoint. A string may be an address, a plus code, or a Place resource name. + * EV-related options that can be specified for a place search request. */ - location: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place; + evSearchOptions?: google.maps.places.EVSearchOptions; /** - * Indicates that the location of this waypoint is meant to have a preference for the vehicle to stop at a particular side of road. When you set this value, the route will pass through the location so that the vehicle can stop at the side of road that the location is biased towards from the center of the road. This option works only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode} + * Fields to be included in the response, which will be billed for. If ['*'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). You can request any property in the {@link google.maps.places.Place} class as a field. */ - sideOfRoad?: boolean | null; + fields: string[]; /** - * Indicates that the waypoint is meant for vehicles to stop at, where the intention is to either pickup or drop-off. When you set this value, the calculated route won't include non-via waypoints on roads that are unsuitable for pickup and drop-off. This option works only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode} and when the {@link google.maps.routes.Waypoint.location} is not a string or a {@link google.maps.places.Place}. + * Include places that are not yet open but are expected to open in the future. */ - vehicleStopover?: boolean | null; + futureOpeningBusinessesIncluded?: boolean; /** - * Marks this waypoint as a milestone rather a stopping point. For each non-via waypoint in the {@link google.maps.routes.ComputeRoutesRequest}, {@link google.maps.routes.Route.computeRoutes} appends an entry to the {@link google.maps.routes.Route.legs} array to provide the details for stopovers on that leg of the trip.

Set this value to true when you want the route to pass through this waypoint without stopping over. Via waypoints don't cause an entry to be added to the {@link google.maps.routes.Route.legs} array, but they do route the journey through the waypoint.

Notes:
  • You can only set this value on waypoints that are intermediates. The request fails if you set this field on terminal waypoints.
  • If {@link google.maps.routes.ComputeRoutesRequest.optimizeWaypointOrder} is set to true, this field cannot be set to true; otherwise, the request fails.
+ * The requested place type. Full list of types supported: https://developers.google.com/maps/documentation/places/web-service/place-types. Only one included type is supported. See {@link google.maps.places.SearchByTextRequest.useStrictTypeFiltering} */ - via?: boolean | null; - } - /** - * Request for a route matrix. - */ - export interface ComputeRouteMatrixRequest { + includedType?: string; /** - * The arrival time.

Note: Can only be set when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT. You can specify either {@link google.maps.routes.ComputeRouteMatrixRequest.departureTime} or {@link google.maps.routes.ComputeRouteMatrixRequest.arrivalTime}, but not both. Transit trips are available for up to 7 days in the past or 100 days in the future. + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - arrivalTime?: Date; + internalUsageAttributionIds?: Iterable | null; /** - * The departure time. If you don't set this value, then this value defaults to the time that you made the request.

Note: You can only specify a time in the past when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT. Transit trips are available for up to 7 days in the past or 100 days in the future. + * Used to restrict the search to places that are currently open. + * @defaultValue false */ - departureTime?: Date; + isOpenNow?: boolean; /** - * Array of destinations, which determines the columns of the response matrix. A value passed as a string may be an address, a plus code, or a Place resource name. Altitude values are not taken into consideration. + * Place details will be displayed with the preferred language if available. Will default to the browser's language preference. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. */ - destinations: Iterable; + language?: string; /** - * A list of extra computations which may be used to complete the request.

Note: These extra computations may return extra fields on the response. These extra fields must also be specified in {@link google.maps.routes.ComputeRouteMatrixRequest.fields} to be returned in the response. + * The region to search. This location serves as a bias which means results around given location might be returned. Cannot be set along with locationRestriction. */ - extraComputations?: Iterable; + locationBias?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | google.maps.CircleLiteral | google.maps.Circle; /** - * Collection of fields to be fetched. Specify ["*"] for all fields. + * The region to search. This location serves as a restriction which means results outside given location will not be returned. Cannot be set along with locationBias. */ - fields: Iterable; + locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Maximum number of results to return. It must be between 1 and 20, inclusively. */ - internalUsageAttributionIds?: Iterable | null; + maxResultCount?: number; /** - * The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Unicode Locale Identifier. See Language Support for the list of supported languages. When you don't provide this value, the language is inferred from your Google Maps JavaScript API localization settings. Otherwise, the language is inferred from the location of the first origin. + * Filter out results whose average user rating is strictly less than this limit. A valid value must be an float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating will be rounded up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all results with a less than 1.0 rating. */ - language?: string; + minRating?: number; /** - * Array of origins, which determines the rows of the response matrix. A value passed as a string may be an address, a plus code, or a Place resource name. Altitude values are not taken into consideration.

Several size restrictions apply to the cardinality of origins and destinations:
  • The total number of origins and destinations specified as strings or {@link google.maps.places.Place}s must be no greater than 50.
  • The product of the number of origins and the number of destinations must be no greater than 625.
  • The product of the number of origins and destinations must be no greater than 100 if {@link google.maps.routes.ComputeRouteMatrixRequest.routingPreference} is set to TRAFFIC_AWARE_OPTIMAL.
  • The product of the number of origins and destinations must be no greater than 100 if {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT.
+ * Used to restrict the search to places that are marked as certain price levels. Any combinations of price levels can be chosen. Defaults to all price levels. */ - origins: Iterable; + priceLevels?: google.maps.places.PriceLevelString[]; /** - * The region code, specified as a ccTLD ("top-level domain") two-character value. For more information see Country code top-level domains. When you don't provide this value, the region is inferred from your Google Maps JavaScript API localization settings. Otherwise, the region is inferred from the location of the first origin. + * Include pure service area businesses if the field is set to true. A pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers may not have a physical address or location on Google Maps. Places will not return fields including location, plusCode, and other location related fields for these businesses. */ - region?: string; + pureServiceAreaBusinessesIncluded?: boolean; /** - * Specifies how to compute the route matrix. The server attempts to use the selected routing preference to compute the route matrix. If the routing preference results in an error or an extra long latency, an error is returned. You can specify this option only when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is DRIVING or TWO_WHEELER, otherwise the request fails. + * How results will be ranked in the response. + * @defaultValue SearchByTextRankPreference.RELEVANCE */ - routingPreference?: google.maps.routes.RoutingPreferenceString; + rankPreference?: google.maps.places.SearchByTextRankPreferenceString; /** - * Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in {@link google.maps.routes.RouteMatrixItem.durationMillis} which contains the predicted time in traffic based on historical averages. {@link google.maps.routes.ComputeRouteMatrixRequest.trafficModel} is only available for requests that have set {@link google.maps.routes.ComputeRouteMatrixRequest.routingPreference} to TRAFFIC_AWARE_OPTIMAL and {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} to DRIVING. Defaults to BEST_GUESS. + * The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. */ - trafficModel?: google.maps.TrafficModelString; + region?: string; /** - * Specifies preferences that influence the route returned for TRANSIT routes.

Note: Can only be specified when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT. + * Required when you do not use {@link google.maps.places.SearchByTextRequest.query}. The text query for textual search. */ - transitPreference?: google.maps.routes.TransitPreference; + textQuery?: string; /** - * Specifies the mode of transportation. + * Used to set strict type filtering for {@link google.maps.places.SearchByTextRequest.includedType}. If set to true, only results of the same type will be returned. + * @defaultValue false */ - travelMode?: google.maps.TravelModeString; + useStrictTypeFiltering?: boolean; /** - * Specifies the units of measure for the display fields. If you don't provide this value, then the display units are inferred from the location of the first origin. + * @deprecated Please use textQuery instead */ - units?: google.maps.UnitSystem; + query?: string; + /** + * Available only in the v=beta channel: https://goo.gle/3oAthT3. + * @deprecated Please use rankPreference instead. + */ + rankBy?: google.maps.places.SearchByTextRankPreferenceString; } /** - * Extra computations to perform while completing the request. See the web service documentation for more information. + * How results will be ranked in the response. See the web service documentation for more information. * - * Access by calling `const {ComputeRoutesExtraComputation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {SearchNearbyRankPreference} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum ComputeRoutesExtraComputation { + export enum SearchNearbyRankPreference { /** - * Flyover information for the route(s). See the web service documentation for more information. + * Ranks results by distance. See the web service documentation for more information. */ - FLYOVER_INFO_ON_POLYLINE = 'FLYOVER_INFO_ON_POLYLINE', + DISTANCE = 'DISTANCE', /** - * Estimated fuel consumption for the route(s). See the web service documentation for more information. + * Ranks results by popularity. See the web service documentation for more information. */ - FUEL_CONSUMPTION = 'FUEL_CONSUMPTION', + POPULARITY = 'POPULARITY', + } + export type SearchNearbyRankPreferenceString = `${google.maps.places.SearchNearbyRankPreference}`; + /** + * Request interface for {@link google.maps.places.Place.searchNearby}. For more information on the request, see Places API reference. + */ + export interface SearchNearbyRequest { /** - * See the web service documentation for more information. + * Excluded primary place types. See the full list of types supported. A place can only have a single primary type. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. */ - HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 'HTML_FORMATTED_NAVIGATION_INSTRUCTIONS', + excludedPrimaryTypes?: string[]; /** - * Narrow road information for the route(s). See the web service documentation for more information. + * Excluded place types. See the full list of types supported. A place can have many different place types. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. */ - NARROW_ROAD_INFO_ON_POLYLINE = 'NARROW_ROAD_INFO_ON_POLYLINE', + excludedTypes?: string[]; /** - * Toll information for the route(s). See the web service documentation for more information. + * Fields to be included in the response, which will be billed for. If ['*'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). You can request any property in the {@link google.maps.places.Place} class as a field. */ - TOLLS = 'TOLLS', + fields: string[]; /** - * Traffic aware polylines for the route(s). See the web service documentation for more information. + * Include places that are not yet open but are expected to open in the future. */ - TRAFFIC_ON_POLYLINE = 'TRAFFIC_ON_POLYLINE', - } - export type ComputeRoutesExtraComputationString = `${google.maps.routes.ComputeRoutesExtraComputation}`; - /** - * A set of values that specify the quality of the polyline. See the web service documentation for more information. - * - * Access by calling `const {PolylineQuality} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum PolylineQuality { + futureOpeningBusinessesIncluded?: boolean; /** - * Specifies a high-quality polyline - which is composed using more points than OVERVIEW, at the cost of increased response size. See the web service documentation for more information. + * Included primary place types. See the full list of types supported. A place can only have a single primary type. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. */ - HIGH_QUALITY = 'HIGH_QUALITY', + includedPrimaryTypes?: string[]; /** - * Specifies an overview polyline - which is composed using a small number of points. See the web service documentation for more information. + * Included place types. See the full list of types supported. A place can have many different place types. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. */ - OVERVIEW = 'OVERVIEW', + includedTypes?: string[]; + /** + * Identifiers used to attribute calls to specific packages or OSS libraries. + */ + internalUsageAttributionIds?: Iterable | null; + /** + * Place details will be displayed with the preferred language if available. Will default to the browser's language preference. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. + */ + language?: string; + /** + * The region to search, specified as a circle with center and radius. Results outside given location are not returned. + */ + locationRestriction: google.maps.Circle | google.maps.CircleLiteral; + /** + * Maximum number of results to return. For acceptable values and default, see Places API reference. + */ + maxResultCount?: number; + /** + * How results will be ranked in the response. + * @defaultValue SearchNearbyRankPreference.POPULARITY + */ + rankPreference?: google.maps.places.SearchNearbyRankPreferenceString; + /** + * The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. + */ + region?: string; } - export type PolylineQualityString = `${google.maps.routes.PolylineQuality}`; /** - * A supported reference route on the ComputeRoutesRequest. See the web service documentation for more information. - * - * Access by calling `const {ReferenceRoute} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Information about secondary business hours of a Place. + * Access by calling `const {SecondaryOpeningHours} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum ReferenceRoute { + export class SecondaryOpeningHours extends google.maps.places.OpeningHours { /** - * Fuel efficient route. See the web service documentation for more information. + * The type of secondary opening hours. This refers to what the secondary hours apply to like takeout, delivery, or pickup. See SecondaryHoursType for a list of valid values. */ - FUEL_EFFICIENT = 'FUEL_EFFICIENT', + get type(): string | null; /** - * Route with shorter travel distance. See the web service documentation for more information. + * Converts to a plain object. */ - SHORTER_DISTANCE = 'SHORTER_DISTANCE', + toJSON(key?: string): unknown; } - export type ReferenceRouteString = `${google.maps.routes.ReferenceRoute}`; /** - * Request for routes. + * Defines the spatial relationship between the target location and the landmark. See the web service documentation for more information. + * + * Access by calling `const {SpatialRelationship} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface ComputeRoutesRequest { - /** - * The arrival time.

Note: Can only be set when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is set to TRANSIT. You can specify either {@link google.maps.routes.ComputeRoutesRequest.departureTime} or {@link google.maps.routes.ComputeRoutesRequest.arrivalTime}, but not both. Transit trips are available for up to 7 days in the past or 100 days in the future. - */ - arrivalTime?: Date; + export enum SpatialRelationship { /** - * Specifies whether to calculate alternate routes in addition to the route. No alternative routes are returned for requests that have intermediate waypoints. + * The target is directly opposite the landmark on the other side of the road. See the web service documentation for more information. */ - computeAlternativeRoutes?: boolean; + ACROSS_THE_ROAD = 'ACROSS_THE_ROAD', /** - * The departure time. If you don't set this value, then this value defaults to the time that you made the request.

Note: You can only specify a time in the past when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is set to TRANSIT. Transit trips are available for up to 7 days in the past or 100 days in the future. + * Not on the same route as the landmark but a single turn away. See the web service documentation for more information. */ - departureTime?: Date; + AROUND_THE_CORNER = 'AROUND_THE_CORNER', /** - * The destination of the route. A value passed as a string may be an address, plus code, or a Place resource name. Altitude values are not taken into consideration for computing routes. + * Close to the landmark's structure but further away from its street entrances. See the web service documentation for more information. */ - destination: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint; + BEHIND = 'BEHIND', /** - * A list of extra computations which may be used to complete the request.

Note: These extra computations may return extra fields on the response. These extra fields must also be specified in {@link google.maps.routes.ComputeRoutesRequest.fields} to be returned in the response. + * The target is directly adjacent to the landmark. See the web service documentation for more information. */ - extraComputations?: Iterable; + BESIDE = 'BESIDE', /** - * Collection of fields to be fetched. Specify ["*"] for all fields. + * On the same route as the landmark but not besides or across. See the web service documentation for more information. */ - fields: Iterable; + DOWN_THE_ROAD = 'DOWN_THE_ROAD', /** - * A set of waypoints along the route (excluding terminal points), for either stopping at or passing by. Up to 25 intermediate waypoints are supported. + * This is the default relationship when nothing more specific below applies. See the web service documentation for more information. */ - intermediates?: Iterable; + NEAR = 'NEAR', /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The landmark has a spatial geometry and the target is within its bounds. See the web service documentation for more information. */ - internalUsageAttributionIds?: Iterable | null; + WITHIN = 'WITHIN', + } + export type SpatialRelationshipString = `${google.maps.places.SpatialRelationship}`; + /** + * Identifies a substring within a given text. + * Access by calling `const {StringRange} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class StringRange { /** - * The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Unicode Locale Identifier. See Language Support for the list of supported languages. When you don't provide this value, the language is inferred from your Google Maps JavaScript API localization settings. Otherwise, the language is inferred from the location of the origin. + * Zero-based offset of the last Unicode character of the substring (exclusive). */ - language?: string; + get endOffset(): number; /** - * If set to true, the service attempts to minimize the overall cost of the route by re-ordering the specified intermediate waypoints. The request fails if any of the intermediate waypoints is a via waypoint. Use {@link google.maps.routes.Route.optimizedIntermediateWaypointIndices} in the response to find the new ordering. If "optimizedIntermediateWaypointIndices" is not requested in {@link google.maps.routes.ComputeRoutesRequest.fields}, the request fails. If set to false, {@link google.maps.routes.Route.optimizedIntermediateWaypointIndices} in the response will be empty. + * Zero-based offset of the first Unicode character of the substring (inclusive). */ - optimizeWaypointOrder?: boolean; + get startOffset(): number; + } + /** + * Contains structured information about the place's description, divided into a main text and a secondary text, including an array of matched substrings from the autocomplete input, identified by an offset and a length, expressed in unicode characters. + */ + export interface StructuredFormatting { /** - * The origin of the route. A value passed as a string may be an address, plus code, or a Place resource name. Altitude values are not taken into consideration for computing routes. + * This is the main text part of the unformatted description of the place suggested by the Places service. Usually the name of the place. */ - origin: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint; + main_text: string; /** - * Specifies the preference for the quality of the polyline. + * A set of substrings in the main text that match elements in the user's input, suitable for use in highlighting those substrings. Each substring is identified by an offset and a length, expressed in unicode characters. */ - polylineQuality?: google.maps.routes.PolylineQualityString; + main_text_matched_substrings: google.maps.places.PredictionSubstring[]; /** - * The region code, specified as a ccTLD ("top-level domain") two-character value. For more information see Country code top-level domains. When you don't provide this value, the region is inferred from your Google Maps JavaScript API localization settings. Otherwise, the region is inferred from the location of the origin. + * This is the secondary text part of the unformatted description of the place suggested by the Places service. Usually the location of the place. */ - region?: string; + secondary_text: string; + } + /** + * A text search request to be sent to the PlacesService. + */ + export interface TextSearchRequest { /** - * Specifies what reference routes to calculate as part of the request in addition to the default route. A reference route is a route with a different route calculation objective than the default route. For example a FUEL_EFFICIENT reference route calculation takes into account various parameters that would generate an optimal fuel efficient route. When using this feature, look for {@link google.maps.routes.Route.routeLabels} on the resulting routes. + * Bounds used to bias results when searching for Places (optional). Both location and radius will be ignored if bounds is set. Results will not be restricted to those inside these bounds; but, results inside it will rank higher. */ - requestedReferenceRoutes?: Iterable; + bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; /** - * A set of conditions to satisfy that affect the way routes are calculated. For example you can specify features to avoid such as toll roads or highways. + * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages. */ - routeModifiers?: google.maps.routes.RouteModifiers; + language?: string | null; /** - * Specifies how to compute the route. The server attempts to use the selected routing preference to compute the route. If the routing preference results in an error or an extra long latency, an error is returned. You can specify this option only when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is DRIVING or TWO_WHEELER, otherwise the request fails. + * The center of the area used to bias results when searching for Places. */ - routingPreference?: google.maps.routes.RoutingPreferenceString; + location?: google.maps.LatLng | google.maps.LatLngLiteral; /** - * Specifies the assumptions to use when calculating time in traffic. This setting affects the value of {@link google.maps.routes.Route.durationMillis} and {@link google.maps.routes.RouteLeg.durationMillis} which contain the predicted time in traffic based on historical averages. {@link google.maps.routes.ComputeRoutesRequest.trafficModel} is only available for requests that have set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to TRAFFIC_AWARE_OPTIMAL and {@link google.maps.routes.ComputeRoutesRequest.travelMode} to DRIVING. Defaults to BEST_GUESS. + * The request's query term. For example, the name of a place ('Eiffel Tower'), a category followed by the name of a location ('pizza in New York'), or the name of a place followed by a location disambiguator ('Starbucks in Sydney'). */ - trafficModel?: google.maps.TrafficModelString; + query?: string; /** - * Specifies preferences that influence the route returned for TRANSIT routes.

Note: Can only be specified when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is set to TRANSIT. + * The radius of the area used to bias results when searching for Places, in meters. */ - transitPreference?: google.maps.routes.TransitPreference; + radius?: number; /** - * Specifies the mode of transportation. + * A region code to bias results towards. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" (.co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). */ - travelMode?: google.maps.TravelModeString; + region?: string | null; /** - * Specifies the units of measure for the display fields, such as navigation instructions. The units of measure used for the route, leg, step distance, and duration are not affected by this value. If you don't provide this value, then the display units are inferred from the location of the origin. + * Searches for places of the given type. The type is translated to the local language of the request's target location and used as a query string. If a query is also provided, it is concatenated to the localized type string. Results of a different type are dropped from the response. Use this field to perform language and region independent categorical searches. Valid types are given here. */ - units?: google.maps.UnitSystem; + type?: string; } /** - * An error that occurred during {@link google.maps.routes.RouteMatrix.computeRouteMatrix} for a specific origin/destination pair. - * Access by calling `const {RouteMatrixItemError} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a time zone from the IANA Time Zone Database https://www.iana.org/time-zones. + * Access by calling `const {TimeZone} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class RouteMatrixItemError extends Error { + export class TimeZone { + /** + * IANA Time Zone Database time zone. For example "America/New_York". + */ + get id(): string | null; + /** + * IANA Time Zone Database version number. For example "2019a". + */ + get version(): string | null; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Reasons for using fallback response. See the web service documentation for more information. - * - * Access by calling `const {FallbackReason} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a transit agency. + * Access by calling `const {TransitAgency} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum FallbackReason { + export class TransitAgency { /** - * We were not able to finish the calculation with your preferred routing mode on time, but we were able to return a result calculated by an alternative mode. See the web service documentation for more information. + * The name of the agency in the requested language. */ - LATENCY_EXCEEDED = 'LATENCY_EXCEEDED', + displayName: string | null; /** - * A server error happened while calculating routes with your preferred routing mode, but we were able to return a result calculated by an alternative mode. See the web service documentation for more information. + * The agency name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - SERVER_ERROR = 'SERVER_ERROR', - } - export type FallbackReasonString = `${google.maps.routes.FallbackReason}`; - /** - * Actual routing mode used for returned fallback response. See the web service documentation for more information. - * - * Access by calling `const {FallbackRoutingMode} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export enum FallbackRoutingMode { + displayNameLanguageCode: string | null; /** - * See the web service documentation for more information. + * The URL of the agency's fare details page. */ - TRAFFIC_AWARE = 'TRAFFIC_AWARE', + fareURL: URL | null; /** - * See the web service documentation for more information. + * A localized branded icon of a transit system. */ - TRAFFIC_UNAWARE = 'TRAFFIC_UNAWARE', + icon: google.maps.places.TransitIcon | null; + /** + * The transit lines that are served by this agency. + */ + lines: google.maps.places.TransitLine[]; + /** + * The URL of the agency's homepage. + */ + url: URL | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } - export type FallbackRoutingModeString = `${google.maps.routes.FallbackRoutingMode}`; /** - * Information related to how and why a fallback result was used in a {@link google.maps.routes.Route.computeRoutes} response. If this field is set, then it means the server used a different routing mode from your preferred mode as fallback. - * Access by calling `const {FallbackInfo} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a transit icon. + * Access by calling `const {TransitIcon} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class FallbackInfo { + export class TransitIcon { /** - * The reason why fallback response was used instead of the original response. This field is only populated when the fallback mode is triggered and the fallback response is returned. + * Whether the name is contained in the icon and there is no need to display it next to the icon. */ - get reason(): google.maps.routes.FallbackReasonString | null | undefined; + nameIncluded: boolean | null; /** - * Routing mode used for the response. If fallback was triggered, the mode may be different from routing preference set in the original client request. + * The URL of the icon. */ - get routingMode(): google.maps.routes.FallbackRoutingModeString | null | undefined; + url: URL | null; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Geocoding about the locations used as waypoints. Only populated for address waypoints. Includes details about the geocoding results for the purposes of determining what the address was geocoded to. - * Access by calling `const {GeocodedWaypoint} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a transit line. + * Access by calling `const {TransitLine} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class GeocodedWaypoint { + export class TransitLine { /** - * Indicates the status code resulting from the geocoding operation. + * The background color of the labels for this transit line in hexadecimal format (e.g., "#909CE1"). This color can also be used for drawing shapes for this transit line. */ - get geocoderStatus(): google.maps.RPCStatusString | null; + backgroundColor: string | null; /** - * The index of the corresponding intermediate waypoint in the request. Only populated if the corresponding waypoint is an intermediate waypoint. + * The full name of this transit line (e.g., "Sunnydale local"). */ - get intermediateWaypointRequestIndex(): number | null; + displayName: string | null; /** - * Indicates that the geocoder did not return an exact match for the original request, though it was able to match part of the requested address. You may wish to examine the original request for misspellings and/or an incomplete address. + * The transit line full name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get partialMatch(): boolean; + displayNameLanguageCode: string | null; /** - * The place ID for this result. + * Icon for this particular line. */ - get placeId(): string; + icon: google.maps.places.TransitIcon | null; /** - * The type(s) of the result, in the form of zero or more type tags. See https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types for supported types. + * The id of the transit line that can be used to uniquely identify the line among other transit lines in the same transit station. This identifier is not guaranteed to be stable across different responses. */ - get types(): string[]; + id: string | null; /** - * Converts to a plain object. + * The short name of this transit line (e.g., "S2"). */ - toJSON(key?: string): unknown; - } - /** - * Contains {@link google.maps.routes.GeocodedWaypoint}s for origin, destination, and intermediate waypoints. Only populated for address waypoints. - * Access by calling `const {GeocodingResults} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class GeocodingResults { + shortDisplayName: string | null; /** - * The geocoded waypoint for the destination. + * The transit line short name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get destination(): google.maps.routes.GeocodedWaypoint | null | undefined; + shortDisplayNameLanguageCode: string | null; /** - * A list of intermediate geocoded waypoints each containing an index field that corresponds to the zero-based position of the waypoint in the order they were specified in the request. + * The text color of labels for this transit line in hexadecimal format (e.g., "#909CE1"). */ - get intermediates(): google.maps.routes.GeocodedWaypoint[] | undefined; + textColor: string | null; /** - * The geocoded waypoint for the origin. + * The URL of a webpage with details about this line. */ - get origin(): google.maps.routes.GeocodedWaypoint | null | undefined; + url: URL | null; + /** + * Icon for this particular vehicle type. + */ + vehicleIcon: google.maps.places.TransitIcon | null; + /** + * The type of vehicle used. + */ + vehicleType: google.maps.places.TransitVehicleTypeString | null; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Provides summarized information about a multi-modal segment of the {@link google.maps.routes.RouteLeg.steps} of a route. A multi-modal segment is defined as one or more contiguous {@link google.maps.routes.RouteLegStep}'s that have the same {@link google.maps.TravelMode}. - * Access by calling `const {MultiModalSegment} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents transit-specific information for a place. + * Access by calling `const {TransitStation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class MultiModalSegment { - /** - * Instructions for navigating this multi-modal segment. - */ - get instructions(): string | null; + export class TransitStation { /** - * The navigation maneuver to perform at this step. See Maneuver for a list of possible values. + * The transit agencies that serve this station. */ - get maneuver(): string | null; + agencies: google.maps.places.TransitAgency[]; /** - * The corresponding {@link google.maps.routes.RouteLegStep} index that is the end of a multi-modal segment. + * The name of the station in the local language. */ - get stepEndIndex(): number; + displayName: string | null; /** - * The corresponding {@link google.maps.routes.RouteLegStep} index that is the start of a multi-modal segment. + * The local display name text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get stepStartIndex(): number; + displayNameLanguageCode: string | null; /** - * The travel mode used for this multi-modal segment. + * The transit stops at this station. */ - get travelMode(): google.maps.TravelModeString | null; + stops: google.maps.places.TransitStop[]; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Encapsulates the states of road features along a stretch of polyline. See the web service documentation for more information. - * - * Access by calling `const {RoadFeatureState} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a transit stop. + * Access by calling `const {TransitStop} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum RoadFeatureState { + export class TransitStop { /** - * The road feature does not exist. See the web service documentation for more information. + * The name of the stop in the requested language. */ - DOES_NOT_EXIST = 'DOES_NOT_EXIST', + displayName: string | null; /** - * The road feature exists. See the web service documentation for more information. + * The name of the stop in the requested language's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - EXISTS = 'EXISTS', - } - export type RoadFeatureStateString = `${google.maps.routes.RoadFeatureState}`; - /** - * Encapsulates information about a road feature along a stretch of polyline. - * Access by calling `const {PolylineDetailInfo} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PolylineDetailInfo { + displayNameLanguageCode: string | null; + /** + * This field indicates whether there is an accessible path from outside the station to the stop. It does not indicate whether it is possible to board a vehicle from the stop. + */ + hasWheelchairAccessibleEntrance: boolean | null; /** - * The end index of this road feature in the polyline. + * The id of the transit stop that can be used to uniquely identify the stop among other transit stops in the same transit station. This identifier is not guaranteed to be stable across different responses. */ - get endIndex(): number | null; + id: string | null; /** - * Denotes whether the road feature exists along the polyline. + * The stop's location. */ - get presence(): google.maps.routes.RoadFeatureStateString | null; + location: google.maps.LatLngAltitude | null; /** - * The start index of this road feature in the polyline. + * The platform code represented by this stop. It can be formatted in any way (e.g., "2", "Platform 2", "2-4", or "1x"). */ - get startIndex(): number | null; + platformCode: string | null; /** - * Converts to a plain object. + * The platform code text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - toJSON(key?: string): unknown; - } - /** - * Details corresponding to a given index or contiguous segment of a polyline. Given a polyline with points P_0, P_1, ... , P_N (zero-based index), the PolylineDetails describes a road feature for a given interval. - * Access by calling `const {PolylineDetails} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class PolylineDetails { + platformCodeLanguageCode: string | null; /** - * Flyover details along the polyline. + * The verbatim text written on the signboard for this platform (e.g., "Towards Central" or "East side & Brooklyn"). When platformCode is absent, this field is potentially the only identifier for the platform. However, both platformCode and signageText may be set simultaneously. */ - get flyoverInfo(): google.maps.routes.PolylineDetailInfo[]; + signageText: string | null; /** - * Narrow road details along the polyline. + * The signage text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get narrowRoadInfo(): google.maps.routes.PolylineDetailInfo[]; + signageTextLanguageCode: string | null; + /** + * Human readable identifier of the stop, used by transit agencies to distinguish stops with the same name. + */ + stopCode: string | null; + /** + * The stop code text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + stopCodeLanguageCode: string | null; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * See the web service documentation for more information. + * The type of vehicle for a transit line. See the web service documentation for more information. * - * Access by calling `const {RouteLabel} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Access by calling `const {TransitVehicleType} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum RouteLabel { + export enum TransitVehicleType { /** - * The default "best" route returned for the route computation. See the web service documentation for more information. + * Airplane. See the web service documentation for more information. */ - DEFAULT_ROUTE = 'DEFAULT_ROUTE', + AIRPLANE = 'AIRPLANE', /** - * An alternative to the default "best" route. See the web service documentation for more information. + * Bus. See the web service documentation for more information. */ - DEFAULT_ROUTE_ALTERNATE = 'DEFAULT_ROUTE_ALTERNATE', + BUS = 'BUS', /** - * Fuel efficient route. See the web service documentation for more information. + * Cable car. See the web service documentation for more information. */ - FUEL_EFFICIENT = 'FUEL_EFFICIENT', + CABLE_CAR = 'CABLE_CAR', /** - * Shorter travel distance route. See the web service documentation for more information. + * Coach. See the web service documentation for more information. */ - SHORTER_DISTANCE = 'SHORTER_DISTANCE', - } - export type RouteLabelString = `${google.maps.routes.RouteLabel}`; - /** - * Text representations of the {@link google.maps.routes.RouteLeg}. - * Access by calling `const {RouteLegLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class RouteLegLocalizedValues { + COACH = 'COACH', /** - * Travel distance of the route leg in text form. + * Commuter train. See the web service documentation for more information. */ - get distance(): string | null; + COMMUTER_TRAIN = 'COMMUTER_TRAIN', /** - * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Ferry. See the web service documentation for more information. */ - get distanceLanguage(): string | null; + FERRY = 'FERRY', /** - * Duration, represented in text form and localized to the region of the query. Takes traffic conditions into consideration. + * Funicular. See the web service documentation for more information. */ - get duration(): string | null; + FUNICULAR = 'FUNICULAR', /** - * The duration text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Gondola lift. See the web service documentation for more information. */ - get durationLanguage(): string | null; + GONDOLA_LIFT = 'GONDOLA_LIFT', /** - * Duration without taking traffic conditions into consideration, represented in text form. + * Heavy rail. See the web service documentation for more information. */ - get staticDuration(): string | null; + HEAVY_RAIL = 'HEAVY_RAIL', /** - * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn". + * High speed train. See the web service documentation for more information. */ - get staticDurationLanguage(): string | null; + HIGH_SPEED_TRAIN = 'HIGH_SPEED_TRAIN', /** - * Converts to a plain object. + * Horse carriage. See the web service documentation for more information. */ - toJSON(key?: string): unknown; - } - /** - * Text representations of properties of the RouteLegStep. - * Access by calling `const {RouteLegStepLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class RouteLegStepLocalizedValues { + HORSE_CARRIAGE = 'HORSE_CARRIAGE', /** - * Travel distance of the route leg step in text form. + * Intercity bus. See the web service documentation for more information. */ - get distance(): string | null; + INTERCITY_BUS = 'INTERCITY_BUS', /** - * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Long distance train. See the web service documentation for more information. */ - get distanceLanguage(): string | null; + LONG_DISTANCE_TRAIN = 'LONG_DISTANCE_TRAIN', /** - * Duration without taking traffic conditions into consideration, represented in text form. + * Metro rail. See the web service documentation for more information. */ - get staticDuration(): string | null; + METRO_RAIL = 'METRO_RAIL', /** - * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Monorail. See the web service documentation for more information. */ - get staticDurationLanguage(): string | null; + MONORAIL = 'MONORAIL', /** - * Converts to a plain object. + * Rail. See the web service documentation for more information. */ - toJSON(key?: string): unknown; - } - /** - * Information about a transit agency. - * Access by calling `const {TransitAgency} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class TransitAgency { + RAIL = 'RAIL', /** - * The name of this transit agency. + * Share taxi. See the web service documentation for more information. */ - get name(): string | null; + SHARE_TAXI = 'SHARE_TAXI', /** - * The transit agency's locale-specific formatted phone number. + * Special. See the web service documentation for more information. */ - get phoneNumber(): string | null; + SPECIAL = 'SPECIAL', /** - * The transit agency's URL. + * Subway. See the web service documentation for more information. */ - get url(): URL | null; + SUBWAY = 'SUBWAY', /** - * Converts to a plain object. + * Tram. See the web service documentation for more information. */ - toJSON(key?: string): unknown; + TRAM = 'TRAM', + /** + * Trolleybus. See the web service documentation for more information. + */ + TROLLEYBUS = 'TROLLEYBUS', } + export type TransitVehicleTypeString = `${google.maps.places.TransitVehicleType}`; +} + +declare namespace google.maps.routes { /** - * Information about a vehicle used in transit routes. - * Access by calling `const {TransitVehicle} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Extra computations to perform while completing the request. See the web service documentation for more information. + * + * Access by calling `const {ComputeRouteMatrixExtraComputation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class TransitVehicle { + export enum ComputeRouteMatrixExtraComputation { /** - * The URL for an icon associated with this vehicle type. + * Toll information for the matrix element(s). See the web service documentation for more information. */ - get iconURL(): URL | null; + TOLLS = 'TOLLS', + } + export type ComputeRouteMatrixExtraComputationString = `${google.maps.routes.ComputeRouteMatrixExtraComputation}`; + /** + * Request for a route matrix. + */ + export interface ComputeRouteMatrixRequest { /** - * The URL for the icon associated with this vehicle type, based on the local transport signage. + * The arrival time.

Note: Can only be set when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT. You can specify either {@link google.maps.routes.ComputeRouteMatrixRequest.departureTime} or {@link google.maps.routes.ComputeRouteMatrixRequest.arrivalTime}, but not both. Transit trips are available for up to 7 days in the past or 100 days in the future. */ - get localIconURL(): URL | null; + arrivalTime?: Date; /** - * The name of this vehicle, capitalized. + * The departure time. If you don't set this value, then this value defaults to the time that you made the request.

Note: You can only specify a time in the past when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT. Transit trips are available for up to 7 days in the past or 100 days in the future. */ - get name(): string | null; + departureTime?: Date; /** - * The vehicle name text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information see: https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Array of destinations, which determines the columns of the response matrix. A value passed as a string may be an address, a plus code, or a Place resource name. Altitude values are not taken into consideration. */ - get nameLanguage(): string | null; + destinations: Iterable; /** - * The type of vehicle used.

See https://developers.google.com/maps/documentation/routes/reference/rpc/google.maps.routing.v2#transitvehicletype for a list of possible values. + * A list of extra computations which may be used to complete the request.

Note: These extra computations may return extra fields on the response. These extra fields must also be specified in {@link google.maps.routes.ComputeRouteMatrixRequest.fields} to be returned in the response. */ - get vehicleType(): string | null; + extraComputations?: Iterable; /** - * Converts to a plain object. + * Collection of fields to be fetched. Specify ["*"] for all fields. */ - toJSON(key?: string): unknown; - } - /** - * Information about a transit line. - * Access by calling `const {TransitLine} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class TransitLine { + fields: Iterable; /** - * The transit agency (or agencies) that operates this transit line. + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - get agencies(): google.maps.routes.TransitAgency[]; + internalUsageAttributionIds?: Iterable | null; /** - * The color commonly used in signage for this line. Represented in hexadecimal. + * The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Unicode Locale Identifier. See Language Support for the list of supported languages. When you don't provide this value, the language is inferred from your Google Maps JavaScript API localization settings. Otherwise, the language is inferred from the location of the first origin. */ - get color(): string | null; + language?: string; /** - * The URL for the icon associated with this line. + * Array of origins, which determines the rows of the response matrix. A value passed as a string may be an address, a plus code, or a Place resource name. Altitude values are not taken into consideration.

Several size restrictions apply to the cardinality of origins and destinations:
  • The total number of origins and destinations specified as strings or {@link google.maps.places.Place}s must be no greater than 50.
  • The product of the number of origins and the number of destinations must be no greater than 625.
  • The product of the number of origins and destinations must be no greater than 100 if {@link google.maps.routes.ComputeRouteMatrixRequest.routingPreference} is set to TRAFFIC_AWARE_OPTIMAL.
  • The product of the number of origins and destinations must be no greater than 100 if {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT.
*/ - get iconURL(): URL | null; + origins: Iterable; /** - * The full name of this transit line, For example, "8 Avenue Local". + * The region code, specified as a ccTLD ("top-level domain") two-character value. For more information see Country code top-level domains. When you don't provide this value, the region is inferred from your Google Maps JavaScript API localization settings. Otherwise, the region is inferred from the location of the first origin. */ - get name(): string | null; + region?: string; /** - * The short name of this transit line. This name will normally be a line number, such as "M7" or "355". + * Specifies how to compute the route matrix. The server attempts to use the selected routing preference to compute the route matrix. If the routing preference results in an error or an extra long latency, an error is returned. You can specify this option only when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is DRIVING or TWO_WHEELER, otherwise the request fails. */ - get shortName(): string | null; + routingPreference?: google.maps.routes.RoutingPreferenceString; /** - * The color commonly used in text on signage for this line. Represented in hexadecimal. + * Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in {@link google.maps.routes.RouteMatrixItem.durationMillis} which contains the predicted time in traffic based on historical averages. {@link google.maps.routes.ComputeRouteMatrixRequest.trafficModel} is only available for requests that have set {@link google.maps.routes.ComputeRouteMatrixRequest.routingPreference} to TRAFFIC_AWARE_OPTIMAL and {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} to DRIVING. Defaults to BEST_GUESS. */ - get textColor(): string | null; + trafficModel?: google.maps.TrafficModelString; /** - * The URL for this transit line as provided by the transit agency. + * Specifies preferences that influence the route returned for TRANSIT routes.

Note: Can only be specified when {@link google.maps.routes.ComputeRouteMatrixRequest.travelMode} is set to TRANSIT. */ - get url(): URL | null; + transitPreference?: google.maps.routes.TransitPreference; /** - * The type of vehicle that operates on this transit line. + * Specifies the mode of transportation. */ - get vehicle(): google.maps.routes.TransitVehicle | null; + travelMode?: google.maps.TravelModeString; /** - * Converts to a plain object. + * Specifies the units of measure for the display fields. If you don't provide this value, then the display units are inferred from the location of the first origin. */ - toJSON(key?: string): unknown; + units?: google.maps.UnitSystem; } /** - * Information about a transit stop. - * Access by calling `const {TransitStop} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Extra computations to perform while completing the request. See the web service documentation for more information. + * + * Access by calling `const {ComputeRoutesExtraComputation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class TransitStop { + export enum ComputeRoutesExtraComputation { /** - * The location of the stop expressed in latitude/longitude coordinates and an optional heading. + * Flyover information for the route(s). See the web service documentation for more information. */ - get location(): google.maps.routes.DirectionalLocation | null; + FLYOVER_INFO_ON_POLYLINE = 'FLYOVER_INFO_ON_POLYLINE', /** - * The name of the transit stop. + * Estimated fuel consumption for the route(s). See the web service documentation for more information. */ - get name(): string | null; + FUEL_CONSUMPTION = 'FUEL_CONSUMPTION', /** - * Converts to a plain object. + * See the web service documentation for more information. */ - toJSON(key?: string): unknown; + HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 'HTML_FORMATTED_NAVIGATION_INSTRUCTIONS', + /** + * Narrow road information for the route(s). See the web service documentation for more information. + */ + NARROW_ROAD_INFO_ON_POLYLINE = 'NARROW_ROAD_INFO_ON_POLYLINE', + /** + * Toll information for the route(s). See the web service documentation for more information. + */ + TOLLS = 'TOLLS', + /** + * Traffic aware polylines for the route(s). See the web service documentation for more information. + */ + TRAFFIC_ON_POLYLINE = 'TRAFFIC_ON_POLYLINE', } + export type ComputeRoutesExtraComputationString = `${google.maps.routes.ComputeRoutesExtraComputation}`; /** - * Additional information about a transit step in a route. - * Access by calling `const {TransitDetails} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Request for routes. */ - export class TransitDetails { + export interface ComputeRoutesRequest { /** - * Information about the arrival stop for the step. + * The arrival time.

Note: Can only be set when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is set to TRANSIT. You can specify either {@link google.maps.routes.ComputeRoutesRequest.departureTime} or {@link google.maps.routes.ComputeRoutesRequest.arrivalTime}, but not both. Transit trips are available for up to 7 days in the past or 100 days in the future. */ - get arrivalStop(): google.maps.routes.TransitStop | null; + arrivalTime?: Date; /** - * The estimated time of arrival for the step. + * Specifies whether to calculate alternate routes in addition to the route. No alternative routes are returned for requests that have intermediate waypoints. */ - get arrivalTime(): Date | null; + computeAlternativeRoutes?: boolean; + /** + * The departure time. If you don't set this value, then this value defaults to the time that you made the request.

Note: You can only specify a time in the past when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is set to TRANSIT. Transit trips are available for up to 7 days in the past or 100 days in the future. + */ + departureTime?: Date; /** - * Information about the departure stop for the step. + * The destination of the route. A value passed as a string may be an address, plus code, or a Place resource name. Altitude values are not taken into consideration for computing routes. */ - get departureStop(): google.maps.routes.TransitStop | null; + destination: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint; /** - * The estimated time of departure for the step. + * A list of extra computations which may be used to complete the request.

Note: These extra computations may return extra fields on the response. These extra fields must also be specified in {@link google.maps.routes.ComputeRoutesRequest.fields} to be returned in the response. */ - get departureTime(): Date | null; + extraComputations?: Iterable; /** - * Specifies the direction in which to travel on this line as marked on the vehicle or at the departure stop. The direction is often the terminus station. + * Collection of fields to be fetched. Specify ["*"] for all fields. */ - get headsign(): string | null; + fields: Iterable; /** - * Specifies the expected time in milliseconds between departures from the same stop at this time. For example, with a headway value of 600,000, you would expect a ten minute wait if you should miss your bus.

Note: If the headway exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. + * A set of waypoints along the route (excluding terminal points), for either stopping at or passing by. Up to 25 intermediate waypoints are supported. */ - get headwayMillis(): number | null; + intermediates?: Iterable; /** - * The number of stops from the departure to the arrival stop. This count includes the arrival stop, but excludes the departure stop. For example, if your route leaves from Stop A, passes through stops B and C, and arrives at stop D, stopCount will be 3. + * Identifiers used to attribute calls to specific packages or OSS libraries. */ - get stopCount(): number; + internalUsageAttributionIds?: Iterable | null; /** - * Information about the transit line used in the step. + * The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Unicode Locale Identifier. See Language Support for the list of supported languages. When you don't provide this value, the language is inferred from your Google Maps JavaScript API localization settings. Otherwise, the language is inferred from the location of the origin. */ - get transitLine(): google.maps.routes.TransitLine | null; + language?: string; /** - * The text that appears in schedules and sign boards to identify a transit trip to passengers. The text uniquely identifies a trip within a service day. For example, "538" is the tripShortText of the Amtrak train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA. + * If set to true, the service attempts to minimize the overall cost of the route by re-ordering the specified intermediate waypoints. The request fails if any of the intermediate waypoints is a via waypoint. Use {@link google.maps.routes.Route.optimizedIntermediateWaypointIndices} in the response to find the new ordering. If "optimizedIntermediateWaypointIndices" is not requested in {@link google.maps.routes.ComputeRoutesRequest.fields}, the request fails. If set to false, {@link google.maps.routes.Route.optimizedIntermediateWaypointIndices} in the response will be empty. */ - get tripShortText(): string | null; + optimizeWaypointOrder?: boolean; /** - * Converts to a plain object. + * The origin of the route. A value passed as a string may be an address, plus code, or a Place resource name. Altitude values are not taken into consideration for computing routes. */ - toJSON(key?: string): unknown; - } - /** - * Contains a segment of a RouteLeg. A step corresponds to a single navigation instruction. Route legs are made up of steps. - * Access by calling `const {RouteLegStep} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class RouteLegStep { + origin: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint; /** - * The travel distance of this step, in meters. + * Specifies the preference for the quality of the polyline. */ - get distanceMeters(): number; + polylineQuality?: google.maps.routes.PolylineQualityString; /** - * The end location of this step. + * The region code, specified as a ccTLD ("top-level domain") two-character value. For more information see Country code top-level domains. When you don't provide this value, the region is inferred from your Google Maps JavaScript API localization settings. Otherwise, the region is inferred from the location of the origin. */ - get endLocation(): google.maps.routes.DirectionalLocation | null; + region?: string; /** - * Instructions for navigating this step. + * Specifies what reference routes to calculate as part of the request in addition to the default route. A reference route is a route with a different route calculation objective than the default route. For example a FUEL_EFFICIENT reference route calculation takes into account various parameters that would generate an optimal fuel efficient route. When using this feature, look for {@link google.maps.routes.Route.routeLabels} on the resulting routes. */ - get instructions(): string | null; + requestedReferenceRoutes?: Iterable; /** - * Text representations of properties of the RouteLegStep. + * A set of conditions to satisfy that affect the way routes are calculated. For example you can specify features to avoid such as toll roads or highways. */ - get localizedValues(): google.maps.routes.RouteLegStepLocalizedValues | null; + routeModifiers?: google.maps.routes.RouteModifiers; /** - * The navigation maneuver to perform at this step. See Maneuver for a list of possible values. + * Specifies how to compute the route. The server attempts to use the selected routing preference to compute the route. If the routing preference results in an error or an extra long latency, an error is returned. You can specify this option only when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is DRIVING or TWO_WHEELER, otherwise the request fails. */ - get maneuver(): string | null; + routingPreference?: google.maps.routes.RoutingPreferenceString; /** - * The list of {@link google.maps.LatLngAltitude}s of the route leg step, which can be used to draw a route leg step polyline. Granularity of the path can be controlled by setting {@link google.maps.routes.ComputeRoutesRequest.polylineQuality}. The "path" field must be requested in {@link google.maps.routes.ComputeRoutesRequest.fields} in order for this field to be populated. + * Specifies the assumptions to use when calculating time in traffic. This setting affects the value of {@link google.maps.routes.Route.durationMillis} and {@link google.maps.routes.RouteLeg.durationMillis} which contain the predicted time in traffic based on historical averages. {@link google.maps.routes.ComputeRoutesRequest.trafficModel} is only available for requests that have set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to TRAFFIC_AWARE_OPTIMAL and {@link google.maps.routes.ComputeRoutesRequest.travelMode} to DRIVING. Defaults to BEST_GUESS. */ - get path(): google.maps.LatLngAltitude[]; + trafficModel?: google.maps.TrafficModelString; /** - * The start location of this step. + * Specifies preferences that influence the route returned for TRANSIT routes.

Note: Can only be specified when {@link google.maps.routes.ComputeRoutesRequest.travelMode} is set to TRANSIT. */ - get startLocation(): google.maps.routes.DirectionalLocation | null; + transitPreference?: google.maps.routes.TransitPreference; /** - * The duration of traveling through this step without taking traffic conditions into consideration.

Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. + * Specifies the mode of transportation. */ - get staticDurationMillis(): number | null; + travelMode?: google.maps.TravelModeString; /** - * Details pertaining to this step if the travel mode is TRANSIT. + * Specifies the units of measure for the display fields, such as navigation instructions. The units of measure used for the route, leg, step distance, and duration are not affected by this value. If you don't provide this value, then the display units are inferred from the location of the origin. */ - get transitDetails(): google.maps.routes.TransitDetails | null; + units?: google.maps.UnitSystem; + } + /** + * Encapsulates a geographic point and an optional heading. + * Access by calling `const {DirectionalLocation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class DirectionalLocation extends google.maps.LatLngAltitude implements google.maps.routes.DirectionalLocationLiteral { /** - * The travel mode used for this step. + * The compass heading associated with the direction of the flow of traffic. Heading values can be numbers from 0 to 360, where 0 specifies a heading of due North, 90 specifies a heading of due East, and so on. You can use this field only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode}. */ - get travelMode(): google.maps.TravelModeString | null; + get heading(): number | null | undefined; /** * Converts to a plain object. */ - toJSON(key?: string): unknown; + toJSON(key?: string): google.maps.routes.DirectionalLocationLiteral; } /** - * Contains additional information that the user should be informed about on a {@link google.maps.routes.RouteLeg}. - * Access by calling `const {RouteLegTravelAdvisory} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Object literals are accepted in place of {@link google.maps.routes.DirectionalLocation} instances as a convenience. These are converted to {@link google.maps.routes.DirectionalLocation} when the Maps JS API encounters them. */ - export class RouteLegTravelAdvisory { + export interface DirectionalLocationLiteral extends google.maps.LatLngAltitudeLiteral { /** - * Speed reading intervals detailing traffic density. Applicable in case of TRAFFIC_AWARE and TRAFFIC_AWARE_OPTIMAL {@link google.maps.routes.ComputeRoutesRequest.routingPreference}. The intervals cover the entire polyline of the {@link google.maps.routes.RouteLeg} without overlap. The start point of a specified interval is the same as the end point of the preceding interval.

Example:
 polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
speedReadingIntervals: [A,C), [C,D), [D,G)
+ * The compass heading associated with the direction of the flow of traffic. Heading values can be numbers from 0 to 360, where 0 specifies a heading of due North, 90 specifies a heading of due East, and so on. You can use this field only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode}. */ - get speedReadingIntervals(): google.maps.routes.SpeedReadingInterval[] | undefined; + heading?: number | null; + } + /** + * Information related to how and why a fallback result was used in a {@link google.maps.routes.Route.computeRoutes} response. If this field is set, then it means the server used a different routing mode from your preferred mode as fallback. + * Access by calling `const {FallbackInfo} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class FallbackInfo { /** - * Contains information about tolls on the specific {@link google.maps.routes.RouteLeg}. This field is only populated if tolls are expected on the {@link google.maps.routes.RouteLeg}. If this field is set but {@link google.maps.routes.TollInfo.estimatedPrices} is not populated, then the route leg contains tolls but the estimated price is unknown. If this field is empty, then there are no tolls on the {@link google.maps.routes.RouteLeg}. + * The reason why fallback response was used instead of the original response. This field is only populated when the fallback mode is triggered and the fallback response is returned. */ - get tollInfo(): google.maps.routes.TollInfo | null; + get reason(): google.maps.routes.FallbackReasonString | null | undefined; + /** + * Routing mode used for the response. If fallback was triggered, the mode may be different from routing preference set in the original client request. + */ + get routingMode(): google.maps.routes.FallbackRoutingModeString | null | undefined; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Provides overview information about a list of {@link google.maps.routes.RouteLeg.steps}. - * Access by calling `const {StepsOverview} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Reasons for using fallback response. See the web service documentation for more information. + * + * Access by calling `const {FallbackReason} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class StepsOverview { + export enum FallbackReason { /** - * Summarized information about different multi-modal segments of the {@link google.maps.routes.RouteLeg.steps}. + * We were not able to finish the calculation with your preferred routing mode on time, but we were able to return a result calculated by an alternative mode. See the web service documentation for more information. */ - get multiModalSegments(): google.maps.routes.MultiModalSegment[]; + LATENCY_EXCEEDED = 'LATENCY_EXCEEDED', /** - * Converts to a plain object. + * A server error happened while calculating routes with your preferred routing mode, but we were able to return a result calculated by an alternative mode. See the web service documentation for more information. */ - toJSON(key?: string): unknown; + SERVER_ERROR = 'SERVER_ERROR', } + export type FallbackReasonString = `${google.maps.routes.FallbackReason}`; /** - * Contains a segment between non-via waypoints. - * Access by calling `const {RouteLeg} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Actual routing mode used for returned fallback response. See the web service documentation for more information. + * + * Access by calling `const {FallbackRoutingMode} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class RouteLeg { + export enum FallbackRoutingMode { /** - * The travel distance of the route leg, in meters. + * See the web service documentation for more information. */ - get distanceMeters(): number; + TRAFFIC_AWARE = 'TRAFFIC_AWARE', /** - * The length of time needed to navigate the route leg in milliseconds. If you set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to TRAFFIC_UNAWARE, then this value is the same as staticDurationMillis. If you set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to either TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL, then this value is calculated taking traffic conditions into account.

Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. + * See the web service documentation for more information. */ - get durationMillis(): number | null; + TRAFFIC_UNAWARE = 'TRAFFIC_UNAWARE', + } + export type FallbackRoutingModeString = `${google.maps.routes.FallbackRoutingMode}`; + /** + * Geocoding about the locations used as waypoints. Only populated for address waypoints. Includes details about the geocoding results for the purposes of determining what the address was geocoded to. + * Access by calling `const {GeocodedWaypoint} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class GeocodedWaypoint { /** - * The end location of this leg. This location might be different from {@link google.maps.routes.ComputeRoutesRequest.destination}. For example, when {@link google.maps.routes.ComputeRoutesRequest.destination} is not near a road, this is a point on the road. + * Indicates the status code resulting from the geocoding operation. */ - get endLocation(): google.maps.routes.DirectionalLocation | null; + get geocoderStatus(): google.maps.RPCStatusString | null; /** - * Text representations of properties of the RouteLeg. + * The index of the corresponding intermediate waypoint in the request. Only populated if the corresponding waypoint is an intermediate waypoint. */ - get localizedValues(): google.maps.routes.RouteLegLocalizedValues | null; + get intermediateWaypointRequestIndex(): number | null; /** - * The list of {@link google.maps.LatLngAltitude}s of the route leg, which can be used to draw a route leg polyline. Granularity of the path can be controlled by setting {@link google.maps.routes.ComputeRoutesRequest.polylineQuality}. + * Indicates that the geocoder did not return an exact match for the original request, though it was able to match part of the requested address. You may wish to examine the original request for misspellings and/or an incomplete address. */ - get path(): google.maps.LatLngAltitude[]; + get partialMatch(): boolean; /** - * Groupings of sections of the route leg path with their corresponding speed reading. For this field to be populated, {@link google.maps.routes.ComputeRoutesRequest.routingPreference} must be set to TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL and {@link google.maps.routes.ComputeRoutesRequest.extraComputations} must include TRAFFIC_ON_POLYLINE. + * The place ID for this result. */ - get speedPaths(): google.maps.routes.SpeedPath[]; + get placeId(): string; /** - * The start location of this leg. This location might be different from {@link google.maps.routes.ComputeRoutesRequest.origin}. For example, when {@link google.maps.routes.ComputeRoutesRequest.origin} is not near a road, this is a point on the road. + * The type(s) of the result, in the form of zero or more type tags. See https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types for supported types. */ - get startLocation(): google.maps.routes.DirectionalLocation | null; + get types(): string[]; /** - * The duration of traveling through the leg without taking traffic conditions into consideration.

Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. + * Converts to a plain object. */ - get staticDurationMillis(): number | null; + toJSON(key?: string): unknown; + } + /** + * Contains {@link google.maps.routes.GeocodedWaypoint}s for origin, destination, and intermediate waypoints. Only populated for address waypoints. + * Access by calling `const {GeocodingResults} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class GeocodingResults { /** - * An array of steps denoting segments within this leg. Each step represents one navigation instruction. + * The geocoded waypoint for the destination. */ - get steps(): google.maps.routes.RouteLegStep[]; + get destination(): google.maps.routes.GeocodedWaypoint | null | undefined; /** - * Overview information about the steps in this RouteLeg. This field is only populated for TRANSIT routes. + * A list of intermediate geocoded waypoints each containing an index field that corresponds to the zero-based position of the waypoint in the order they were specified in the request. */ - get stepsOverview(): google.maps.routes.StepsOverview | null; + get intermediates(): google.maps.routes.GeocodedWaypoint[] | undefined; /** - * Contains the additional information that the user should be informed about, such as possible traffic zone restrictions, on a route leg. + * The geocoded waypoint for the origin. */ - get travelAdvisory(): google.maps.routes.RouteLegTravelAdvisory | null; + get origin(): google.maps.routes.GeocodedWaypoint | null | undefined; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Text representations of properties of the Route. - * Access by calling `const {RouteLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Provides summarized information about a multi-modal segment of the {@link google.maps.routes.RouteLeg.steps} of a route. A multi-modal segment is defined as one or more contiguous {@link google.maps.routes.RouteLegStep}'s that have the same {@link google.maps.TravelMode}. + * Access by calling `const {MultiModalSegment} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class RouteLocalizedValues { - /** - * Travel distance of the route represented in text form. - */ - get distance(): string | null; - /** - * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - get distanceLanguage(): string | null; - /** - * Duration, represented in text form and localized to the region of the query. Takes traffic conditions into consideration. Note: If you did not request traffic information, this value is the same value as staticDuration. - */ - get duration(): string | null; + export class MultiModalSegment { /** - * The duration text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Instructions for navigating this multi-modal segment. */ - get durationLanguage(): string | null; + get instructions(): string | null; /** - * Duration without taking traffic conditions into consideration, represented in text form. + * The navigation maneuver to perform at this step. See Maneuver for a list of possible values. */ - get staticDuration(): string | null; + get maneuver(): string | null; /** - * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn". + * The corresponding {@link google.maps.routes.RouteLegStep} index that is the end of a multi-modal segment. */ - get staticDurationLanguage(): string | null; + get stepEndIndex(): number; /** - * Transit fare represented in text form. + * The corresponding {@link google.maps.routes.RouteLegStep} index that is the start of a multi-modal segment. */ - get transitFare(): string | null; + get stepStartIndex(): number; /** - * The transit fare text's BCP-47 language code, such as "en-US" or "sr-Latn". + * The travel mode used for this multi-modal segment. */ - get transitFareLanguage(): string | null; + get travelMode(): google.maps.TravelModeString | null; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Contains additional information that the user should be informed about on a {@link google.maps.routes.Route}. - * Access by calling `const {RouteTravelAdvisory} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Encapsulates information about a road feature along a stretch of polyline. + * Access by calling `const {PolylineDetailInfo} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class RouteTravelAdvisory { + export class PolylineDetailInfo { /** - * The predicted fuel consumption in microliters.

Note: If the fuel consumption exceeds 2^53 microliters, then this value is Number.POSITIVE_INFINITY. + * The end index of this road feature in the polyline. */ - get fuelConsumptionMicroliters(): number | undefined; + get endIndex(): number | null; /** - * The {@link google.maps.routes.Route} may have restrictions that are not suitable for the requested travel mode or route modifiers. + * Denotes whether the road feature exists along the polyline. */ - get routeRestrictionsPartiallyIgnored(): boolean | null | undefined; + get presence(): google.maps.routes.RoadFeatureStateString | null; /** - * Speed reading intervals detailing traffic density. Applicable in case of TRAFFIC_AWARE and TRAFFIC_AWARE_OPTIMAL {@link google.maps.routes.ComputeRoutesRequest.routingPreference}. The intervals cover the entire polyline of the {@link google.maps.routes.Route} without overlap. The start point of a specified interval is the same as the end point of the preceding interval.

Example:
 polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
speedReadingIntervals: [A,C), [C,D), [D,G)
+ * The start index of this road feature in the polyline. */ - get speedReadingIntervals(): google.maps.routes.SpeedReadingInterval[] | undefined; + get startIndex(): number | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; + } + /** + * Details corresponding to a given index or contiguous segment of a polyline. Given a polyline with points P_0, P_1, ... , P_N (zero-based index), the PolylineDetails describes a road feature for a given interval. + * Access by calling `const {PolylineDetails} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class PolylineDetails { /** - * Contains information about tolls on the {@link google.maps.routes.Route}. This field is only populated if tolls are expected on the {@link google.maps.routes.Route}. If this field is set but {@link google.maps.routes.TollInfo.estimatedPrices} is not populated, then the route contains tolls but the estimated price is unknown. If this field is empty, then there are no tolls on the {@link google.maps.routes.Route}. + * Flyover details along the polyline. */ - get tollInfo(): google.maps.routes.TollInfo | null | undefined; + get flyoverInfo(): google.maps.routes.PolylineDetailInfo[]; /** - * If present, contains the total fare or ticket costs of this {@link google.maps.routes.Route}. This property is only returned for TRANSIT {@link google.maps.routes.ComputeRoutesRequest.travelMode} and only for routes where fare information is available for all transit steps. + * Narrow road details along the polyline. */ - get transitFare(): google.maps.places.Money | null | undefined; + get narrowRoadInfo(): google.maps.routes.PolylineDetailInfo[]; /** * Converts to a plain object. */ toJSON(key?: string): unknown; } /** - * Groups together the {@link google.maps.LatLngAltitude}s of a route interval with the speed reading for the interval. + * A set of values that specify the quality of the polyline. See the web service documentation for more information. + * + * Access by calling `const {PolylineQuality} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface SpeedPath { + export enum PolylineQuality { /** - * The path covered by this speed path. + * Specifies a high-quality polyline - which is composed using more points than OVERVIEW, at the cost of increased response size. See the web service documentation for more information. */ - path: google.maps.LatLngAltitude[]; + HIGH_QUALITY = 'HIGH_QUALITY', /** - * The speed reading of the path. + * Specifies an overview polyline - which is composed using a small number of points. See the web service documentation for more information. */ - speed?: google.maps.routes.SpeedString | null; + OVERVIEW = 'OVERVIEW', } + export type PolylineQualityString = `${google.maps.routes.PolylineQuality}`; /** - * A single origin for a {@link google.maps.routes.ComputeRouteMatrixRequest}. + * A supported reference route on the ComputeRoutesRequest. See the web service documentation for more information. + * + * Access by calling `const {ReferenceRoute} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface RouteMatrixOrigin { + export enum ReferenceRoute { /** - * Modifiers for every route that takes this as the origin. + * Fuel efficient route. See the web service documentation for more information. */ - routeModifiers?: google.maps.routes.RouteModifiers | null; + FUEL_EFFICIENT = 'FUEL_EFFICIENT', /** - * The location of the origin. A value passed as a string may be an address or plus code. Altitude values for are not taken into consideration. + * Route with shorter travel distance. See the web service documentation for more information. */ - waypoint: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint; + SHORTER_DISTANCE = 'SHORTER_DISTANCE', + } + export type ReferenceRouteString = `${google.maps.routes.ReferenceRoute}`; + /** + * Encapsulates the states of road features along a stretch of polyline. See the web service documentation for more information. + * + * Access by calling `const {RoadFeatureState} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export enum RoadFeatureState { + /** + * The road feature does not exist. See the web service documentation for more information. + */ + DOES_NOT_EXIST = 'DOES_NOT_EXIST', + /** + * The road feature exists. See the web service documentation for more information. + */ + EXISTS = 'EXISTS', } + export type RoadFeatureStateString = `${google.maps.routes.RoadFeatureState}`; /** * Contains a route, which consists of a series of connected road segments that join beginning, ending, and intermediate waypoints. * Access by calling `const {Route} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. @@ -16041,239 +15906,368 @@ declare namespace google.maps.routes { } /** * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * Options for creating route 3D polylines. + * A web component for 3D route rendering. Currently support origin and destination parameters to render a polyline in 3D space in a 3D map. + * Access by calling `const {Route3DElement} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface RoutePolyline3DOptions { + export class Route3DElement extends HTMLElement implements google.maps.routes.Route3DElementOptions { /** - * The color scheme to use for the 3D polyline. When specified as FOLLOW_SYSTEM while the map colorScheme is also FOLLOW_SYSTEM, the polylines will be drawn in the same dark/light mode as the map. When not specified, {@link google.maps.routes.Route.create3DPolylines} attempts to use the colorScheme of the map or falls back to the system default. + * Creates a Route3DElement with the options specified. + * @param options */ - colorScheme?: google.maps.ColorSchemeString; + constructor(options?: google.maps.routes.Route3DElementOptions); /** - * Options for customizing the style of a 3D polyline. + * If provided, the specified route will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false */ - polylineOptions?: google.maps.maps3d.Polyline3DElementOptions | ((arg0: google.maps.maps3d.Polyline3DElementOptions, arg1: google.maps.routes.RoutePolylineDetails) => google.maps.maps3d.Polyline3DElementOptions); + get autofitsCamera(): boolean; + /** + * If provided, the specified route will be made visible within the map viewport, alongside any other elements that have opted in. + * @defaultValue false + */ + set autofitsCamera(value: boolean | null | undefined); + /** + * If provided, the route will be computed with the specified departure time. When specifying via HTML attribute, use the ISO 8601 format for reliable results across browsers. For information on usage requirements, see {@link google.maps.routes.ComputeRoutesRequest.departureTime}. + */ + get departureTime(): Date | null; + /** + * If provided, the route will be computed with the specified departure time. When specifying via HTML attribute, use the ISO 8601 format for reliable results across browsers. For information on usage requirements, see {@link google.maps.routes.ComputeRoutesRequest.departureTime}. + */ + set departureTime(value: Date | null | undefined); + /** + * The destination of the route. + */ + get destination(): string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + /** + * The destination of the route. + */ + set destination(value: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null | undefined); + /** + * Fallback info for the computed routes. + */ + get fallbackInfo(): google.maps.routes.FallbackInfo | null; + /** + * Geocoding results for the origin and destination. + */ + get geocodingResults(): google.maps.routes.GeocodingResults | null; + /** + * Identifiers used to attribute calls to specific packages or OSS libraries. + */ + get internalUsageAttributionIds(): string[] | null; + /** + * Identifiers used to attribute calls to specific packages or OSS libraries. + */ + set internalUsageAttributionIds(value: Iterable | null | undefined); + /** + * The origin of the route. + */ + get origin(): string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + /** + * The origin of the route. + */ + set origin(value: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null | undefined); + /** + * The primary route along with optional alternate routes, computed from the Routes API. + */ + get routes(): google.maps.routes.Route[] | null; + /** + * If provided, the route will be computed with traffic information along the route that's based on the {@link google.maps.routes.RoutingPreference} specified, and use traffic-specific coloring. + */ + get routingPreference(): google.maps.routes.RoutingPreferenceString | null; + /** + * If provided, the route will be computed with traffic information along the route that's based on the {@link google.maps.routes.RoutingPreference} specified, and use traffic-specific coloring. + */ + set routingPreference(value: google.maps.routes.RoutingPreferenceString | null | undefined); + /** + * If provided, the polyline is based on the specified travel mode. + */ + get travelMode(): google.maps.TravelModeString | null; + /** + * If provided, the polyline is based on the specified travel mode. + */ + set travelMode(value: google.maps.TravelModeString | null | undefined); + addEventListener(type: K, listener: (this: Route3DElement, ev: Route3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + } + export interface Route3DElementEventMap extends HTMLElementEventMap { + "gmp-error": Event; + "gmp-load": Event; } /** - * Options for creating route polylines. + * Route3DElementOptions object used to define the properties that can be set on a Route3DElement. */ - export interface RoutePolylineOptions { + export interface Route3DElementOptions { /** - * The color scheme to use for the polyline. When specified as FOLLOW_SYSTEM while the map colorScheme is also FOLLOW_SYSTEM, the polylines will be drawn in the same dark/light mode as the map. When not specified, {@link google.maps.routes.Route.createPolylines} attempts to use the colorScheme of the map or falls back to the system default. + * Whether or not to opt into automatically fitting the camera to the route. */ - colorScheme?: google.maps.ColorSchemeString; + autofitsCamera?: boolean | null; /** - * Options for customizing the style of a polyline. Can either be a {@link google.maps.PolylineOptions} object that is applied to all polylines for the route or a function that takes default {@link google.maps.PolylineOptions} and {@link google.maps.routes.RoutePolylineDetails} and returns the {@link google.maps.PolylineOptions} to be applied to that polyline. + * See {@link google.maps.routes.Route3DElement.departureTime}. */ - polylineOptions?: google.maps.PolylineOptions | ((arg0: google.maps.PolylineOptions, arg1: google.maps.routes.RoutePolylineDetails) => google.maps.PolylineOptions); + departureTime?: Date | null; + /** + * See {@link google.maps.routes.Route3DElement.destination}. + */ + destination?: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + /** + * Identifiers used to attribute calls to specific packages or OSS libraries. + */ + internalUsageAttributionIds?: Iterable | null; + /** + * See {@link google.maps.routes.Route3DElement.origin}. + */ + origin?: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + /** + * See {@link google.maps.routes.Route3DElement.routingPreference}. + */ + routingPreference?: google.maps.routes.RoutingPreferenceString | null; + /** + * See {@link google.maps.routes.Route3DElement.travelMode}. + */ + travelMode?: google.maps.TravelModeString | null; } /** - * Details about a section of a route corresponding to a polyline that can be used to customize the polyline style. + * See the web service documentation for more information. + * + * Access by calling `const {RouteLabel} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface RoutePolylineDetails { + export enum RouteLabel { /** - * The speed reading of the section of the route corresponding to this polyline. Only populated for routes with traffic information. + * The default "best" route returned for the route computation. See the web service documentation for more information. */ - speed?: google.maps.routes.SpeedString | null; + DEFAULT_ROUTE = 'DEFAULT_ROUTE', /** - * The transit details of the section of the route corresponding to this polyline. Only populated for routes with transit information. + * An alternative to the default "best" route. See the web service documentation for more information. */ - transitDetails?: google.maps.routes.TransitDetails | null; + DEFAULT_ROUTE_ALTERNATE = 'DEFAULT_ROUTE_ALTERNATE', /** - * The travel mode of the section of the route corresponding to this polyline. Empty for traffic polylines. + * Fuel efficient route. See the web service documentation for more information. */ - travelMode?: google.maps.TravelModeString | null; + FUEL_EFFICIENT = 'FUEL_EFFICIENT', + /** + * Shorter travel distance route. See the web service documentation for more information. + */ + SHORTER_DISTANCE = 'SHORTER_DISTANCE', } + export type RouteLabelString = `${google.maps.routes.RouteLabel}`; /** - * Details about a waypoint that can be used to customize marker style. + * Contains a segment between non-via waypoints. + * Access by calling `const {RouteLeg} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface WaypointMarkerDetails { + export class RouteLeg { /** - * The index of the marker. + * The travel distance of the route leg, in meters. */ - index: number; + get distanceMeters(): number; /** - * The leg that the marker belongs to. Empty if the route has no legs. + * The length of time needed to navigate the route leg in milliseconds. If you set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to TRAFFIC_UNAWARE, then this value is the same as staticDurationMillis. If you set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to either TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL, then this value is calculated taking traffic conditions into account.

Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. */ - leg?: google.maps.routes.RouteLeg; + get durationMillis(): number | null; /** - * The total number of markers in the route. + * The end location of this leg. This location might be different from {@link google.maps.routes.ComputeRoutesRequest.destination}. For example, when {@link google.maps.routes.ComputeRoutesRequest.destination} is not near a road, this is a point on the road. */ - totalMarkers: number; + get endLocation(): google.maps.routes.DirectionalLocation | null; + /** + * Text representations of properties of the RouteLeg. + */ + get localizedValues(): google.maps.routes.RouteLegLocalizedValues | null; + /** + * The list of {@link google.maps.LatLngAltitude}s of the route leg, which can be used to draw a route leg polyline. Granularity of the path can be controlled by setting {@link google.maps.routes.ComputeRoutesRequest.polylineQuality}. + */ + get path(): google.maps.LatLngAltitude[]; + /** + * Groupings of sections of the route leg path with their corresponding speed reading. For this field to be populated, {@link google.maps.routes.ComputeRoutesRequest.routingPreference} must be set to TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL and {@link google.maps.routes.ComputeRoutesRequest.extraComputations} must include TRAFFIC_ON_POLYLINE. + */ + get speedPaths(): google.maps.routes.SpeedPath[]; + /** + * The start location of this leg. This location might be different from {@link google.maps.routes.ComputeRoutesRequest.origin}. For example, when {@link google.maps.routes.ComputeRoutesRequest.origin} is not near a road, this is a point on the road. + */ + get startLocation(): google.maps.routes.DirectionalLocation | null; + /** + * The duration of traveling through the leg without taking traffic conditions into consideration.

Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. + */ + get staticDurationMillis(): number | null; + /** + * An array of steps denoting segments within this leg. Each step represents one navigation instruction. + */ + get steps(): google.maps.routes.RouteLegStep[]; + /** + * Overview information about the steps in this RouteLeg. This field is only populated for TRANSIT routes. + */ + get stepsOverview(): google.maps.routes.StepsOverview | null; + /** + * Contains the additional information that the user should be informed about, such as possible traffic zone restrictions, on a route leg. + */ + get travelAdvisory(): google.maps.routes.RouteLegTravelAdvisory | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } /** - * Route3DElementOptions object used to define the properties that can be set on a Route3DElement. + * Text representations of the {@link google.maps.routes.RouteLeg}. + * Access by calling `const {RouteLegLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface Route3DElementOptions { + export class RouteLegLocalizedValues { /** - * Whether or not to opt into automatically fitting the camera to the route. + * Travel distance of the route leg in text form. */ - autofitsCamera?: boolean | null; + get distance(): string | null; /** - * See {@link google.maps.routes.Route3DElement.departureTime}. + * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - departureTime?: Date | null; + get distanceLanguage(): string | null; /** - * See {@link google.maps.routes.Route3DElement.destination}. + * Duration, represented in text form and localized to the region of the query. Takes traffic conditions into consideration. */ - destination?: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + get duration(): string | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The duration text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - internalUsageAttributionIds?: Iterable | null; + get durationLanguage(): string | null; /** - * See {@link google.maps.routes.Route3DElement.origin}. + * Duration without taking traffic conditions into consideration, represented in text form. */ - origin?: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + get staticDuration(): string | null; /** - * See {@link google.maps.routes.Route3DElement.routingPreference}. + * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn". */ - routingPreference?: google.maps.routes.RoutingPreferenceString | null; + get staticDurationLanguage(): string | null; /** - * See {@link google.maps.routes.Route3DElement.travelMode}. + * Converts to a plain object. */ - travelMode?: google.maps.TravelModeString | null; + toJSON(key?: string): unknown; } /** - * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. - * A web component for 3D route rendering. Currently support origin and destination parameters to render a polyline in 3D space in a 3D map. - * Access by calling `const {Route3DElement} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Contains a segment of a RouteLeg. A step corresponds to a single navigation instruction. Route legs are made up of steps. + * Access by calling `const {RouteLegStep} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Route3DElement extends HTMLElement implements google.maps.routes.Route3DElementOptions { - /** - * Creates a Route3DElement with the options specified. - * @param options - */ - constructor(options?: google.maps.routes.Route3DElementOptions); - /** - * If provided, the specified route will be made visible within the map viewport, alongside any other elements that have opted in. - * @defaultValue false - */ - get autofitsCamera(): boolean; + export class RouteLegStep { /** - * If provided, the specified route will be made visible within the map viewport, alongside any other elements that have opted in. - * @defaultValue false + * The travel distance of this step, in meters. */ - set autofitsCamera(value: boolean | null | undefined); + get distanceMeters(): number; /** - * If provided, the route will be computed with the specified departure time. When specifying via HTML attribute, use the ISO 8601 format for reliable results across browsers. For information on usage requirements, see {@link google.maps.routes.ComputeRoutesRequest.departureTime}. + * The end location of this step. */ - get departureTime(): Date | null; + get endLocation(): google.maps.routes.DirectionalLocation | null; /** - * If provided, the route will be computed with the specified departure time. When specifying via HTML attribute, use the ISO 8601 format for reliable results across browsers. For information on usage requirements, see {@link google.maps.routes.ComputeRoutesRequest.departureTime}. + * Instructions for navigating this step. */ - set departureTime(value: Date | null | undefined); + get instructions(): string | null; /** - * The destination of the route. + * Text representations of properties of the RouteLegStep. */ - get destination(): string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + get localizedValues(): google.maps.routes.RouteLegStepLocalizedValues | null; /** - * The destination of the route. + * The navigation maneuver to perform at this step. See Maneuver for a list of possible values. */ - set destination(value: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null | undefined); + get maneuver(): string | null; /** - * Fallback info for the computed routes. + * The list of {@link google.maps.LatLngAltitude}s of the route leg step, which can be used to draw a route leg step polyline. Granularity of the path can be controlled by setting {@link google.maps.routes.ComputeRoutesRequest.polylineQuality}. The "path" field must be requested in {@link google.maps.routes.ComputeRoutesRequest.fields} in order for this field to be populated. */ - get fallbackInfo(): google.maps.routes.FallbackInfo | null; + get path(): google.maps.LatLngAltitude[]; /** - * Geocoding results for the origin and destination. + * The start location of this step. */ - get geocodingResults(): google.maps.routes.GeocodingResults | null; + get startLocation(): google.maps.routes.DirectionalLocation | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * The duration of traveling through this step without taking traffic conditions into consideration.

Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. */ - get internalUsageAttributionIds(): string[] | null; + get staticDurationMillis(): number | null; /** - * Identifiers used to attribute calls to specific packages or OSS libraries. + * Details pertaining to this step if the travel mode is TRANSIT. */ - set internalUsageAttributionIds(value: Iterable | null | undefined); + get transitDetails(): google.maps.routes.TransitDetails | null; /** - * The origin of the route. + * The travel mode used for this step. */ - get origin(): string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null; + get travelMode(): google.maps.TravelModeString | null; /** - * The origin of the route. + * Converts to a plain object. */ - set origin(value: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null | undefined); + toJSON(key?: string): unknown; + } + /** + * Text representations of properties of the RouteLegStep. + * Access by calling `const {RouteLegStepLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class RouteLegStepLocalizedValues { /** - * The primary route along with optional alternate routes, computed from the Routes API. + * Travel distance of the route leg step in text form. */ - get routes(): google.maps.routes.Route[] | null; + get distance(): string | null; /** - * If provided, the route will be computed with traffic information along the route that's based on the {@link google.maps.routes.RoutingPreference} specified, and use traffic-specific coloring. + * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get routingPreference(): google.maps.routes.RoutingPreferenceString | null; + get distanceLanguage(): string | null; /** - * If provided, the route will be computed with traffic information along the route that's based on the {@link google.maps.routes.RoutingPreference} specified, and use traffic-specific coloring. + * Duration without taking traffic conditions into consideration, represented in text form. */ - set routingPreference(value: google.maps.routes.RoutingPreferenceString | null | undefined); + get staticDuration(): string | null; /** - * If provided, the polyline is based on the specified travel mode. + * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get travelMode(): google.maps.TravelModeString | null; + get staticDurationLanguage(): string | null; /** - * If provided, the polyline is based on the specified travel mode. + * Converts to a plain object. */ - set travelMode(value: google.maps.TravelModeString | null | undefined); - addEventListener(type: K, listener: (this: Route3DElement, ev: Route3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - } - export interface Route3DElementEventMap extends HTMLElementEventMap { - "gmp-error": Event; - "gmp-load": Event; + toJSON(key?: string): unknown; } /** - * The condition of the route being returned. See the web service documentation for more information. - * - * Access by calling `const {RouteMatrixItemCondition} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Contains additional information that the user should be informed about on a {@link google.maps.routes.RouteLeg}. + * Access by calling `const {RouteLegTravelAdvisory} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export enum RouteMatrixItemCondition { + export class RouteLegTravelAdvisory { /** - * A route was found, and the corresponding information was filled out for the element. See the web service documentation for more information. + * Speed reading intervals detailing traffic density. Applicable in case of TRAFFIC_AWARE and TRAFFIC_AWARE_OPTIMAL {@link google.maps.routes.ComputeRoutesRequest.routingPreference}. The intervals cover the entire polyline of the {@link google.maps.routes.RouteLeg} without overlap. The start point of a specified interval is the same as the end point of the preceding interval.

Example:
 polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
speedReadingIntervals: [A,C), [C,D), [D,G)
*/ - ROUTE_EXISTS = 'ROUTE_EXISTS', + get speedReadingIntervals(): google.maps.routes.SpeedReadingInterval[] | undefined; /** - * No route could be found. See the web service documentation for more information. + * Contains information about tolls on the specific {@link google.maps.routes.RouteLeg}. This field is only populated if tolls are expected on the {@link google.maps.routes.RouteLeg}. If this field is set but {@link google.maps.routes.TollInfo.estimatedPrices} is not populated, then the route leg contains tolls but the estimated price is unknown. If this field is empty, then there are no tolls on the {@link google.maps.routes.RouteLeg}. */ - ROUTE_NOT_FOUND = 'ROUTE_NOT_FOUND', + get tollInfo(): google.maps.routes.TollInfo | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } - export type RouteMatrixItemConditionString = `${google.maps.routes.RouteMatrixItemCondition}`; /** - * Text representations of the {@link google.maps.routes.RouteMatrixItem}. - * Access by calling `const {RouteMatrixItemLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Text representations of properties of the Route. + * Access by calling `const {RouteLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class RouteMatrixItemLocalizedValues { + export class RouteLocalizedValues { /** - * Travel distance of the route matrix item in text form. + * Travel distance of the route represented in text form. */ - get distance(): string | null | undefined; + get distance(): string | null; /** * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get distanceLanguage(): string | null | undefined; + get distanceLanguage(): string | null; /** - * Duration, represented in text form and localized to the region of the query. Takes traffic conditions into consideration.

Note: If you did not request traffic information, this value is the same value as {@link google.maps.routes.RouteMatrixItemLocalizedValues.staticDuration}. + * Duration, represented in text form and localized to the region of the query. Takes traffic conditions into consideration. Note: If you did not request traffic information, this value is the same value as staticDuration. */ - get duration(): string | null | undefined; + get duration(): string | null; /** * The duration text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - get durationLanguage(): string | null | undefined; + get durationLanguage(): string | null; /** * Duration without taking traffic conditions into consideration, represented in text form. */ - get staticDuration(): string | null | undefined; + get staticDuration(): string | null; /** * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn". */ - get staticDurationLanguage(): string | null | undefined; + get staticDurationLanguage(): string | null; /** - * Transit fare, represented in text form. + * Transit fare represented in text form. */ - get transitFare(): string | null | undefined; + get transitFare(): string | null; /** - * The transit fare text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * The transit fare text's BCP-47 language code, such as "en-US" or "sr-Latn". */ - get transitFareLanguage(): string | null | undefined; + get transitFareLanguage(): string | null; /** * Converts to a plain object. */ @@ -16297,20 +16291,6 @@ declare namespace google.maps.routes { */ toJSON(key?: string): unknown; } - /** - * Corresponds to an origin passed to {@link google.maps.routes.RouteMatrix.computeRouteMatrix}. Contains a list of {@link google.maps.routes.RouteMatrixItem}s, each item representing a route to a destination. - * Access by calling `const {RouteMatrixRow} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class RouteMatrixRow { - /** - * The route information for each destination. - */ - get items(): google.maps.routes.RouteMatrixItem[]; - /** - * Converts to a plain object. - */ - toJSON(key?: string): unknown; - } /** * Contains route information computed for an origin/destination pair passed to {@link google.maps.routes.RouteMatrix.computeRouteMatrix}. * Access by calling `const {RouteMatrixItem} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. @@ -16349,632 +16329,558 @@ declare namespace google.maps.routes { */ get travelAdvisory(): google.maps.routes.RouteTravelAdvisory | null | undefined; } -} - -declare namespace google.maps.visualization { /** - * A layer that provides a client-side rendered heatmap, depicting the intensity of data at geographical points. - * Access by calling `const {HeatmapLayer} = await google.maps.importLibrary("visualization");`. See https://developers.google.com/maps/documentation/javascript/libraries. - * @deprecated The Heatmap Layer functionality in the Maps JavaScript API is no longer available in the Maps JavaScript API as of version 3.65. For more info, see https://developers.google.com/maps/deprecations. + * The condition of the route being returned. See the web service documentation for more information. + * + * Access by calling `const {RouteMatrixItemCondition} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class HeatmapLayer { + export enum RouteMatrixItemCondition { /** - * Creates a new instance of HeatmapLayer. the layer. + * A route was found, and the corresponding information was filled out for the element. See the web service documentation for more information. */ - constructor(); - } -} - -declare namespace google.maps.Data { - /** - * The properties of a addfeature event. - */ - export interface AddFeatureEvent { + ROUTE_EXISTS = 'ROUTE_EXISTS', /** - * The feature that was added to the FeatureCollection. + * No route could be found. See the web service documentation for more information. */ - feature: google.maps.Data.Feature; + ROUTE_NOT_FOUND = 'ROUTE_NOT_FOUND', } + export type RouteMatrixItemConditionString = `${google.maps.routes.RouteMatrixItemCondition}`; /** - * Optional parameters for importing GeoJSON. + * An error that occurred during {@link google.maps.routes.RouteMatrix.computeRouteMatrix} for a specific origin/destination pair. + * Access by calling `const {RouteMatrixItemError} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface GeoJsonOptions { + export class RouteMatrixItemError extends Error { /** - * The name of the Feature property to use as the feature ID. If not specified, the GeoJSON Feature id will be used. + * Converts to a plain object. */ - idPropertyName?: string | null; + toJSON(key?: string): unknown; } /** - * DataOptions object used to define the properties that a developer can set on a Data object. + * Text representations of the {@link google.maps.routes.RouteMatrixItem}. + * Access by calling `const {RouteMatrixItemLocalizedValues} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface DataOptions { + export class RouteMatrixItemLocalizedValues { /** - * The position of the drawing controls on the map. - * @defaultValue {@link google.maps.ControlPosition.TOP_LEFT} + * Travel distance of the route matrix item in text form. */ - controlPosition?: google.maps.ControlPosition; + get distance(): string | null | undefined; /** - * Describes which drawing modes are available for the user to select, in the order they are displayed. This should not include the null drawing mode, which is added by default. If null, drawing controls are disabled and not displayed. Possible drawing modes are "Point", "LineString" or "Polygon". - * @defaultValue null + * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - controls?: string[] | null; + get distanceLanguage(): string | null | undefined; /** - * The current drawing mode of the given Data layer. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything. Possible drawing modes are null, "Point", "LineString" or "Polygon". - * @defaultValue null + * Duration, represented in text form and localized to the region of the query. Takes traffic conditions into consideration.

Note: If you did not request traffic information, this value is the same value as {@link google.maps.routes.RouteMatrixItemLocalizedValues.staticDuration}. */ - drawingMode?: string | null; + get duration(): string | null | undefined; /** - * When drawing is enabled and a user draws a Geometry (a Point, Line String or Polygon), this function is called with that Geometry and should return a Feature that is to be added to the Data layer. If a featureFactory is not supplied, a Feature with no id and no properties will be created from that Geometry instead. Defaults to null. + * The duration text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - featureFactory?: ((arg0: google.maps.Data.Geometry) => google.maps.Data.Feature) | null; + get durationLanguage(): string | null | undefined; + /** + * Duration without taking traffic conditions into consideration, represented in text form. + */ + get staticDuration(): string | null | undefined; + /** + * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn". + */ + get staticDurationLanguage(): string | null | undefined; + /** + * Transit fare, represented in text form. + */ + get transitFare(): string | null | undefined; /** - * Map on which to display the features in the collection. + * The transit fare text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - map: google.maps.Map; + get transitFareLanguage(): string | null | undefined; /** - * Style for all features in the collection. For more details, see the setStyle() method above. + * Converts to a plain object. */ - style?: google.maps.Data.StylingFunction | google.maps.Data.StyleOptions; + toJSON(key?: string): unknown; } /** - * Optional parameters for creating Data.Feature objects. + * A single origin for a {@link google.maps.routes.ComputeRouteMatrixRequest}. */ - export interface FeatureOptions { - /** - * The feature geometry. If none is specified when a feature is constructed, the feature's geometry will be null. If a LatLng object or LatLngLiteral is given, this will be converted to a Data.Point geometry. - */ - geometry?: google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral | null; + export interface RouteMatrixOrigin { /** - * Feature ID is optional. If provided, it can be used to look up the feature in a Data object using the getFeatureById() method. Note that a feature's ID cannot be subsequently changed. + * Modifiers for every route that takes this as the origin. */ - id?: number | string; + routeModifiers?: google.maps.routes.RouteModifiers | null; /** - * The feature properties. This is an arbitrary mapping of property names to values. + * The location of the origin. A value passed as a string may be an address or plus code. Altitude values for are not taken into consideration. */ - properties?: object | null; + waypoint: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint; } /** - * A superclass for the various geometry objects. + * Corresponds to an origin passed to {@link google.maps.routes.RouteMatrix.computeRouteMatrix}. Contains a list of {@link google.maps.routes.RouteMatrixItem}s, each item representing a route to a destination. + * Access by calling `const {RouteMatrixRow} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface Geometry { + export class RouteMatrixRow { /** - * Repeatedly invokes the given function, passing a point from the geometry to the function on each invocation. + * The route information for each destination. */ - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + get items(): google.maps.routes.RouteMatrixItem[]; /** - * Returns the type of the geometry object. Possibilities are "Point", "MultiPoint", "LineString", "MultiLineString", "LinearRing", "Polygon", "MultiPolygon", or "GeometryCollection". + * Converts to a plain object. */ - getType(): string; + toJSON(key?: string): unknown; } /** - * A Point geometry contains a single LatLng. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Encapsulates a set of optional conditions to satisfy when calculating routes. */ - export class Point implements google.maps.Data.Geometry { - /** - * Constructs a Data.Point from the given LatLng or LatLngLiteral. - * @param latLng - */ - constructor(latLng: google.maps.LatLng | google.maps.LatLngLiteral); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + export interface RouteModifiers { /** - * Returns the contained LatLng. + * When set to true, avoids ferries where reasonable, giving preference to routes not containing ferries. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. */ - get(): google.maps.LatLng; + avoidFerries?: boolean | null; /** - * Returns the string "Point". + * When set to true, avoids highways where reasonable, giving preference to routes not containing highways. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. */ - getType(): string; - } - /** - * A feature has a geometry, an id, and a set of properties. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class Feature { + avoidHighways?: boolean | null; /** - * Constructs a Feature with the given options. - * @param options + * When set to true, avoids navigating indoors where reasonable, giving preference to routes not containing indoor navigation. Applies only to WALKING {@link google.maps.TravelMode}. */ - constructor(options?: google.maps.Data.FeatureOptions | null); + avoidIndoor?: boolean | null; /** - * Repeatedly invokes the given function, passing a property value and name on each invocation. The order of iteration through the properties is undefined. + * When set to true, avoids toll roads where reasonable, giving preference to routes not containing toll roads. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. */ - forEachProperty(callback: (arg0: unknown, arg1: string) => void): void; + avoidTolls?: boolean | null; /** - * Returns the feature's geometry. + * Encapsulates information about toll passes. If toll passes are provided, the API tries to return the pass price. If toll passes are not provided, the API treats the toll pass as unknown and tries to return the cash price. Applies only to DRIVING or TWO_WHEELER {@link google.maps.TravelMode}. See TollPass for a list of valid values. */ - getGeometry(): google.maps.Data.Geometry | null; + tollPasses?: Iterable | null; /** - * Returns the feature ID. + * Specifies the vehicle information. */ - getId(): number | string | undefined; + vehicleInfo?: google.maps.routes.VehicleInfo | null; + } + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Options for creating route 3D polylines. + */ + export interface RoutePolyline3DOptions { /** - * Returns the value of the requested property, or undefined if the property does not exist. + * The color scheme to use for the 3D polyline. When specified as FOLLOW_SYSTEM while the map colorScheme is also FOLLOW_SYSTEM, the polylines will be drawn in the same dark/light mode as the map. When not specified, {@link google.maps.routes.Route.create3DPolylines} attempts to use the colorScheme of the map or falls back to the system default. */ - getProperty(name: string): unknown; + colorScheme?: google.maps.ColorSchemeString; /** - * Removes the property with the given name. + * Options for customizing the style of a 3D polyline. */ - removeProperty(name: string): void; + polylineOptions?: google.maps.maps3d.Polyline3DElementOptions | ((arg0: google.maps.maps3d.Polyline3DElementOptions, arg1: google.maps.routes.RoutePolylineDetails) => google.maps.maps3d.Polyline3DElementOptions); + } + /** + * Details about a section of a route corresponding to a polyline that can be used to customize the polyline style. + */ + export interface RoutePolylineDetails { /** - * Sets the feature's geometry. + * The speed reading of the section of the route corresponding to this polyline. Only populated for routes with traffic information. */ - setGeometry(newGeometry: google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral | null): void; + speed?: google.maps.routes.SpeedString | null; /** - * Sets the value of the specified property. If newValue is undefined this is equivalent to calling removeProperty. + * The transit details of the section of the route corresponding to this polyline. Only populated for routes with transit information. */ - setProperty(name: string, newValue: unknown): void; + transitDetails?: google.maps.routes.TransitDetails | null; /** - * Exports the feature to a GeoJSON object. + * The travel mode of the section of the route corresponding to this polyline. Empty for traffic polylines. */ - toGeoJson(callback: (arg0: object) => void): void; + travelMode?: google.maps.TravelModeString | null; } /** - * The properties of a setgeometry event. + * Options for creating route polylines. */ - export interface SetGeometryEvent { - /** - * The feature whose geometry was set. - */ - feature: google.maps.Data.Feature; + export interface RoutePolylineOptions { /** - * The new feature geometry. + * The color scheme to use for the polyline. When specified as FOLLOW_SYSTEM while the map colorScheme is also FOLLOW_SYSTEM, the polylines will be drawn in the same dark/light mode as the map. When not specified, {@link google.maps.routes.Route.createPolylines} attempts to use the colorScheme of the map or falls back to the system default. */ - newGeometry?: google.maps.Data.Geometry; + colorScheme?: google.maps.ColorSchemeString; /** - * The previous feature geometry. + * Options for customizing the style of a polyline. Can either be a {@link google.maps.PolylineOptions} object that is applied to all polylines for the route or a function that takes default {@link google.maps.PolylineOptions} and {@link google.maps.routes.RoutePolylineDetails} and returns the {@link google.maps.PolylineOptions} to be applied to that polyline. */ - oldGeometry?: google.maps.Data.Geometry; + polylineOptions?: google.maps.PolylineOptions | ((arg0: google.maps.PolylineOptions, arg1: google.maps.routes.RoutePolylineDetails) => google.maps.PolylineOptions); } /** - * The properties of a setproperty event. + * Contains additional information that the user should be informed about on a {@link google.maps.routes.Route}. + * Access by calling `const {RouteTravelAdvisory} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface SetPropertyEvent { + export class RouteTravelAdvisory { /** - * The feature whose property was set. + * The predicted fuel consumption in microliters.

Note: If the fuel consumption exceeds 2^53 microliters, then this value is Number.POSITIVE_INFINITY. */ - feature: google.maps.Data.Feature; + get fuelConsumptionMicroliters(): number | undefined; /** - * The property name. + * The {@link google.maps.routes.Route} may have restrictions that are not suitable for the requested travel mode or route modifiers. */ - name: string; + get routeRestrictionsPartiallyIgnored(): boolean | null | undefined; /** - * The new value. + * Speed reading intervals detailing traffic density. Applicable in case of TRAFFIC_AWARE and TRAFFIC_AWARE_OPTIMAL {@link google.maps.routes.ComputeRoutesRequest.routingPreference}. The intervals cover the entire polyline of the {@link google.maps.routes.Route} without overlap. The start point of a specified interval is the same as the end point of the preceding interval.

Example:
 polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
speedReadingIntervals: [A,C), [C,D), [D,G)
*/ - newValue: unknown; + get speedReadingIntervals(): google.maps.routes.SpeedReadingInterval[] | undefined; /** - * The previous value. Will be undefined if the property was added. + * Contains information about tolls on the {@link google.maps.routes.Route}. This field is only populated if tolls are expected on the {@link google.maps.routes.Route}. If this field is set but {@link google.maps.routes.TollInfo.estimatedPrices} is not populated, then the route contains tolls but the estimated price is unknown. If this field is empty, then there are no tolls on the {@link google.maps.routes.Route}. */ - oldValue: unknown; + get tollInfo(): google.maps.routes.TollInfo | null | undefined; + /** + * If present, contains the total fare or ticket costs of this {@link google.maps.routes.Route}. This property is only returned for TRANSIT {@link google.maps.routes.ComputeRoutesRequest.travelMode} and only for routes where fare information is available for all transit steps. + */ + get transitFare(): google.maps.places.Money | null | undefined; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } /** - * The properties of a removeproperty event. + * A set of values that specify factors to take into consideration when calculating the route. See the web service documentation for more information. + * + * Access by calling `const {RoutingPreference} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface RemovePropertyEvent { + export enum RoutingPreference { /** - * The feature whose property was removed. + * Calculates routes taking live traffic conditions into consideration. See the web service documentation for more information. */ - feature: google.maps.Data.Feature; + TRAFFIC_AWARE = 'TRAFFIC_AWARE', /** - * The property name. + * Calculates the routes taking live traffic conditions into consideration, without applying most performance optimizations. See the web service documentation for more information. */ - name: string; + TRAFFIC_AWARE_OPTIMAL = 'TRAFFIC_AWARE_OPTIMAL', /** - * The previous value. + * Computes routes without taking live traffic conditions into consideration. See the web service documentation for more information. */ - oldValue: unknown; + TRAFFIC_UNAWARE = 'TRAFFIC_UNAWARE', } + export type RoutingPreferenceString = `${google.maps.routes.RoutingPreference}`; /** - * This object is passed to mouse event handlers on a Data object. + * The classification of polyline speed based on traffic data. See the web service documentation for more information. + * + * Access by calling `const {Speed} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export interface MouseEvent extends google.maps.MapMouseEvent { + export enum Speed { /** - * The feature which generated the mouse event. + * Normal speed, no traffic delays. See the web service documentation for more information. */ - feature: google.maps.Data.Feature; - } - /** - * The properties of a removefeature event. - */ - export interface RemoveFeatureEvent { + NORMAL = 'NORMAL', /** - * The feature that was removed from the FeatureCollection. + * Slowdown detected, medium amount of traffic. See the web service documentation for more information. */ - feature: google.maps.Data.Feature; + SLOW = 'SLOW', + /** + * Traffic delays. See the web service documentation for more information. + */ + TRAFFIC_JAM = 'TRAFFIC_JAM', } + export type SpeedString = `${google.maps.routes.Speed}`; /** - * These options specify the way a Feature should appear when displayed on a map. + * Groups together the {@link google.maps.LatLngAltitude}s of a route interval with the speed reading for the interval. */ - export interface StyleOptions { + export interface SpeedPath { /** - * The animation to play when marker is added to a map. Only applies to point geometries. + * The path covered by this speed path. */ - animation?: google.maps.Animation; + path: google.maps.LatLngAltitude[]; /** - * If true, the marker receives mouse and touch events. - * @defaultValue true + * The speed reading of the path. */ - clickable?: boolean; + speed?: google.maps.routes.SpeedString | null; + } + /** + * Traffic density indicator on a contiguous segment of a polyline or path. Given a path with points P_0, P_1, ... , P_N (zero-based index), the SpeedReadingInterval describes the traffic density of an interval. + * Access by calling `const {SpeedReadingInterval} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class SpeedReadingInterval { /** - * Mouse cursor to show on hover. Only applies to point geometries. + * The ending index of this interval in the polyline. */ - cursor?: string; + get endPolylinePointIndex(): number | null | undefined; /** - * If true, the object can be dragged across the map and the underlying feature will have its geometry updated. - * @defaultValue false + * Traffic speed in this interval. */ - draggable?: boolean; + get speed(): google.maps.routes.SpeedString | null | undefined; /** - * If true, the object can be edited by dragging control points and the underlying feature will have its geometry updated. Only applies to LineString and Polygon geometries. - * @defaultValue false + * The starting index of this interval in the polyline. */ - editable?: boolean; + get startPolylinePointIndex(): number | null | undefined; + } + /** + * Provides overview information about a list of {@link google.maps.routes.RouteLeg.steps}. + * Access by calling `const {StepsOverview} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class StepsOverview { /** - * The fill color. All CSS3 colors are supported except for extended named colors. Only applies to polygon geometries. + * Summarized information about different multi-modal segments of the {@link google.maps.routes.RouteLeg.steps}. */ - fillColor?: string; + get multiModalSegments(): google.maps.routes.MultiModalSegment[]; /** - * The fill opacity between 0.0 and 1.0. Only applies to polygon geometries. + * Converts to a plain object. */ - fillOpacity?: number; + toJSON(key?: string): unknown; + } + /** + * Encapsulates toll information on a {@link google.maps.routes.Route} or {@link google.maps.routes.RouteLeg}. + * Access by calling `const {TollInfo} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class TollInfo { /** - * Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url. Only applies to point geometries. + * The monetary amount of tolls for the corresponding {@link google.maps.routes.Route} or {@link google.maps.routes.RouteLeg}. This list contains an amount for each currency that is expected to be charged by toll stations. Typically this list will contain only one item for routes with tolls in one currency. For international trips, this list may contain multiple items to reflect tolls in different currencies. This field may be an empty array if tolls are expected but the estimated price is unknown. */ - icon?: string | google.maps.Icon | google.maps.Symbol; + get estimatedPrices(): google.maps.places.Money[] | null | undefined; /** - * The icons to be rendered along a polyline. Only applies to line geometries. + * Converts to a plain object. */ - icons?: google.maps.IconSequence[]; + toJSON(key?: string): unknown; + } + /** + * Information about a transit agency. + * Access by calling `const {TransitAgency} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class TransitAgency { /** - * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. Only applies to point geometries. + * The name of this transit agency. */ - label?: string | google.maps.MarkerLabel; + get name(): string | null; /** - * The marker's opacity between 0.0 and 1.0. Only applies to point geometries. + * The transit agency's locale-specific formatted phone number. */ - opacity?: number; + get phoneNumber(): string | null; /** - * Defines the image map used for hit detection. Only applies to point geometries. + * The transit agency's URL. */ - shape?: google.maps.MarkerShape; + get url(): URL | null; /** - * The stroke color. All CSS3 colors are supported except for extended named colors. Only applies to line and polygon geometries. + * Converts to a plain object. */ - strokeColor?: string; + toJSON(key?: string): unknown; + } + /** + * Additional information about a transit step in a route. + * Access by calling `const {TransitDetails} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class TransitDetails { /** - * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon geometries. + * Information about the arrival stop for the step. */ - strokeOpacity?: number; + get arrivalStop(): google.maps.routes.TransitStop | null; /** - * The stroke width in pixels. Only applies to line and polygon geometries. + * The estimated time of arrival for the step. */ - strokeWeight?: number; + get arrivalTime(): Date | null; /** - * Rollover text. Only applies to point geometries. + * Information about the departure stop for the step. */ - title?: string; + get departureStop(): google.maps.routes.TransitStop | null; /** - * Whether the feature is visible. - * @defaultValue true + * The estimated time of departure for the step. */ - visible?: boolean; + get departureTime(): Date | null; /** - * All features are displayed on the map in order of their zIndex, with higher values displaying in front of features with lower values. Markers are always displayed in front of line-strings and polygons. + * Specifies the direction in which to travel on this line as marked on the vehicle or at the departure stop. The direction is often the terminus station. */ - zIndex?: number; - } - - export type StylingFunction = (arg0: google.maps.Data.Feature) => google.maps.Data.StyleOptions; - /** - * A GeometryCollection contains a number of geometry objects. Any LatLng or LatLngLiteral objects are automatically converted to Data.Point geometry objects. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class GeometryCollection implements google.maps.Data.Geometry { + get headsign(): string | null; /** - * Constructs a Data.GeometryCollection from the given geometry objects or LatLngs. - * @param elements + * Specifies the expected time in milliseconds between departures from the same stop at this time. For example, with a headway value of 600,000, you would expect a ten minute wait if you should miss your bus.

Note: If the headway exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY. */ - constructor(elements: (google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral)[]); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + get headwayMillis(): number | null; /** - * Returns an array of the contained geometry objects. A new array is returned each time getArray() is called. + * The number of stops from the departure to the arrival stop. This count includes the arrival stop, but excludes the departure stop. For example, if your route leaves from Stop A, passes through stops B and C, and arrives at stop D, stopCount will be 3. */ - getArray(): google.maps.Data.Geometry[]; + get stopCount(): number; /** - * Returns the n-th contained geometry object. + * Information about the transit line used in the step. */ - getAt(n: number): google.maps.Data.Geometry; + get transitLine(): google.maps.routes.TransitLine | null; /** - * Returns the number of contained geometry objects. + * The text that appears in schedules and sign boards to identify a transit trip to passengers. The text uniquely identifies a trip within a service day. For example, "538" is the tripShortText of the Amtrak train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA. */ - getLength(): number; + get tripShortText(): string | null; /** - * Returns the string "GeometryCollection". + * Converts to a plain object. */ - getType(): string; + toJSON(key?: string): unknown; } /** - * A LineString geometry contains a number of LatLngs. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Information about a transit line. + * Access by calling `const {TransitLine} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class LineString implements google.maps.Data.Geometry { - /** - * Constructs a Data.LineString from the given LatLngs or LatLngLiterals. - * @param elements - */ - constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + export class TransitLine { /** - * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called. + * The transit agency (or agencies) that operates this transit line. */ - getArray(): google.maps.LatLng[]; + get agencies(): google.maps.routes.TransitAgency[]; /** - * Returns the n-th contained LatLng. + * The color commonly used in signage for this line. Represented in hexadecimal. */ - getAt(n: number): google.maps.LatLng; + get color(): string | null; /** - * Returns the number of contained LatLngs. + * The URL for the icon associated with this line. */ - getLength(): number; + get iconURL(): URL | null; /** - * Returns the string "LineString". + * The full name of this transit line, For example, "8 Avenue Local". */ - getType(): string; - } - /** - * A LinearRing geometry contains a number of LatLngs, representing a closed LineString. There is no need to make the first LatLng equal to the last LatLng. The LinearRing is closed implicitly. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. - */ - export class LinearRing implements google.maps.Data.Geometry { + get name(): string | null; /** - * Constructs a Data.LinearRing from the given LatLngs or LatLngLiterals. - * @param elements + * The short name of this transit line. This name will normally be a line number, such as "M7" or "355". */ - constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + get shortName(): string | null; /** - * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called. + * The color commonly used in text on signage for this line. Represented in hexadecimal. */ - getArray(): google.maps.LatLng[]; + get textColor(): string | null; /** - * Returns the n-th contained LatLng. + * The URL for this transit line as provided by the transit agency. */ - getAt(n: number): google.maps.LatLng; + get url(): URL | null; /** - * Returns the number of contained LatLngs. + * The type of vehicle that operates on this transit line. */ - getLength(): number; + get vehicle(): google.maps.routes.TransitVehicle | null; /** - * Returns the string "LinearRing". + * Converts to a plain object. */ - getType(): string; + toJSON(key?: string): unknown; } /** - * A MultiLineString geometry contains a number of LineStrings. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Preferences for TRANSIT based routes that influence the route that is returned. */ - export class MultiLineString implements google.maps.Data.Geometry { + export interface TransitPreference { /** - * Constructs a Data.MultiLineString from the given Data.LineStrings or arrays of positions. - * @param elements + * A set of travel modes to use when getting a TRANSIT route. Defaults to all supported modes of travel. */ - constructor(elements: (google.maps.Data.LineString | (google.maps.LatLng | google.maps.LatLngLiteral)[])[]); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + allowedTransitModes?: Iterable; /** - * Returns an array of the contained Data.LineStrings. A new array is returned each time getArray() is called. + * A routing preference that, when specified, influences the TRANSIT route returned. */ - getArray(): google.maps.Data.LineString[]; + routingPreference?: google.maps.TransitRoutePreferenceString; + } + /** + * Information about a transit stop. + * Access by calling `const {TransitStop} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class TransitStop { /** - * Returns the n-th contained Data.LineString. + * The location of the stop expressed in latitude/longitude coordinates and an optional heading. */ - getAt(n: number): google.maps.Data.LineString; + get location(): google.maps.routes.DirectionalLocation | null; /** - * Returns the number of contained Data.LineStrings. + * The name of the transit stop. */ - getLength(): number; + get name(): string | null; /** - * Returns the string "MultiLineString". + * Converts to a plain object. */ - getType(): string; + toJSON(key?: string): unknown; } /** - * A MultiPoint geometry contains a number of LatLngs. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Information about a vehicle used in transit routes. + * Access by calling `const {TransitVehicle} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class MultiPoint implements google.maps.Data.Geometry { + export class TransitVehicle { /** - * Constructs a Data.MultiPoint from the given LatLngs or LatLngLiterals. - * @param elements + * The URL for an icon associated with this vehicle type. */ - constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + get iconURL(): URL | null; /** - * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called. + * The URL for the icon associated with this vehicle type, based on the local transport signage. */ - getArray(): google.maps.LatLng[]; + get localIconURL(): URL | null; /** - * Returns the n-th contained LatLng. + * The name of this vehicle, capitalized. */ - getAt(n: number): google.maps.LatLng; + get name(): string | null; /** - * Returns the number of contained LatLngs. + * The vehicle name text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information see: https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */ - getLength(): number; + get nameLanguage(): string | null; /** - * Returns the string "MultiPoint". + * The type of vehicle used.

See https://developers.google.com/maps/documentation/routes/reference/rpc/google.maps.routing.v2#transitvehicletype for a list of possible values. */ - getType(): string; + get vehicleType(): string | null; + /** + * Converts to a plain object. + */ + toJSON(key?: string): unknown; } /** - * A Polygon geometry contains a number of Data.LinearRings. The first linear-ring must be the polygon exterior boundary and subsequent linear-rings must be interior boundaries, also known as holes. See the sample polygon with a hole. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * A set of values describing the vehicle's emission type. See the web service documentation for more information. + * + * Access by calling `const {VehicleEmissionType} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class Polygon implements google.maps.Data.Geometry { + export enum VehicleEmissionType { /** - * Constructs a Data.Polygon from the given Data.LinearRings or arrays of positions. - * @param elements + * Diesel fueled vehicle. See the web service documentation for more information. */ - constructor(elements: (google.maps.Data.LinearRing | (google.maps.LatLng | google.maps.LatLngLiteral)[])[]); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + DIESEL = 'DIESEL', /** - * Returns an array of the contained Data.LinearRings. A new array is returned each time getArray() is called. + * Electricity powered vehicle. See the web service documentation for more information. */ - getArray(): google.maps.Data.LinearRing[]; + ELECTRIC = 'ELECTRIC', /** - * Returns the n-th contained Data.LinearRing. + * Gasoline/petrol fueled vehicle. See the web service documentation for more information. */ - getAt(n: number): google.maps.Data.LinearRing; + GASOLINE = 'GASOLINE', /** - * Returns the number of contained Data.LinearRings. + * Hybrid fuel (such as gasoline + electric) vehicle. See the web service documentation for more information. */ - getLength(): number; + HYBRID = 'HYBRID', + } + export type VehicleEmissionTypeString = `${google.maps.routes.VehicleEmissionType}`; + /** + * Contains the vehicle information, such as the vehicle emission type. + */ + export interface VehicleInfo { /** - * Returns the string "Polygon". + * Describes the vehicle's emission type. Applies only to the DRIVING travel mode. */ - getType(): string; + emissionType?: google.maps.routes.VehicleEmissionTypeString | null; } /** - * A MultiPolygon geometry contains a number of Data.Polygons. - * Access by calling `const {Data} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * Represents a waypoint in a route. */ - export class MultiPolygon implements google.maps.Data.Geometry { + export interface Waypoint { + /** + * The location of the waypoint. A string may be an address, a plus code, or a Place resource name. + */ + location: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place; + /** + * Indicates that the location of this waypoint is meant to have a preference for the vehicle to stop at a particular side of road. When you set this value, the route will pass through the location so that the vehicle can stop at the side of road that the location is biased towards from the center of the road. This option works only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode} + */ + sideOfRoad?: boolean | null; /** - * Constructs a Data.MultiPolygon from the given Data.Polygons or arrays of positions. - * @param elements + * Indicates that the waypoint is meant for vehicles to stop at, where the intention is to either pickup or drop-off. When you set this value, the calculated route won't include non-via waypoints on roads that are unsuitable for pickup and drop-off. This option works only for DRIVING and TWO_WHEELER {@link google.maps.routes.ComputeRoutesRequest.travelMode} and when the {@link google.maps.routes.Waypoint.location} is not a string or a {@link google.maps.places.Place}. */ - constructor(elements: (google.maps.Data.Polygon | (google.maps.Data.LinearRing | (google.maps.LatLng | google.maps.LatLngLiteral)[])[])[]); - - forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void; + vehicleStopover?: boolean | null; /** - * Returns an array of the contained Data.Polygons. A new array is returned each time getArray() is called. + * Marks this waypoint as a milestone rather a stopping point. For each non-via waypoint in the {@link google.maps.routes.ComputeRoutesRequest}, {@link google.maps.routes.Route.computeRoutes} appends an entry to the {@link google.maps.routes.Route.legs} array to provide the details for stopovers on that leg of the trip.

Set this value to true when you want the route to pass through this waypoint without stopping over. Via waypoints don't cause an entry to be added to the {@link google.maps.routes.Route.legs} array, but they do route the journey through the waypoint.

Notes:
  • You can only set this value on waypoints that are intermediates. The request fails if you set this field on terminal waypoints.
  • If {@link google.maps.routes.ComputeRoutesRequest.optimizeWaypointOrder} is set to true, this field cannot be set to true; otherwise, the request fails.
*/ - getArray(): google.maps.Data.Polygon[]; + via?: boolean | null; + } + /** + * Details about a waypoint that can be used to customize marker style. + */ + export interface WaypointMarkerDetails { /** - * Returns the n-th contained Data.Polygon. + * The index of the marker. */ - getAt(n: number): google.maps.Data.Polygon; + index: number; /** - * Returns the number of contained Data.Polygons. + * The leg that the marker belongs to. Empty if the route has no legs. */ - getLength(): number; + leg?: google.maps.routes.RouteLeg; /** - * Returns the string "MultiPolygon". + * The total number of markers in the route. */ - getType(): string; - } -} -declare namespace google.maps { - export interface HTMLElementTagNameMap { - "gmp-map": google.maps.MapElement; - "gmp-air-quality-meter": google.maps.airQuality.AirQualityMeterElement; - "gmp-advanced-marker": google.maps.marker.AdvancedMarkerElement; - "gmp-circle-path": google.maps.maps3d.CirclePathElement; - "gmp-flattener": google.maps.maps3d.FlattenerElement; - "gmp-marker-3d": google.maps.maps3d.Marker3DElement; - "gmp-marker-3d-interactive": google.maps.maps3d.Marker3DInteractiveElement; - "gmp-marker": google.maps.maps3d.MarkerElement; - "gmp-marker-interactive": google.maps.maps3d.MarkerInteractiveElement; - "gmp-model-3d": google.maps.maps3d.Model3DElement; - "gmp-model-3d-interactive": google.maps.maps3d.Model3DInteractiveElement; - "gmp-polygon-3d": google.maps.maps3d.Polygon3DElement; - "gmp-polygon-3d-interactive": google.maps.maps3d.Polygon3DInteractiveElement; - "gmp-polyline-3d": google.maps.maps3d.Polyline3DElement; - "gmp-polyline-3d-interactive": google.maps.maps3d.Polyline3DInteractiveElement; - "gmp-map-3d": google.maps.maps3d.Map3DElement; - "gmp-popover": google.maps.maps3d.PopoverElement; - "gmp-place-all-content": google.maps.places.PlaceAllContentElement; - "gmp-place-accessible-entrance-icon": google.maps.places.PlaceAccessibleEntranceIconElement; - "gmp-place-address": google.maps.places.PlaceAddressElement; - "gmp-place-feature-list": google.maps.places.PlaceFeatureListElement; - "gmp-place-media": google.maps.places.PlaceMediaElement; - "gmp-place-open-now-status": google.maps.places.PlaceOpenNowStatusElement; - "gmp-place-opening-hours": google.maps.places.PlaceOpeningHoursElement; - "gmp-place-phone-number": google.maps.places.PlacePhoneNumberElement; - "gmp-place-plus-code": google.maps.places.PlacePlusCodeElement; - "gmp-place-price": google.maps.places.PlacePriceElement; - "gmp-place-rating": google.maps.places.PlaceRatingElement; - "gmp-place-review-summary": google.maps.places.PlaceReviewSummaryElement; - "gmp-place-reviews": google.maps.places.PlaceReviewsElement; - "gmp-place-summary": google.maps.places.PlaceSummaryElement; - "gmp-place-type": google.maps.places.PlaceTypeElement; - "gmp-place-type-specific-highlights": google.maps.places.PlaceTypeSpecificHighlightsElement; - "gmp-place-website": google.maps.places.PlaceWebsiteElement; - "gmp-place-attribution": google.maps.places.PlaceAttributionElement; - "gmp-place-content-config": google.maps.places.PlaceContentConfigElement; - "gmp-place-standard-content": google.maps.places.PlaceStandardContentElement; - "gmp-place-details-location-request": google.maps.places.PlaceDetailsLocationRequestElement; - "gmp-place-details-place-request": google.maps.places.PlaceDetailsPlaceRequestElement; - "gmp-place-details-compact": google.maps.places.PlaceDetailsCompactElement; - "gmp-place-details": google.maps.places.PlaceDetailsElement; - "gmp-place-nearby-search-request": google.maps.places.PlaceNearbySearchRequestElement; - "gmp-place-text-search-request": google.maps.places.PlaceTextSearchRequestElement; - "gmp-place-search": google.maps.places.PlaceSearchElement; - "gmp-basic-place-autocomplete": google.maps.places.BasicPlaceAutocompleteElement; - "gmp-place-contextual-list-config": google.maps.places.PlaceContextualListConfigElement; - "gmp-place-contextual": google.maps.places.PlaceContextualElement; - "gmp-place-autocomplete": google.maps.places.PlaceAutocompleteElement; - "gmp-route-3d": google.maps.routes.Route3DElement; + totalMarkers: number; } } -declare interface HTMLElementTagNameMap extends google.maps.HTMLElementTagNameMap {} -declare namespace google.maps { - export interface HTMLElementEventMapTagNameMap { - "gmp-map": google.maps.MapElementEventMap; - "gmp-air-quality-meter": google.maps.airQuality.AirQualityMeterElementEventMap; - "gmp-advanced-marker": google.maps.marker.AdvancedMarkerElementEventMap; - "gmp-circle-path": google.maps.maps3d.CirclePathElementEventMap; - "gmp-flattener": google.maps.maps3d.FlattenerElementEventMap; - "gmp-marker-3d": google.maps.maps3d.Marker3DElementEventMap; - "gmp-marker-3d-interactive": google.maps.maps3d.Marker3DInteractiveElementEventMap; - "gmp-marker": google.maps.maps3d.MarkerElementEventMap; - "gmp-marker-interactive": google.maps.maps3d.MarkerInteractiveElementEventMap; - "gmp-model-3d": google.maps.maps3d.Model3DElementEventMap; - "gmp-model-3d-interactive": google.maps.maps3d.Model3DInteractiveElementEventMap; - "gmp-polygon-3d": google.maps.maps3d.Polygon3DElementEventMap; - "gmp-polygon-3d-interactive": google.maps.maps3d.Polygon3DInteractiveElementEventMap; - "gmp-polyline-3d": google.maps.maps3d.Polyline3DElementEventMap; - "gmp-polyline-3d-interactive": google.maps.maps3d.Polyline3DInteractiveElementEventMap; - "gmp-map-3d": google.maps.maps3d.Map3DElementEventMap; - "gmp-popover": google.maps.maps3d.PopoverElementEventMap; - "gmp-place-all-content": google.maps.places.PlaceAllContentElementEventMap; - "gmp-place-accessible-entrance-icon": google.maps.places.PlaceAccessibleEntranceIconElementEventMap; - "gmp-place-address": google.maps.places.PlaceAddressElementEventMap; - "gmp-place-feature-list": google.maps.places.PlaceFeatureListElementEventMap; - "gmp-place-media": google.maps.places.PlaceMediaElementEventMap; - "gmp-place-open-now-status": google.maps.places.PlaceOpenNowStatusElementEventMap; - "gmp-place-opening-hours": google.maps.places.PlaceOpeningHoursElementEventMap; - "gmp-place-phone-number": google.maps.places.PlacePhoneNumberElementEventMap; - "gmp-place-plus-code": google.maps.places.PlacePlusCodeElementEventMap; - "gmp-place-price": google.maps.places.PlacePriceElementEventMap; - "gmp-place-rating": google.maps.places.PlaceRatingElementEventMap; - "gmp-place-review-summary": google.maps.places.PlaceReviewSummaryElementEventMap; - "gmp-place-reviews": google.maps.places.PlaceReviewsElementEventMap; - "gmp-place-summary": google.maps.places.PlaceSummaryElementEventMap; - "gmp-place-type": google.maps.places.PlaceTypeElementEventMap; - "gmp-place-type-specific-highlights": google.maps.places.PlaceTypeSpecificHighlightsElementEventMap; - "gmp-place-website": google.maps.places.PlaceWebsiteElementEventMap; - "gmp-place-attribution": google.maps.places.PlaceAttributionElementEventMap; - "gmp-place-content-config": google.maps.places.PlaceContentConfigElementEventMap; - "gmp-place-standard-content": google.maps.places.PlaceStandardContentElementEventMap; - "gmp-place-details-location-request": google.maps.places.PlaceDetailsLocationRequestElementEventMap; - "gmp-place-details-place-request": google.maps.places.PlaceDetailsPlaceRequestElementEventMap; - "gmp-place-details-compact": google.maps.places.PlaceDetailsCompactElementEventMap; - "gmp-place-details": google.maps.places.PlaceDetailsElementEventMap; - "gmp-place-nearby-search-request": google.maps.places.PlaceNearbySearchRequestElementEventMap; - "gmp-place-text-search-request": google.maps.places.PlaceTextSearchRequestElementEventMap; - "gmp-place-search": google.maps.places.PlaceSearchElementEventMap; - "gmp-basic-place-autocomplete": google.maps.places.BasicPlaceAutocompleteElementEventMap; - "gmp-place-contextual-list-config": google.maps.places.PlaceContextualListConfigElementEventMap; - "gmp-place-contextual": google.maps.places.PlaceContextualElementEventMap; - "gmp-place-autocomplete": google.maps.places.PlaceAutocompleteElementEventMap; - "gmp-route-3d": google.maps.routes.Route3DElementEventMap; + +declare namespace google.maps.visualization { + /** + * A layer that provides a client-side rendered heatmap, depicting the intensity of data at geographical points. + * Access by calling `const {HeatmapLayer} = await google.maps.importLibrary("visualization");`. See https://developers.google.com/maps/documentation/javascript/libraries. + * @deprecated The Heatmap Layer functionality in the Maps JavaScript API is no longer available in the Maps JavaScript API as of version 3.65. For more info, see https://developers.google.com/maps/deprecations. + */ + export class HeatmapLayer { + /** + * Creates a new instance of HeatmapLayer. the layer. + */ + constructor(); } } declare namespace google.maps { @@ -17022,4 +16928,164 @@ declare namespace google.maps { "--gmp-star-rating-color"?: string; "--gmp-thumbnail-border-radius"?: string; } -} \ No newline at end of file +} +declare namespace google.maps { + export interface HTMLElementEventMapTagNameMap { + "gmp-advanced-marker": google.maps.marker.AdvancedMarkerElementEventMap; + "gmp-air-quality-meter": google.maps.airQuality.AirQualityMeterElementEventMap; + "gmp-basic-place-autocomplete": google.maps.places.BasicPlaceAutocompleteElementEventMap; + "gmp-circle-path": google.maps.maps3d.CirclePathElementEventMap; + "gmp-flattener": google.maps.maps3d.FlattenerElementEventMap; + "gmp-map": google.maps.MapElementEventMap; + "gmp-map-3d": google.maps.maps3d.Map3DElementEventMap; + "gmp-marker": google.maps.maps3d.MarkerElementEventMap; + "gmp-marker-3d": google.maps.maps3d.Marker3DElementEventMap; + "gmp-marker-3d-interactive": google.maps.maps3d.Marker3DInteractiveElementEventMap; + "gmp-marker-interactive": google.maps.maps3d.MarkerInteractiveElementEventMap; + "gmp-model-3d": google.maps.maps3d.Model3DElementEventMap; + "gmp-model-3d-interactive": google.maps.maps3d.Model3DInteractiveElementEventMap; + "gmp-place-accessible-entrance-icon": google.maps.places.PlaceAccessibleEntranceIconElementEventMap; + "gmp-place-address": google.maps.places.PlaceAddressElementEventMap; + "gmp-place-all-content": google.maps.places.PlaceAllContentElementEventMap; + "gmp-place-attribution": google.maps.places.PlaceAttributionElementEventMap; + "gmp-place-autocomplete": google.maps.places.PlaceAutocompleteElementEventMap; + "gmp-place-content-config": google.maps.places.PlaceContentConfigElementEventMap; + "gmp-place-contextual": google.maps.places.PlaceContextualElementEventMap; + "gmp-place-contextual-list-config": google.maps.places.PlaceContextualListConfigElementEventMap; + "gmp-place-details": google.maps.places.PlaceDetailsElementEventMap; + "gmp-place-details-compact": google.maps.places.PlaceDetailsCompactElementEventMap; + "gmp-place-details-location-request": google.maps.places.PlaceDetailsLocationRequestElementEventMap; + "gmp-place-details-place-request": google.maps.places.PlaceDetailsPlaceRequestElementEventMap; + "gmp-place-feature-list": google.maps.places.PlaceFeatureListElementEventMap; + "gmp-place-media": google.maps.places.PlaceMediaElementEventMap; + "gmp-place-nearby-search-request": google.maps.places.PlaceNearbySearchRequestElementEventMap; + "gmp-place-open-now-status": google.maps.places.PlaceOpenNowStatusElementEventMap; + "gmp-place-opening-hours": google.maps.places.PlaceOpeningHoursElementEventMap; + "gmp-place-phone-number": google.maps.places.PlacePhoneNumberElementEventMap; + "gmp-place-plus-code": google.maps.places.PlacePlusCodeElementEventMap; + "gmp-place-price": google.maps.places.PlacePriceElementEventMap; + "gmp-place-rating": google.maps.places.PlaceRatingElementEventMap; + "gmp-place-review-summary": google.maps.places.PlaceReviewSummaryElementEventMap; + "gmp-place-reviews": google.maps.places.PlaceReviewsElementEventMap; + "gmp-place-search": google.maps.places.PlaceSearchElementEventMap; + "gmp-place-standard-content": google.maps.places.PlaceStandardContentElementEventMap; + "gmp-place-summary": google.maps.places.PlaceSummaryElementEventMap; + "gmp-place-text-search-request": google.maps.places.PlaceTextSearchRequestElementEventMap; + "gmp-place-type": google.maps.places.PlaceTypeElementEventMap; + "gmp-place-type-specific-highlights": google.maps.places.PlaceTypeSpecificHighlightsElementEventMap; + "gmp-place-website": google.maps.places.PlaceWebsiteElementEventMap; + "gmp-polygon-3d": google.maps.maps3d.Polygon3DElementEventMap; + "gmp-polygon-3d-interactive": google.maps.maps3d.Polygon3DInteractiveElementEventMap; + "gmp-polyline-3d": google.maps.maps3d.Polyline3DElementEventMap; + "gmp-polyline-3d-interactive": google.maps.maps3d.Polyline3DInteractiveElementEventMap; + "gmp-popover": google.maps.maps3d.PopoverElementEventMap; + "gmp-route-3d": google.maps.routes.Route3DElementEventMap; + } +} +declare namespace google.maps { + export interface HTMLElementOptionsTagNameMap { + "gmp-advanced-marker": google.maps.marker.AdvancedMarkerElementOptions; + "gmp-air-quality-meter": google.maps.airQuality.AirQualityMeterElementOptions; + "gmp-basic-place-autocomplete": google.maps.places.BasicPlaceAutocompleteElementOptions; + "gmp-circle-path": google.maps.maps3d.CirclePathElementOptions; + "gmp-flattener": google.maps.maps3d.FlattenerElementOptions; + "gmp-map": google.maps.MapElementOptions; + "gmp-map-3d": google.maps.maps3d.Map3DElementOptions; + "gmp-marker": google.maps.maps3d.MarkerElementOptions; + "gmp-marker-3d": google.maps.maps3d.Marker3DElementOptions; + "gmp-marker-3d-interactive": google.maps.maps3d.Marker3DInteractiveElementOptions; + "gmp-marker-interactive": google.maps.maps3d.MarkerInteractiveElementOptions; + "gmp-model-3d": google.maps.maps3d.Model3DElementOptions; + "gmp-model-3d-interactive": google.maps.maps3d.Model3DInteractiveElementOptions; + "gmp-place-accessible-entrance-icon": google.maps.places.PlaceAccessibleEntranceIconElementOptions; + "gmp-place-address": google.maps.places.PlaceAddressElementOptions; + "gmp-place-all-content": google.maps.places.PlaceAllContentElementOptions; + "gmp-place-attribution": google.maps.places.PlaceAttributionElementOptions; + "gmp-place-autocomplete": google.maps.places.PlaceAutocompleteElementOptions; + "gmp-place-content-config": google.maps.places.PlaceContentConfigElementOptions; + "gmp-place-contextual": google.maps.places.PlaceContextualElementOptions; + "gmp-place-contextual-list-config": google.maps.places.PlaceContextualListConfigElementOptions; + "gmp-place-details": google.maps.places.PlaceDetailsElementOptions; + "gmp-place-details-compact": google.maps.places.PlaceDetailsCompactElementOptions; + "gmp-place-details-location-request": google.maps.places.PlaceDetailsLocationRequestElementOptions; + "gmp-place-details-place-request": google.maps.places.PlaceDetailsPlaceRequestElementOptions; + "gmp-place-feature-list": google.maps.places.PlaceFeatureListElementOptions; + "gmp-place-media": google.maps.places.PlaceMediaElementOptions; + "gmp-place-nearby-search-request": google.maps.places.PlaceNearbySearchRequestElementOptions; + "gmp-place-open-now-status": google.maps.places.PlaceOpenNowStatusElementOptions; + "gmp-place-opening-hours": google.maps.places.PlaceOpeningHoursElementOptions; + "gmp-place-phone-number": google.maps.places.PlacePhoneNumberElementOptions; + "gmp-place-plus-code": google.maps.places.PlacePlusCodeElementOptions; + "gmp-place-price": google.maps.places.PlacePriceElementOptions; + "gmp-place-rating": google.maps.places.PlaceRatingElementOptions; + "gmp-place-review-summary": google.maps.places.PlaceReviewSummaryElementOptions; + "gmp-place-reviews": google.maps.places.PlaceReviewsElementOptions; + "gmp-place-search": google.maps.places.PlaceSearchElementOptions; + "gmp-place-standard-content": google.maps.places.PlaceStandardContentElementOptions; + "gmp-place-summary": google.maps.places.PlaceSummaryElementOptions; + "gmp-place-text-search-request": google.maps.places.PlaceTextSearchRequestElementOptions; + "gmp-place-type": google.maps.places.PlaceTypeElementOptions; + "gmp-place-type-specific-highlights": google.maps.places.PlaceTypeSpecificHighlightsElementOptions; + "gmp-place-website": google.maps.places.PlaceWebsiteElementOptions; + "gmp-polygon-3d": google.maps.maps3d.Polygon3DElementOptions; + "gmp-polygon-3d-interactive": google.maps.maps3d.Polygon3DInteractiveElementOptions; + "gmp-polyline-3d": google.maps.maps3d.Polyline3DElementOptions; + "gmp-polyline-3d-interactive": google.maps.maps3d.Polyline3DInteractiveElementOptions; + "gmp-popover": google.maps.maps3d.PopoverElementOptions; + "gmp-route-3d": google.maps.routes.Route3DElementOptions; + } +} +declare namespace google.maps { + export interface HTMLElementTagNameMap { + "gmp-advanced-marker": google.maps.marker.AdvancedMarkerElement; + "gmp-air-quality-meter": google.maps.airQuality.AirQualityMeterElement; + "gmp-basic-place-autocomplete": google.maps.places.BasicPlaceAutocompleteElement; + "gmp-circle-path": google.maps.maps3d.CirclePathElement; + "gmp-flattener": google.maps.maps3d.FlattenerElement; + "gmp-map": google.maps.MapElement; + "gmp-map-3d": google.maps.maps3d.Map3DElement; + "gmp-marker": google.maps.maps3d.MarkerElement; + "gmp-marker-3d": google.maps.maps3d.Marker3DElement; + "gmp-marker-3d-interactive": google.maps.maps3d.Marker3DInteractiveElement; + "gmp-marker-interactive": google.maps.maps3d.MarkerInteractiveElement; + "gmp-model-3d": google.maps.maps3d.Model3DElement; + "gmp-model-3d-interactive": google.maps.maps3d.Model3DInteractiveElement; + "gmp-place-accessible-entrance-icon": google.maps.places.PlaceAccessibleEntranceIconElement; + "gmp-place-address": google.maps.places.PlaceAddressElement; + "gmp-place-all-content": google.maps.places.PlaceAllContentElement; + "gmp-place-attribution": google.maps.places.PlaceAttributionElement; + "gmp-place-autocomplete": google.maps.places.PlaceAutocompleteElement; + "gmp-place-content-config": google.maps.places.PlaceContentConfigElement; + "gmp-place-contextual": google.maps.places.PlaceContextualElement; + "gmp-place-contextual-list-config": google.maps.places.PlaceContextualListConfigElement; + "gmp-place-details": google.maps.places.PlaceDetailsElement; + "gmp-place-details-compact": google.maps.places.PlaceDetailsCompactElement; + "gmp-place-details-location-request": google.maps.places.PlaceDetailsLocationRequestElement; + "gmp-place-details-place-request": google.maps.places.PlaceDetailsPlaceRequestElement; + "gmp-place-feature-list": google.maps.places.PlaceFeatureListElement; + "gmp-place-media": google.maps.places.PlaceMediaElement; + "gmp-place-nearby-search-request": google.maps.places.PlaceNearbySearchRequestElement; + "gmp-place-open-now-status": google.maps.places.PlaceOpenNowStatusElement; + "gmp-place-opening-hours": google.maps.places.PlaceOpeningHoursElement; + "gmp-place-phone-number": google.maps.places.PlacePhoneNumberElement; + "gmp-place-plus-code": google.maps.places.PlacePlusCodeElement; + "gmp-place-price": google.maps.places.PlacePriceElement; + "gmp-place-rating": google.maps.places.PlaceRatingElement; + "gmp-place-review-summary": google.maps.places.PlaceReviewSummaryElement; + "gmp-place-reviews": google.maps.places.PlaceReviewsElement; + "gmp-place-search": google.maps.places.PlaceSearchElement; + "gmp-place-standard-content": google.maps.places.PlaceStandardContentElement; + "gmp-place-summary": google.maps.places.PlaceSummaryElement; + "gmp-place-text-search-request": google.maps.places.PlaceTextSearchRequestElement; + "gmp-place-type": google.maps.places.PlaceTypeElement; + "gmp-place-type-specific-highlights": google.maps.places.PlaceTypeSpecificHighlightsElement; + "gmp-place-website": google.maps.places.PlaceWebsiteElement; + "gmp-polygon-3d": google.maps.maps3d.Polygon3DElement; + "gmp-polygon-3d-interactive": google.maps.maps3d.Polygon3DInteractiveElement; + "gmp-polyline-3d": google.maps.maps3d.Polyline3DElement; + "gmp-polyline-3d-interactive": google.maps.maps3d.Polyline3DInteractiveElement; + "gmp-popover": google.maps.maps3d.PopoverElement; + "gmp-route-3d": google.maps.routes.Route3DElement; + } +} +declare interface HTMLElementTagNameMap extends google.maps.HTMLElementTagNameMap {} \ No newline at end of file diff --git a/types/wordpress__server-side-render/.npmignore b/types/kakao.postcode/.npmignore similarity index 100% rename from types/wordpress__server-side-render/.npmignore rename to types/kakao.postcode/.npmignore diff --git a/types/kakao.postcode/index.d.ts b/types/kakao.postcode/index.d.ts new file mode 100644 index 00000000000000..dfabec67dc1d02 --- /dev/null +++ b/types/kakao.postcode/index.d.ts @@ -0,0 +1,504 @@ +/** @see [Kakao Postcode](https://postcode.map.kakao.com/guide) */ +declare namespace kakao { + /** + * 우편번호 서비스 + * @see [예제](https://postcode.map.kakao.com/guide#sample) + * @example + * ```html + * + * + * ``` + */ + class Postcode { + constructor(options: PostcodeOptions); + + /** + * 우편번호 찾기 화면을 iframe으로 삽입합니다. + * @see [함수](https://postcode.map.kakao.com/guide#methods) + */ + embed(element: HTMLElement, options?: PostcodeEmbedOptions): void; + + /** + * 우편번호 찾기 화면을 팝업으로 띄웁니다. + * @see [함수](https://postcode.map.kakao.com/guide#methods) + */ + open(options?: PostcodeOpenOptions): void; + } + + interface PostcodeEmbedOptions { + /** + * 자동 닫힘 유무 + * @default true + */ + autoClose?: boolean; + + /** 검색어 */ + q?: string; + } + + interface PostcodeOpenOptions { + /** + * 자동 닫힘 유무 + * @default true + */ + autoClose?: boolean; + + /** 팝업 위치 x값 */ + left?: number; + + /** + * 팝업창 구분값 + * @default '_blank' + */ + popupKey?: string; + + /** + * 팝업창의 타이틀 + * @default 'Kakao Postcode Service' + */ + popupTitle?: string; + + /** 검색어 */ + q?: string; + + /** 팝업 위치 y값 */ + top?: number; + } + + interface PostcodeOptions { + /** + * 검색 결과의 한글과 영문 주소를 동시에 볼 수 있게 해주는 기능입니다.\ + * 해당 기능 활성화시 영문보기 버튼은 감춰집니다(hideEngBtn 속성의 설정 값보다 우선시 됩니다). + * @default false + */ + alwaysShowEngAddr?: boolean; + + /** + * 우편번호 찾기 화면에서 애니메이션 효과를 줍니다. + * @default false + */ + animation?: boolean; + + /** + * autoMappingRoad와 autoMappingJibun 두 옵션을 같은 값으로 한 번에 설정하는 단축 옵션입니다. + */ + autoMapping?: boolean; + + /** + * 도로명주소에 매핑된 지번주소가 여러 개인 경우, 사용자가 선택안함을 클릭할 수 있도록 하며 연관주소 중 첫 번째 항목이 autoJibunAddress에 자동으로 들어가게 됩니다.\ + * false로 설정하면 선택안함 항목이 노출되지 않고 사용자가 반드시 매핑된 주소 중 하나를 선택하게 되지만, 매핑된 주소를 정확히 모르는 사용자에게 불편을 줄 수 있어 가급적 사용하지 않기를 권장합니다. + * @default true + */ + autoMappingJibun?: boolean; + + /** + * 지번주소에 매핑된 도로명주소가 여러 개인 경우, 사용자가 선택안함을 클릭할 수 있도록 하며 연관주소 중 첫 번째 항목이 autoRoadAddress에 자동으로 들어가게 됩니다.\ + * false로 설정하면 선택안함 항목이 노출되지 않고 사용자가 반드시 매핑된 주소 중 하나를 선택하게 되지만, 매핑된 주소를 정확히 모르는 사용자에게 불편을 줄 수 있어 가급적 사용하지 않기를 권장합니다. + * @default true + */ + autoMappingRoad?: boolean; + + /** + * 우편번호 찾기가 실행된 후 검색어 입력박스에 focus를 줍니다.\ + * 단, PC 플랫폼에서만 동작하며 Mobile 플랫폼은 지원하지 않습니다. + * @default true + */ + focusInput?: boolean; + + /** + * 우편번호 찾기 팝업 또는 iframe의 고정 높이를 지정합니다. iframe으로 띄울 경우 비율(%)로도 입력이 가능합니다(팝업모드에서 비율(%)로 입력 시 500으로 고정됩니다).\ + * 최소값은 400이며 이보다 작은 값을 넣으면 무시됩니다. + * @default 500 + */ + height?: number | string; + + /** + * 검색 결과의 영문보기 버튼을 가릴 수 있는 옵션입니다.\ + * 다만, 해당 기능은 자신의 주소에 익숙하지 못한 사용자들에 도움을 주는 기능으로, app에 임베딩을 해야되는 상황이거나 버튼이 눌러지면 안되는 상황일때 선택적으로 이용하시는 것을 권장합니다. + * @default false + */ + hideEngBtn?: boolean; + + /** + * 검색 결과의 지도 버튼을 가릴 수 있는 옵션입니다.\ + * 다만, 해당 기능은 자신의 주소에 익숙하지 못한 사용자들에 도움을 주는 기능으로, app에 임베딩을 해야되는 상황이거나 버튼이 눌러지면 안되는 상황일때 선택적으로 이용하시는 것을 권장합니다.\ + * true로 설정하면 검색결과가 없을 때 나오는 안내(Tip) 페이지 내의 지도 이동 링크도 같이 사라집니다. + * @default false + */ + hideMapBtn?: boolean; + + /** + * 검색어 입력시 검색바 아래에 뜨는 서제스트의 최대 검색 개수를 조절할 수 있는 옵션입니다.\ + * 입력하지 않거나 1~10을 벗어나는 수를 입력시 기본값으로 셋팅됩니다. + * @default 10 + */ + maxSuggestItems?: number; + + /** + * 우편번호 찾기 팝업 또는 레이어모드의 최소 너비를 지정합니다.\ + * 기본값은 300이며, 숫자만 입력가능합니다. 단위는 자동으로 'px'로 고정됩니다.\ + * 0과 기본값인 300사이로 설정가능합니다. + * @default 300 + */ + minWidth?: number; + + /** + * 우편번호 찾기 화면을 팝업으로 띄운 후, 검색 결과를 선택하거나 브라우저의 닫기버튼을 통해 닫았을 때 실행되는 콜백 함수를 정의하는 부분입니다.\ + * 검색결과를 선택하여 닫힌 경우에는 oncomplete 콜백 함수가 완료된 후에 실행됩니다.\ + * embed 함수를 이용한 레이어모드에서는 검색결과를 선택하여 닫힌 경우에만 실행됩니다. + */ + onclose?: PostcodeCloseHandler; + + /** + * 우편번호 검색 결과 목록에서 특정 항목을 클릭한 경우, 해당 정보를 받아서 처리할 콜백 함수를 정의하는 부분입니다. + */ + oncomplete?: PostcodeCompleteHandler; + + /** + * 검색 결과로 인해 우편번호 서비스의 화면 크기가 변한 경우, 화면 크기 정보를 받아서 처리할 콜백 함수를 정의하는 부분입니다(open 함수를 이용한 팝업모드에서는 지원하지 않습니다).\ + * size 파라미터의 width는 외부 wrapper DOM의 크기에 영향을 받기 때문에 최초 렌더링 값으로 유지되며, height 값은 수시로 변하기 때문에 이 height 값을 이용하고자 할 때 사용하시는 것을 추천드립니다. + */ + onresize?: PostcodeResizeHandler; + + /** + * 주소를 검색할 경우에 실행되는 콜백함수입니다. onresize 콜백보다 먼저 실행됩니다. + */ + onsearch?: PostcodeSearchHandler; + + /** + * 검색결과가 많을시 검색바 아래의 가이드 영역을 강조시켜 주는 기능입니다.\ + * 가이드 문구는 첫화면의 가이드 문구와 동일하며, 조합방식과 예시를 설명하여 사용자에게 재검색을 유도할 수 있도록 하는 기능입니다.\ + * 입력값으로는 페이지 넘버가 들어가게 되며, 3~20까지 입력 가능합니다.\ + * (ex. '5' 입력 시 검색결과가 5페이지 이상일 경우 무조건 가이드 문구를 강조하게 됩니다. 그 이하에서는 아무런 변화 없습니다.) + * @default 0 + */ + pleaseReadGuide?: number; + + /** + * pleaseReadGuide 옵션과 같이 사용되는 옵션으로 선택사항입니다.\ + * 입력값 설정 단위는 '초'단위로 설정할 수 있으며, 0.1~60까지 입력 가능합니다. + * @default 1.5 + */ + pleaseReadGuideTimer?: number; + + /** + * 검색된 주소와 내려가는 데이터의 '시', '도' 부분을 축약 표시합니다(한글 주소만 해당). + * - 서울특별시 -> 서울 + * - 광주광역시 -> 광주 + * + * 단, '세종특별자치시', '제주특별자치도', '강원특별자치도', '전북특별자치도'는 지자체의 요청에 의해 제외. + * @default true + */ + shorthand?: boolean; + + /** + * 기존보다 행정동 정보를 좀 더 많이 보여주게 하는 옵션입니다. + * @default false + */ + showMoreHName?: boolean; + + /** + * form submit 방식을 사용합니다. false로 설정 시 location replace 방식을 사용하게 됩니다.\ + * 우편번호 서비스로 인해 history 관련 제어가 어려우실 경우 false로 설정하여 이용하시기 바랍니다. + * @default true + */ + submitMode?: boolean; + + /** + * 우편번호 찾기 화면의 색상 테마를 변경할 수 있습니다. + * @default null + */ + theme?: PostcodeTheme | null; + + /** + * 하단 배너에 가이드페이지로 이동하는 링크를 활성화 시킵니다. + * @default true + */ + useBannerLink?: boolean; + + /** + * 우편번호 찾기 팝업 또는 iframe의 고정 넓이를 지정합니다. iframe으로 띄울 경우 비율(%)로도 입력이 가능합니다(팝업모드에서 비율(%)로 입력 시 500으로 고정됩니다).\ + * 최소값은 minWidth 값(별도 설정이 없을 시 300)이며 이보다 작은 값을 넣으면 무시됩니다. + * @default 500 + */ + width?: number | string; + + /** @deprecated 2020년 3월 9일 이후 삭제된 속성입니다. */ + zonecodeOnly?: boolean; + } + + type PostcodeCompleteHandler = (data: PostcodeData) => void; + type PostcodeCloseHandler = (state: PostcodeState) => void; + type PostcodeResizeHandler = (size: PostcodeSize) => void; + type PostcodeSearchHandler = (data: PostcodeSearchData) => void; + + interface PostcodeData { + /** + * 기본 주소(검색 결과에서 첫줄에 나오는 주소, 검색어의 타입(지번/도로명)에 따라 달라집니다) + * @example '경기 성남시 분당구 판교역로 235' + */ + address: string; + + /** + * 기본 영문 주소 + * @example '235 Pangyoyeok-ro, Bundang-gu, Seongnam-si, Gyeonggi-do, Republic of Korea' + */ + addressEnglish: string; + + /** 검색된 기본 주소 타입(R: 도로명, J: 지번) */ + addressType: "J" | "R"; + + /** 공동주택 여부 */ + apartment: "N" | "Y"; + + /** + * 도로명주소에 매핑된 지번주소가 여러 개인 경우, 사용자가 선택안함 또는 도로명주소를 클릭했을 때 연관된 지번주소 중 임의로 첫 번째 매핑 주소를 넣어서 반환합니다.\ + * (autoMappingJibun을 false로 설정한 경우에는 값이 채워지지 않습니다.) + * @example '경기 성남시 분당구 삼평동 681' + */ + autoJibunAddress: string; + + /** + * autoJibunAddress의 영문 지번 주소 + * @example '681, Sampyeong-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, Korea' + */ + autoJibunAddressEnglish: string; + + /** + * 지번주소에 매핑된 도로명주소가 여러 개인 경우, 사용자가 선택안함 또는 지번주소를 클릭했을 때 연관된 도로명주소 중 임의로 첫 번째 매핑 주소를 넣어서 반환합니다.\ + * (autoMappingRoad를 false로 설정한 경우에는 값이 채워지지 않습니다.) + * @example '경기 성남시 분당구 판교역로 235' + */ + autoRoadAddress: string; + + /** + * autoRoadAddress의 영문 도로명 주소 + * @example '235, Pangyoyeok-ro, Bundang-gu, Seongnam-si, Gyeonggi-do, Korea' + */ + autoRoadAddressEnglish: string; + + /** + * 법정동/법정리 코드 + * @example '4113510900' + */ + bcode: string; + + /** + * 법정동/법정리 이름 + * @example '삼평동' + */ + bname: string; + + /** 법정리의 읍/면 이름 */ + bname1: string; + + /** 법정리의 읍/면 이름의 영문 */ + bname1English: string; + + /** + * 법정동/법정리 이름 + * @example '삼평동' + */ + bname2: string; + + /** + * 법정동/법정리 이름의 영문 + * @example 'Sampyeong-dong' + */ + bname2English: string; + + /** + * 법정동/법정리 이름의 영문 + * @example 'Sampyeong-dong' + */ + bnameEnglish: string; + + /** + * 건물관리번호 + * @example '4113510900106810000000001' + */ + buildingCode: string; + + /** + * 건물명 + * @example '에이치스퀘어 엔동' + */ + buildingName: string; + + /** + * 행정동 이름, 검색어를 행정동으로 검색하고, 검색결과의 법정동과 검색어에 입력한 행정동과 다른 경우에 표시하고, 데이터를 내립니다. + */ + hname: string; + + /** + * 지번주소(도로명:지번 주소가 1:N인 경우에는 데이터가 공백으로 들어갈 수 있습니다) + * @example '경기 성남시 분당구 삼평동 681' + */ + jibunAddress: string; + + /** + * 영문 지번주소 + * @example '681, Sampyeong-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, Korea' + */ + jibunAddressEnglish: string; + + /** 연관 주소에서 선택안함 부분을 선택했을 때를 구분할 수 있는 상태 변수 */ + noSelected: "N" | "Y"; + + /** @deprecated 구 우편번호. 2020년 3월 9일 이후로는 데이터가 내려가지 않습니다. */ + postcode: ""; + /** @deprecated 구 우편번호 앞 3자리. 2020년 3월 9일 이후로는 데이터가 내려가지 않습니다. */ + postcode1: ""; + /** @deprecated 구 우편번호 뒤 3자리. 2020년 3월 9일 이후로는 데이터가 내려가지 않습니다. */ + postcode2: ""; + /** @deprecated 구 우편번호 일련번호. 2020년 3월 9일 이후로는 데이터가 내려가지 않습니다. */ + postcodeSeq: ""; + + /** + * 사용자가 입력한 검색어 + * @example '판교역로 235' + */ + query: string; + + /** + * 도로명주소(지번:도로명 주소가 1:N인 경우에는 데이터가 공백으로 들어갈 수 있습니다) + * @example '경기 성남시 분당구 판교역로 235' + */ + roadAddress: string; + + /** + * 영문 도로명주소 + * @example '235, Pangyoyeok-ro, Bundang-gu, Seongnam-si, Gyeonggi-do, Korea' + */ + roadAddressEnglish: string; + + /** + * 도로명 값, 검색 결과 중 선택한 도로명주소의 도로명 값이 들어갑니다(건물번호 제외). + * @example '판교역로' + */ + roadname: string; + + /** + * 도로명 코드, 7자리로 구성된 도로명 코드입니다. 추후 7자리 이상으로 늘어날 수 있습니다. + * @example '3179025' + */ + roadnameCode: string; + + /** + * 도로명 값, 검색 결과 중 선택한 도로명주소의 도로명의 영문 값이 들어갑니다(건물번호 제외). + * @example 'Pangyoyeok-ro' + */ + roadnameEnglish: string; + + /** + * 도/시 이름 + * @example '경기' + */ + sido: string; + + /** + * 도/시 이름의 영문 + * @example 'Gyeonggi-do' + */ + sidoEnglish: string; + + /** + * 시/군/구 이름 + * @example '성남시 분당구' + */ + sigungu: string; + + /** + * 시/군/구 코드 + * @example '41135' + */ + sigunguCode: string; + + /** + * 시/군/구 이름의 영문 + * @example 'Bundang-gu Seongnam-si' + */ + sigunguEnglish: string; + + /** 검색 결과에서 사용자가 선택한 주소의 언어 타입(K: 한글주소, E: 영문주소) */ + userLanguageType: "E" | "K"; + + /** 검색 결과에서 사용자가 선택한 주소의 타입(R: 도로명, J: 지번) */ + userSelectedType: "J" | "R"; + + /** + * 국가기초구역번호. 2015년 8월 1일부터 시행된 새 우편번호. + * @example '13494' + */ + zonecode: string; + } + + type PostcodeState = "COMPLETE_CLOSE" | "FORCE_CLOSE"; + + interface PostcodeSize { + /** + * 검색 결과 화면 높이 + * @example 500 + */ + height: number; + + /** + * 검색 결과 화면 넓이 + * @example 772 + */ + width: number; + } + + interface PostcodeSearchData { + /** + * 검색결과의 총 개수 + * @example 1 + */ + count: number; + + /** + * 검색창에 입력된 검색어 + * @example '판교역로 235' + */ + q: string; + } + + /** + * @see [테마](https://postcode.map.kakao.com/guide#themeWizard) + */ + interface PostcodeTheme { + /** 바탕 배경색 */ + bgColor?: string; + + /** 본문 배경색(검색결과, 결과없음, 첫화면, 검색서제스트) */ + contentBgColor?: string; + + /** 강조 글자색 */ + emphTextColor?: string; + + /** 테두리 */ + outlineColor?: string; + + /** 페이지 배경색 */ + pageBgColor?: string; + + /** 우편번호 글자색 */ + postcodeTextColor?: string; + + /** 검색창 글자색 */ + queryTextColor?: string; + + /** 검색창 배경색 */ + searchBgColor?: string; + + /** 기본 글자색 */ + textColor?: string; + } +} diff --git a/types/kakao.postcode/kakao.postcode-tests.ts b/types/kakao.postcode/kakao.postcode-tests.ts new file mode 100644 index 00000000000000..7905325f0319c5 --- /dev/null +++ b/types/kakao.postcode/kakao.postcode-tests.ts @@ -0,0 +1,56 @@ +const div = document.createElement("div"); + +new kakao.Postcode({}).embed(div, { autoClose: true, q: "강남역" }); +new kakao.Postcode({}).open({ + autoClose: true, + left: 0, + top: 0, + popupKey: "_blank", + popupTitle: "Kakao Postcode Service", + q: "강남역", +}); +new window.kakao.Postcode({}).embed(div); +// @ts-expect-error +new window.kakao.Postcode({}).embed(); +new window.kakao.Postcode({}).open(); + +const theme = { + bgColor: "#ECECEC", + contentBgColor: "#FFFFFF", + emphTextColor: "#008BD3", + outlineColor: "#008BD3", + pageBgColor: "#FAFAFA", + postcodeTextColor: "#FA4256", + queryTextColor: "#222222", + searchBgColor: "#FFFFFF", + textColor: "#333333", +}; + +new kakao.Postcode({ + alwaysShowEngAddr: false, + animation: false, + autoMapping: true, + autoMappingJibun: true, + autoMappingRoad: true, + focusInput: true, + height: 500, + hideEngBtn: false, + hideMapBtn: false, + maxSuggestItems: 10, + minWidth: 300, + onclose: () => {}, + oncomplete: () => {}, + onresize: () => {}, + onsearch: () => {}, + pleaseReadGuide: 0, + pleaseReadGuideTimer: 1.5, + shorthand: true, + showMoreHName: false, + submitMode: true, + theme, + useBannerLink: true, + width: 500, +}); + +// @ts-expect-error +new kakao.Postcode(); diff --git a/types/kakao.postcode/package.json b/types/kakao.postcode/package.json new file mode 100644 index 00000000000000..97647229368420 --- /dev/null +++ b/types/kakao.postcode/package.json @@ -0,0 +1,19 @@ +{ + "private": true, + "name": "@types/kakao.postcode", + "version": "2.0.9999", + "nonNpm": true, + "nonNpmDescription": "Kakao Postcode", + "projects": [ + "https://postcode.map.kakao.com/guide" + ], + "devDependencies": { + "@types/kakao.postcode": "workspace:." + }, + "owners": [ + { + "name": "doinki", + "githubUsername": "doinki" + } + ] +} diff --git a/types/wordpress__server-side-render/tsconfig.json b/types/kakao.postcode/tsconfig.json similarity index 83% rename from types/wordpress__server-side-render/tsconfig.json rename to types/kakao.postcode/tsconfig.json index a9f7c6702773f4..e4b81b9173a2e6 100644 --- a/types/wordpress__server-side-render/tsconfig.json +++ b/types/kakao.postcode/tsconfig.json @@ -2,9 +2,9 @@ "compilerOptions": { "module": "node16", "lib": [ + "dom", "es6" ], - "jsx": "preserve", "noImplicitAny": true, "noImplicitThis": true, "strictFunctionTypes": true, @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "wordpress__server-side-render-tests.tsx" + "kakao.postcode-tests.ts" ] } diff --git a/types/luxon/src/datetime.d.ts b/types/luxon/src/datetime.d.ts index 5841d8d41040ad..b90176b394e09d 100644 --- a/types/luxon/src/datetime.d.ts +++ b/types/luxon/src/datetime.d.ts @@ -954,7 +954,7 @@ export class DateTime { * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 * * The DateTime was created by an operation on another invalid date */ - get isValid(): IfValid; + get isValid(): IsValid; /** * Returns an error code if this DateTime is invalid, or null if the DateTime is valid diff --git a/types/luxon/test/luxon-tests.module.ts b/types/luxon/test/luxon-tests.module.ts index ea69240a6a99f1..3cf4f656373150 100644 --- a/types/luxon/test/luxon-tests.module.ts +++ b/types/luxon/test/luxon-tests.module.ts @@ -629,3 +629,18 @@ DateTime.fromISO("2021-09-13T07:52:27.697Z").toLocaleString({ hour: "2-digit", day: "2-digit", }); + +// Type Guard check +function isValidDateTime(dt: DateTime): dt is DateTime { + return dt.isValid; +} + +function typeGuardCheck(dt: DateTime): void { + if (isValidDateTime(dt)) { + dt; // $ExpectType DateTime + dt.toISO(); // $ExpectType string + return; + } + + dt; // $ExpectType DateTime +} diff --git a/types/lzwcompress/.npmignore b/types/lzwcompress/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/lzwcompress/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/lzwcompress/index.d.ts b/types/lzwcompress/index.d.ts new file mode 100644 index 00000000000000..96817e5d5bee8c --- /dev/null +++ b/types/lzwcompress/index.d.ts @@ -0,0 +1,7 @@ +declare const lzwCompress: { + pack(input: unknown): unknown; + unpack(packed: unknown): unknown; + enableLogging(enable: boolean): void; +}; + +export = lzwCompress; diff --git a/types/lzwcompress/lzwcompress-tests.ts b/types/lzwcompress/lzwcompress-tests.ts new file mode 100644 index 00000000000000..b40c036753667d --- /dev/null +++ b/types/lzwcompress/lzwcompress-tests.ts @@ -0,0 +1,27 @@ +import lzwCompress = require("lzwcompress"); + +lzwCompress.pack(undefined); // $ExpectType unknown +lzwCompress.pack(null); // $ExpectType unknown +lzwCompress.pack(123); // $ExpectType unknown +lzwCompress.pack(false); // $ExpectType unknown +lzwCompress.pack(true); // $ExpectType unknown +lzwCompress.pack(new Date()); // $ExpectType unknown + +lzwCompress.pack(""); // $ExpectType unknown +lzwCompress.pack("hello"); // $ExpectType unknown + +lzwCompress.pack({ name: "Ada" }); // $ExpectType unknown +lzwCompress.pack({ name: "⌈" }); // $ExpectType unknown +lzwCompress.pack([1, 2, 3]); // $ExpectType unknown + +lzwCompress.unpack([104, 101, 108, 108, 111]); // $ExpectType unknown +lzwCompress.unpack("hello"); // $ExpectType unknown +lzwCompress.unpack("{\"__k\":[\"name\"],\"__v\":{\"0\":\"⌈\"}}"); // $ExpectType unknown +lzwCompress.unpack(false); // $ExpectType unknown +lzwCompress.unpack(null); // $ExpectType unknown +lzwCompress.unpack(new Date()); // $ExpectType unknown + +lzwCompress.enableLogging(true); // $ExpectType void + +// @ts-expect-error +lzwCompress.enableLogging("true"); diff --git a/types/lzwcompress/package.json b/types/lzwcompress/package.json new file mode 100644 index 00000000000000..da51b8224f92db --- /dev/null +++ b/types/lzwcompress/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/lzwcompress", + "version": "1.1.9999", + "projects": [ + "https://floydpink.github.io/lzwCompress.js/" + ], + "devDependencies": { + "@types/lzwcompress": "workspace:." + }, + "owners": [ + { + "name": "floydpink", + "githubUsername": "floydpink" + } + ] +} diff --git a/types/lzwcompress/tsconfig.json b/types/lzwcompress/tsconfig.json new file mode 100644 index 00000000000000..fcff889097f172 --- /dev/null +++ b/types/lzwcompress/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "lzwcompress-tests.ts" + ] +} diff --git a/types/ramda/package.json b/types/ramda/package.json index 2fc5109b2b583f..5b42b2b7936c09 100644 --- a/types/ramda/package.json +++ b/types/ramda/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/ramda", - "version": "0.31.9999", + "version": "0.32.9999", "projects": [ "https://ramdajs.com" ], @@ -14,13 +14,13 @@ "./es/*": "./es/*.js", "./src/*": "./src/*.js", "./dist/*": "./dist/*.js", - "./es/": "./es/", - "./src/": "./src/", - "./dist/": "./dist/" + "./es": "./es/index.js", + "./src": "./src/index.js", + "./dist": "./dist/index.js" }, "minimumTypeScriptVersion": "4.7", "dependencies": { - "types-ramda": "^0.31.0" + "types-ramda": "^0.32.0" }, "devDependencies": { "@types/ramda": "workspace:." diff --git a/types/tuya-panel-kit/package.json b/types/tuya-panel-kit/package.json index 05df38923e7e0b..db3391648156a9 100644 --- a/types/tuya-panel-kit/package.json +++ b/types/tuya-panel-kit/package.json @@ -18,10 +18,6 @@ "@types/tuya-panel-kit": "workspace:." }, "owners": [ - { - "name": "youngjuning", - "githubUsername": "youngjuning" - }, { "name": "ShinyLeee", "githubUsername": "ShinyLeee" diff --git a/types/wordpress__server-side-render/index.d.ts b/types/wordpress__server-side-render/index.d.ts deleted file mode 100644 index 7750a06336fa92..00000000000000 --- a/types/wordpress__server-side-render/index.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { ComponentType, JSX, PropsWithChildren } from "react"; - -export interface ServerSideRenderProps { - /** The identifier of the block to be serverside rendered. */ - block: string; - /** The block attributes to be sent to the server for rendering. */ - attributes?: Record | null; - /** Additional classes to apply to the wrapper element. */ - className?: string; - /** The HTTP method to use (‘GET’ or ‘POST’). Default is ‘GET’ */ - httpMethod?: "GET" | "POST"; - /** Additional query arguments to append to the request URL. */ - urlQueryArgs?: Record; - /** Whether to remove block support attributes before sending. */ - skipBlockSupportAttributes?: boolean; - /** Component rendered when the API response is empty. */ - EmptyResponsePlaceholder?: ComponentType; - /** Component rendered when the API response is an error. */ - ErrorResponsePlaceholder?: ComponentType; - /** Component rendered while the API request is loading. */ - LoadingResponsePlaceholder?: ComponentType>; -} - -/** A component that renders server-side content for blocks. */ -export function ServerSideRender(props: ServerSideRenderProps): JSX.Element; - -/** - * @deprecated Use `ServerSideRender` non-default export instead: - * ```js - * import { ServerSideRender } from '@wordpress/server-side-render'; - * ``` - */ -declare const ServerSideRenderDefault: typeof ServerSideRender; -export default ServerSideRenderDefault; - -export type UseServerSideRenderArgs = Pick< - ServerSideRenderProps, - "block" | "attributes" | "httpMethod" | "urlQueryArgs" | "skipBlockSupportAttributes" ->; - -export type ServerSideRenderStatus = "idle" | "loading" | "success" | "error"; - -export interface ServerSideRenderResponse { - /** The current request status: 'idle', 'loading', 'success', or 'error'. */ - status: ServerSideRenderStatus; - /** The rendered block content (available when status is 'success'). */ - content?: string; - /** The error message (available when status is 'error'). */ - error?: string; -} - -/** - * A hook for server-side rendering a preview of dynamic blocks to display in the editor. - * - * Handles fetching server-rendered previews for blocks, managing loading states, - * and automatically debouncing requests to prevent excessive API calls. It supports both - * GET and POST requests, with POST requests used for larger attribute payloads. - * - * @example - * Basic usage: - * - * ```jsx - * import { RawHTML } from '@wordpress/element'; - * import { useServerSideRender } from '@wordpress/server-side-render'; - * - * function MyServerSideRender( { attributes, block } ) { - * const { content, status, error } = useServerSideRender( { - * attributes, - * block, - * } ); - * - * if ( status === 'loading' ) { - * return
Loading...
; - * } - * - * if ( status === 'error' ) { - * return
Error: { error }
; - * } - * - * return { content }; - * } - * ``` - */ -export function useServerSideRender(args: UseServerSideRenderArgs): ServerSideRenderResponse; diff --git a/types/wordpress__server-side-render/package.json b/types/wordpress__server-side-render/package.json deleted file mode 100644 index b59d8aa7b10077..00000000000000 --- a/types/wordpress__server-side-render/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/wordpress__server-side-render", - "version": "6.15.9999", - "projects": [ - "https://github.com/WordPress/gutenberg/tree/HEAD/packages/server-side-render/README.md" - ], - "dependencies": { - "@types/react": "^18" - }, - "devDependencies": { - "@types/wordpress__server-side-render": "workspace:." - }, - "owners": [ - { - "name": "Rafał Całka", - "githubUsername": "rafaucau" - } - ] -} diff --git a/types/wordpress__server-side-render/wordpress__server-side-render-tests.tsx b/types/wordpress__server-side-render/wordpress__server-side-render-tests.tsx deleted file mode 100644 index 49ed007c0f6a12..00000000000000 --- a/types/wordpress__server-side-render/wordpress__server-side-render-tests.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { ServerSideRender, useServerSideRender } from "@wordpress/server-side-render"; - -

An error occurred while loading {props.block}: {props.message}

} -/>; - -function MyServerSideRender({ attributes, block }: { attributes: Record; block: string }) { - const { content, status, error } = useServerSideRender({ - attributes, - block, - }); - - return {content}; -}