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 {
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * 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.
*
- * A relational description of a location. Includes a ranked set of nearby
- * landmarks and the areas containing the target location.
+ * Access by calling `const {ColorScheme} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface AddressDescriptor {
- /**
- * A ranked list of containing or adjacent areas. The most useful
- * (recognizable and precise) areas are ranked first.
- */
- areas: google.maps.Area[];
+ export enum ColorScheme {
/**
- * A ranked list of nearby landmarks. The most useful (recognizable and
- * nearby) landmarks are ranked first.
+ * The dark color scheme for a map.
*/
- landmarks: google.maps.Landmark[];
- }
- /**
- * 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.
- */
- export enum Animation {
+ DARK = 'DARK',
/**
- * Marker bounces until animation is stopped by calling {@link
- * google.maps.Marker.setAnimation} with null.
+ * The color scheme is selected based on system preferences, which are checked once at method execution time.
*/
- BOUNCE = 0.0,
+ FOLLOW_SYSTEM = 'FOLLOW_SYSTEM',
/**
- * 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.
+ * The light color scheme for a map. Default value for legacy Maps JS.
*/
- DROP = 1.0,
+ LIGHT = 'LIGHT',
}
+ export type ColorSchemeString = `${google.maps.ColorScheme}`;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * Identifiers for common MapTypes. Specify these by value, or by using the constant's name. For example, 'satellite' or google.maps.MapTypeId.SATELLITE.
*
- * A place that is a small region, such as a neighborhood, sublocality, or
- * large complex that contains the target location.
+ * Access by calling `const {MapTypeId} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface Area {
+ export enum MapTypeId {
/**
- * Defines the spatial relationship between the target location and the
- * area.
+ * This map type displays a transparent layer of major streets on satellite images.
*/
- containment: google.maps.Containment;
+ HYBRID = 'hybrid',
/**
- * The name for the area.
+ * This map type displays a normal street map.
*/
- display_name: string;
+ ROADMAP = 'roadmap',
/**
- * The language of the name for the area.
+ * This map type displays satellite images.
*/
- display_name_language_code: string;
+ SATELLITE = 'satellite',
/**
- * The Place ID of the underlying area. Can be used to resolve more
- * information about the area through Place Details or Place ID Lookup.
+ * This map type displays maps with physical features such as terrain and vegetation.
*/
- place_id: string;
+ TERRAIN = 'terrain',
}
+ export type MapTypeIdString = `${google.maps.MapTypeId}`;
/**
- * 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.
+ * 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 class BicyclingLayer extends google.maps.MVCObject {
- /**
- * Returns the map on which this layer is displayed.
- */
- getMap(): google.maps.Map | null;
+ export class MapsNetworkError extends Error {
/**
- * Renders the layer on the specified map. If map is set to
- * null, the layer will be removed.
+ * Identifies the type of error produced by the API.
*/
- setMap(map: google.maps.Map | null): void;
- }
- /**
- * The display options for the Camera control.
- */
- export interface CameraControlOptions {
+ 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;
/**
- * Position id. Used to specify the position of the control on the map.
- * @defaultValue {@link google.maps.ControlPosition.INLINE_START_BLOCK_END}
+ * Represents the network service that responded with the error.
*/
- position?: google.maps.ControlPosition | null;
+ endpoint: google.maps.MapsNetworkErrorEndpointString;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Used for setting the map's camera options.
+ * 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 interface CameraOptions {
- center?: google.maps.LatLngLiteral | google.maps.LatLng;
- heading?: number;
- tilt?: number;
- zoom?: number;
+ export class MapsServerError extends google.maps.MapsNetworkError {
}
/**
- * Used for retrieving camera parameters, such as that of the GL camera used
- * for the {@link google.maps.WebGLOverlayView}.
+ * 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 interface CameraParams extends google.maps.CameraOptions {
- center: google.maps.LatLng;
- heading: number;
- tilt: number;
- zoom: number;
+ export class MapsRequestError extends google.maps.MapsNetworkError {
}
/**
- * A circle on the Earth's surface; also known as a "spherical
- * cap".
+ * Identifiers for API endpoints used by {@link google.maps.MapsNetworkError} instances.
*
- * Access by calling `const {Circle} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {MapsNetworkErrorEndpoint} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class Circle extends google.maps.MVCObject {
- /**
- * 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.
- */
- constructor(
- circleOrCircleOptions?:
- | google.maps.Circle
- | null
- | google.maps.CircleLiteral
- | google.maps.CircleOptions,
- );
- /**
- * Gets the LatLngBounds of this Circle.
- */
- getBounds(): google.maps.LatLngBounds | null;
- /**
- * Returns the center of this circle.
- */
- getCenter(): google.maps.LatLng | null;
- /**
- * Returns whether this circle can be dragged by the user.
- */
- getDraggable(): boolean;
- /**
- * Returns whether this circle can be edited by the user.
- */
- getEditable(): boolean;
- /**
- * Returns the map on which this circle is displayed.
- */
- getMap(): google.maps.Map | null;
- /**
- * Returns the radius of this circle (in meters).
- */
- getRadius(): number;
+ export enum MapsNetworkErrorEndpoint {
/**
- * Returns whether this circle is visible on the map.
+ * Identifies the Routes API within the Directions API.
*/
- getVisible(): boolean;
+ DIRECTIONS_ROUTE = 'DIRECTIONS_ROUTE',
/**
- * Sets the center of this circle.
+ * Identifies the DistanceMatrix API.
*/
- setCenter(
- center: google.maps.LatLng | null | google.maps.LatLngLiteral,
- ): void;
+ DISTANCE_MATRIX = 'DISTANCE_MATRIX',
/**
- * If set to true, the user can drag this circle over the map.
+ * Identifies the getElevationsAlongPath API within the Elevation API.
*/
- setDraggable(draggable: boolean): void;
+ ELEVATION_ALONG_PATH = 'ELEVATION_ALONG_PATH',
/**
- * 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.
+ * Identifies the getElevationForLocations API within the Elevation API.
*/
- setEditable(editable: boolean): void;
+ ELEVATION_LOCATIONS = 'ELEVATION_LOCATIONS',
/**
- * Renders the circle on the specified map. If map is set to
- * null, the circle will be removed.
+ * Identifies the Get DeliveryVehicle API within Fleet Engine.
*/
- setMap(map: google.maps.Map | null): void;
- setOptions(options: google.maps.CircleOptions | null): void;
+ FLEET_ENGINE_GET_DELIVERY_VEHICLE = 'FLEET_ENGINE_GET_DELIVERY_VEHICLE',
/**
- * Sets the radius of this circle (in meters).
+ * Identifies the Get Trip API within Fleet Engine.
*/
- setRadius(radius: number): void;
+ FLEET_ENGINE_GET_TRIP = 'FLEET_ENGINE_GET_TRIP',
/**
- * Hides this circle if set to false.
+ * Identifies the Get Vehicle API within Fleet Engine.
*/
- setVisible(visible: boolean): void;
- }
- /**
- * Object literal which represents a circle.
- */
- export interface CircleLiteral extends google.maps.CircleOptions {
+ FLEET_ENGINE_GET_VEHICLE = 'FLEET_ENGINE_GET_VEHICLE',
/**
- * The center of the Circle.
+ * Identifies the List DeliveryVehicles API within Fleet Engine.
*/
- center: google.maps.LatLng | google.maps.LatLngLiteral;
+ FLEET_ENGINE_LIST_DELIVERY_VEHICLES = 'FLEET_ENGINE_LIST_DELIVERY_VEHICLES',
/**
- * The radius in meters on the Earth's surface.
+ * Identifies the List Tasks API within Fleet Engine.
*/
- radius: number;
- }
- /**
- * CircleOptions object used to define the properties that can be set on a
- * Circle.
- */
- export interface CircleOptions {
+ FLEET_ENGINE_LIST_TASKS = 'FLEET_ENGINE_LIST_TASKS',
/**
- * The center of the Circle.
+ * Identifies the List Vehicles API within Fleet Engine.
*/
- center?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ FLEET_ENGINE_LIST_VEHICLES = 'FLEET_ENGINE_LIST_VEHICLES',
/**
- * Indicates whether this Circle handles mouse events.
- * @defaultValue true
+ * Identifies the Search Tasks API within Fleet Engine.
*/
- clickable?: boolean | null;
+ FLEET_ENGINE_SEARCH_TASKS = 'FLEET_ENGINE_SEARCH_TASKS',
/**
- * If set to true, the user can drag this circle over the map.
- * @defaultValue false
+ * Identifies the geocode API within the Geocoder.
*/
- draggable?: boolean | null;
+ GEOCODER_GEOCODE = 'GEOCODER_GEOCODE',
/**
- * 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
+ * Identifies the MaximumZoomImageryService API within the Maps API.
*/
- editable?: boolean | null;
+ MAPS_MAX_ZOOM = 'MAPS_MAX_ZOOM',
/**
- * The fill color. All CSS3 colors are supported except for extended named
- * colors.
+ * Identifies the Autocomplete API within the Places API.
*/
- fillColor?: string | null;
+ PLACES_AUTOCOMPLETE = 'PLACES_AUTOCOMPLETE',
/**
- * The fill opacity between 0.0 and 1.0.
+ * Identifies the Details API within the Places API.
*/
- fillOpacity?: number | null;
+ PLACES_DETAILS = 'PLACES_DETAILS',
/**
- * Map on which to display the Circle.
+ * Identifies the findPlaceFromPhoneNumber API within the Places API.
*/
- map?: google.maps.Map | null;
+ PLACES_FIND_PLACE_FROM_PHONE_NUMBER = 'PLACES_FIND_PLACE_FROM_PHONE_NUMBER',
/**
- * The radius in meters on the Earth's surface.
+ * Identifies the findPlaceFromQuery API within the Places API.
*/
- radius?: number | null;
+ PLACES_FIND_PLACE_FROM_QUERY = 'PLACES_FIND_PLACE_FROM_QUERY',
/**
- * The stroke color. All CSS3 colors are supported except for extended named
- * colors.
+ * Identifies the Gateway API within the Places API.
*/
- strokeColor?: string | null;
+ PLACES_GATEWAY = 'PLACES_GATEWAY',
/**
- * The stroke opacity between 0.0 and 1.0.
+ * Identifies the Get Place API within the Places API.
*/
- strokeOpacity?: number | null;
+ PLACES_GET_PLACE = 'PLACES_GET_PLACE',
/**
- * The stroke position.
- * @defaultValue {@link google.maps.StrokePosition.CENTER}
+ * Identifies the LocalContextSearch API within the Places API.
*/
- strokePosition?: google.maps.StrokePosition | null;
+ PLACES_LOCAL_CONTEXT_SEARCH = 'PLACES_LOCAL_CONTEXT_SEARCH',
/**
- * The stroke width in pixels.
+ * Identifies the NearbySearch API within the Places API.
*/
- strokeWeight?: number | null;
+ PLACES_NEARBY_SEARCH = 'PLACES_NEARBY_SEARCH',
/**
- * Whether this circle is visible on the map.
- * @defaultValue true
+ * Identifies the Search Text API within the Places API.
*/
- visible?: boolean | null;
+ PLACES_SEARCH_TEXT = 'PLACES_SEARCH_TEXT',
/**
- * The zIndex compared to other polys.
+ * Identifies the getPanorama method within the Streetview service.
*/
- zIndex?: number | null;
+ STREETVIEW_GET_PANORAMA = 'STREETVIEW_GET_PANORAMA',
}
+ export type MapsNetworkErrorEndpointString = `${google.maps.MapsNetworkErrorEndpoint}`;
/**
- * Access by calling `const {CollisionBehavior} = await
- * google.maps.importLibrary("marker")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * An event with an associated Error.
*/
- export enum CollisionBehavior {
- /**
- * 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.
- */
- OPTIONAL_AND_HIDES_LOWER_PRIORITY = 'OPTIONAL_AND_HIDES_LOWER_PRIORITY',
- /**
- * Always display the marker regardless of collision. This is the default
- * behavior.
- */
- REQUIRED = 'REQUIRED',
+ export interface ErrorEvent {
/**
- * Always display the marker regardless of collision, and hide any
- * OPTIONAL_AND_HIDES_LOWER_PRIORITY markers or labels that would overlap
- * with the marker.
+ * The Error related to the event.
*/
- REQUIRED_AND_HIDES_OPTIONAL = 'REQUIRED_AND_HIDES_OPTIONAL',
+ error: Error;
}
/**
- * 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.
+ * Describes a Firebase App Check token result.
*/
- export enum ColorScheme {
- /**
- * The dark color scheme for a map.
- */
- DARK = 'DARK',
- /**
- * The color scheme is selected based on system preferences.
- */
- FOLLOW_SYSTEM = 'FOLLOW_SYSTEM',
+ export interface MapsAppCheckTokenResult {
/**
- * The light color scheme for a map. Default value for legacy Maps JS.
+ * The Firebase App Check token.
*/
- LIGHT = 'LIGHT',
+ token: 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.
+ * 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 enum Containment {
+ export class Settings {
/**
- * The target location is outside the area region, but close by.
+ * 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.google.maps.Settings.getInstance().experienceIds = [experienceId];).
*/
- NEAR = 'NEAR',
+ get experienceIds(): Iterablegoogle.maps.Settings.
*/
- WITHIN = 'WITHIN',
+ static getInstance(): google.maps.Settings;
}
/**
- * 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.+----------------+ - *
| BSIS BSIC BSIE | - *
| ISBS IEBS | - *
| | - *
| ISBC IEBC | - *
| | - *
| ISBE IEBE | - *
| BEIS BEIC BEIE |
+----------------+
+----------------+ - *
| BSIE BSIC BSIS | - *
| IEBS ISBS | - *
| | - *
| IEBC ISBC | - *
| | - *
| IEBE ISBE | - *
| BEIE BEIC BEIS |
+----------------+
+----------------+ - *
| TL TC TR | - *
| LT RT - * | - *
| | - *
| LC RC - * | - *
| | - *
| LB RB - * |
| BL BC BR | - *
+----------------+
+----------------+
| BSIS BSIC BSIE |
| ISBS IEBS |
| |
| ISBC IEBC |
| |
| ISBE IEBE |
| BEIS BEIC BEIE |
+----------------+
+----------------+
| BSIE BSIC BSIS |
| IEBS ISBS |
| |
| IEBC ISBC |
| |
| IEBE ISBE |
| BEIE BEIC BEIS |
+----------------+
+----------------+
| TL TC TR |
| LT RT |
| |
| LC RC |
| |
| LB RB |
| BL BC BR |
+----------------+
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(...);The - *
- * myMap.data.addGeoJson(...);
myMap.data.setStyle(...);
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 {
- /**
- * 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(...);The - *
- * myMap.data.addGeoJson(...);
myMap.data.setStyle(...);
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.
- */
- 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
- | null
- | google.maps.Data.FeatureOptions,
- ): 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[];
+ export enum MapTypeControlStyle {
/**
- * Checks whether the given feature is in the collection.
+ * 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.
*/
- contains(feature: google.maps.Data.Feature): boolean;
+ DEFAULT = 0,
/**
- * 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.
+ * A dropdown menu for the screen realestate conscious.
*/
- forEach(callback: (a: google.maps.Data.Feature) => void): void;
+ DROPDOWN_MENU = 0,
/**
- * Returns the position of the drawing controls on the map.
+ * The standard horizontal radio buttons bar.
*/
- getControlPosition(): google.maps.ControlPosition;
+ HORIZONTAL_BAR = 0,
+ }
+ /**
+ * Identifiers for scale control ids.
+ */
+ export enum ScaleControlStyle {
/**
- * 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".
+ * The standard scale control.
*/
- getControls(): string[] | null;
+ 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 { /** - * Returns the current drawing mode of the given Data layer. A drawing mode - * ofnull 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".
+ * 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.
*/
- getDrawingMode(): string | null;
+ lat: number;
/**
- * 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.
+ * 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.
*/
- getFeatureById(id: number | string): google.maps.Data.Feature | undefined;
+ lng: number;
+ }
+ /**
+ * A LatLng is a point in geographical coordinates: latitude and longitude.
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);+ * Access by calling `const {LatLng} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. + */ + export class LatLng { /** - * Returns the map on which the features are displayed. + * Creates a
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);
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
*/
- getMap(): google.maps.Map | null;
+ constructor(latOrLatLngOrLatLngLiteral: number | google.maps.LatLngLiteral | google.maps.LatLng, lngOrNoClampNoWrap?: number | boolean | null, noClampNoWrap?: boolean);
/**
- * Gets the style for all features in the collection.
+ * Comparison function.
*/
- getStyle():
- | google.maps.Data.StylingFunction
- | google.maps.Data.StyleOptions
- | null;
+ equals(other: google.maps.LatLng | null): 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().
+ * Returns the latitude in degrees.
*/
- loadGeoJson(
- url: string,
- options?: google.maps.Data.GeoJsonOptions | null,
- callback?: (a: google.maps.Data.Feature[]) => void,
- ): void;
+ lat(): number;
/**
- * 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().
+ * Returns the longitude in degrees.
*/
- overrideStyle(
- feature: google.maps.Data.Feature,
- style: google.maps.Data.StyleOptions,
- ): void;
+ lng(): number;
/**
- * Removes a feature from the collection.
+ * Converts to JSON representation. This function is intended to be used via JSON.stringify.
*/
- remove(feature: google.maps.Data.Feature): void;
+ toJSON(): google.maps.LatLngLiteral;
/**
- * 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.
+ * Converts to string representation. */ - revertStyle(feature?: google.maps.Data.Feature | null): void; + toString(): string; /** - * Sets the position of the drawing controls on the map. + * Returns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default. */ - setControlPosition(controlPosition: google.maps.ControlPosition): void; + 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 { /** - * Sets which drawing modes are available for the user to select, in the - * order they are displayed. This should not include thenull
- * drawing mode, which is added by default. If null, drawing
- * controls are disabled and not displayed. Possible drawing modes are
- * "Point", "LineString" or
- * "Polygon".
+ * 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)
*/
- setControls(controls: string[] | null): void;
+ anchor?: google.maps.Point | null;
/**
- * 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".
+ * 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.
*/
- setDrawingMode(drawingMode: string | null): void;
+ fillColor?: string | null;
/**
- * Renders the features on the specified map. If map is set to
- * null, the features will be removed from the map.
+ * The symbol's fill opacity.
+ * @defaultValue 0
*/
- setMap(map: google.maps.Map | null): void;
+ fillOpacity?: number | 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.
+ * 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)
*/
- setStyle(
- style:
- | google.maps.Data.StylingFunction
- | google.maps.Data.StyleOptions
- | null,
- ): void;
+ labelOrigin?: google.maps.Point | null;
/**
- * Exports the features in the collection to a GeoJSON object.
+ * The symbol's path, which is a built-in symbol path, or a custom path expressed using SVG path notation. Required.
*/
- toGeoJson(callback: (a: 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 {
+ path: google.maps.SymbolPath | string;
/**
- * Key-value mapping of the feature's attributes.
+ * 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
*/
- datasetAttributes: {[key: string]: string};
+ rotation?: number | null;
/**
- * Dataset id of the dataset that this feature belongs to.
+ * 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.
*/
- datasetId: string;
- }
- /**
- * A single geocoded waypoint.
- */
- export interface DirectionsGeocodedWaypoint {
+ scale?: number | 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.
+ * 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.
*/
- partial_match?: boolean;
+ strokeColor?: string | null;
/**
- * 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.
+ * 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.
*/
- place_id?: string;
+ strokeOpacity?: number | 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 symbol's stroke weight.
+ * @defaultValue The {@link google.maps.Symbol.scale} of the symbol.
*/
- types?: string[];
+ strokeWeight?: number | null;
}
/**
- * 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.
+ * 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 interface DirectionsLeg {
- /**
- * An estimated arrival time for this leg. Only applicable for TRANSIT
- * requests.
- */
- arrival_time?: google.maps.Time;
- /**
- * An estimated departure time for this leg. Only applicable for TRANSIT
- * requests.
- */
- departure_time?: google.maps.Time;
- /**
- * The total distance covered by this leg. This property may be undefined as
- * the distance may be unknown.
- */
- distance?: google.maps.Distance;
+ export class MVCObject {
/**
- * The total duration of this leg. This property may be
- * undefined as the duration may be unknown.
+ * Creates an MVCObject.
*/
- duration?: google.maps.Duration;
+ constructor();
/**
- * 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.
+ * 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.
*/
- duration_in_traffic?: google.maps.Duration;
+ addListener(eventName: string, handler: Function): google.maps.MapsEventListener;
/**
- * The address of the destination of this leg. This content is meant to be
- * read as-is. Do not programmatically parse the formatted address.
+ * Binds a View to a Model.
*/
- end_address: string;
+ bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null, noNotify?: boolean): void;
/**
- * 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.
+ * Gets a value.
*/
- end_location: google.maps.LatLng;
+ get(key: string): any;
/**
- * The address of the origin of this leg. This content is meant to be read
- * as-is. Do not programmatically parse the formatted address.
+ * 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.
*/
- start_address: string;
+ notify(key: string): void;
/**
- * 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.
+ * Sets a value.
*/
- start_location: google.maps.LatLng;
+ set(key: string, value: unknown): void;
/**
- * An array of DirectionsSteps, each of which contains
- * information about the individual steps in this leg.
+ * Sets a collection of key-value pairs.
*/
- steps: google.maps.DirectionsStep[];
+ setValues(values?: object | null): void;
/**
- * Information about traffic speed along the leg.
- * @deprecated This array will always be empty.
+ * 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.
*/
- traffic_speed_entry: any[];
+ unbind(key: string): void;
/**
- * 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.
+ * Removes all bindings.
*/
- via_waypoints: google.maps.LatLng[];
+ unbindAll(): void;
}
/**
- * An object containing a points property to describe the
- * polyline of a {@link google.maps.DirectionsStep}.
+ * Projection interface.
*/
- export interface DirectionsPolyline {
+ export interface Projection {
/**
- * An encoded
- * polyline.
+ * 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.
*/
- points: string;
+ fromLatLngToPoint(latLng: google.maps.LatLng | google.maps.LatLngLiteral, point?: google.maps.Point): google.maps.Point | null;
+ /**
+ * 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.
+ */
+ fromPointToLatLng(pixel: google.maps.Point, noClampNoWrap?: boolean): google.maps.LatLng | null;
}
/**
- * Renders directions obtained from the DirectionsService.
- *
- * Access by calling `const {DirectionsRenderer} = await
- * google.maps.importLibrary("routes")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * This interface defines the map type, and is typically used for custom map types. Immutable.
*/
- export class DirectionsRenderer extends google.maps.MVCObject {
- /**
- * Renders directions obtained from the DirectionsService.
- *
- * Access by calling `const {DirectionsRenderer} = await
- * google.maps.importLibrary("routes")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- constructor(opts?: google.maps.DirectionsRendererOptions | null);
+ export interface MapType {
/**
- * Returns the renderer's current set of directions.
+ * Alt text to display when this MapType's button is hovered over in the MapTypeControl. Optional.
*/
- getDirections(): google.maps.DirectionsResult | null;
+ alt: string | null;
/**
- * Returns the map on which the DirectionsResult is rendered.
+ * The maximum zoom level for the map when displaying this MapType. Required for base MapTypes, ignored for overlay MapTypes.
*/
- getMap(): google.maps.Map | null;
+ maxZoom: number;
/**
- * Returns the panel <div> in which the
- * DirectionsResult is rendered.
+ * The minimum zoom level for the map when displaying this MapType. Optional; defaults to 0.
*/
- getPanel(): HTMLElement | null;
+ minZoom: number;
/**
- * Returns the current (zero-based) route index in use by this
- * DirectionsRenderer object.
+ * Name to display in the MapTypeControl. Optional.
*/
- getRouteIndex(): number;
+ name: string | 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.
+ * The Projection used to render this MapType. Optional; defaults to Mercator.
*/
- setDirections(directions: google.maps.DirectionsResult | null): void;
+ projection: google.maps.Projection | null;
/**
- * This method specifies the map on which directions will be rendered. Pass
- * null to remove the directions from the map.
+ * Radius of the planet for the map, in meters. Optional; defaults to Earth's equatorial radius of 6378137 meters.
*/
- setMap(map: google.maps.Map | null): void;
+ radius: number;
/**
- * Change the options settings of this DirectionsRenderer after
- * initialization.
+ * The dimensions of each tile. Required.
*/
- setOptions(options: google.maps.DirectionsRendererOptions | null): void;
+ tileSize: google.maps.Size | null;
/**
- * This method renders the directions in a <div>. Pass
- * null to remove the content from the panel.
+ * 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.
*/
- setPanel(panel: HTMLElement | null): void;
+ getTile(tileCoord: google.maps.Point, zoom: number, ownerDocument: Document): Element | null;
/**
- * 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.
+ * Releases the given tile, performing any necessary cleanup. The provided tile will have already been removed from the document. Optional.
*/
- setRouteIndex(routeIndex: number): void;
+ releaseTile(tile: Element | null): void;
}
/**
- * This object defines the properties that can be set on a
- * DirectionsRenderer object.
+ * 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 interface DirectionsRendererOptions {
+ export class LatLngBounds {
/**
- * The directions to display on the map and/or in a <div>
- * panel, retrieved as a DirectionsResult object from
- * DirectionsService.
+ * Constructs a rectangle from the points at its south-west and north-east corners.
+ * @param swOrLatLngBounds
+ * @param ne
*/
- directions?: google.maps.DirectionsResult | null;
+ constructor(swOrLatLngBounds?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null, ne?: google.maps.LatLng | google.maps.LatLngLiteral | null);
/**
- * If true, allows the user to drag and modify the paths of
- * routes rendered by this DirectionsRenderer.
+ * Returns true if the given lat/lng is in this bounds.
*/
- draggable?: boolean | null;
+ contains(latLng: google.maps.LatLng | google.maps.LatLngLiteral): boolean;
/**
- * This property indicates whether the renderer should provide a
- * user-selectable list of routes shown in the directions panel.
- * @defaultValue false
+ * Returns true if this bounds approximately equals the given bounds.
*/
- hideRouteList?: boolean | null;
+ equals(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): boolean;
/**
- * 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.
+ * Extends this bounds to contain the given point.
*/
- infoWindow?: google.maps.InfoWindow | null;
+ extend(point: google.maps.LatLng | google.maps.LatLngLiteral): google.maps.LatLngBounds;
/**
- * Map on which to display the directions.
+ * Computes the center of this LatLngBounds
*/
- map?: google.maps.Map | null;
+ getCenter(): google.maps.LatLng;
/**
- * Options for the markers. All markers rendered by the
- * DirectionsRenderer will use these options.
+ * Returns the north-east corner of this bounds.
*/
- markerOptions?: google.maps.MarkerOptions | null;
+ getNorthEast(): google.maps.LatLng;
/**
- * The <div> in which to display the directions steps.
+ * Returns the south-west corner of this bounds.
*/
- panel?: HTMLElement | null;
+ getSouthWest(): google.maps.LatLng;
/**
- * Options for the polylines. All polylines rendered by the
- * DirectionsRenderer will use these options.
+ * Returns true if this bounds shares any points with the other bounds.
*/
- polylineOptions?: google.maps.PolylineOptions | null;
+ intersects(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): boolean;
/**
- * 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
+ * Returns if the bounds are empty.
*/
- preserveViewport?: boolean | null;
+ isEmpty(): boolean;
/**
- * The index of the route within the DirectionsResult object.
- * The default value is 0.
+ * Converts to JSON representation. This function is intended to be used via JSON.stringify.
*/
- routeIndex?: number | null;
+ toJSON(): google.maps.LatLngBoundsLiteral;
+ /**
+ * Converts the given map bounds to a lat/lng span.
+ */
+ toSpan(): google.maps.LatLng;
/**
- * Suppress the rendering of the BicyclingLayer when bicycling
- * directions are requested.
+ * Converts to string.
*/
- suppressBicyclingLayer?: boolean | null;
+ toString(): string;
/**
- * Suppress the rendering of info windows.
+ * 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.
*/
- suppressInfoWindows?: boolean | null;
+ toUrlValue(precision?: number): string;
/**
- * Suppress the rendering of markers.
+ * Extends this bounds to contain the union of this and the given bounds.
*/
- suppressMarkers?: boolean | null;
+ union(other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): google.maps.LatLngBounds;
/**
- * Suppress the rendering of polylines.
+ * LatLngBounds for the max bounds of the Earth. These bounds will encompass the entire globe.
*/
- suppressPolylines?: boolean | null;
+ static readonly MAX_BOUNDS: google.maps.LatLngBounds;
}
/**
- * A directions query to be sent to the DirectionsService.
+ * 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(...);The
myMap.data.addGeoJson(...);
myMap.data.setStyle(...);
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 interface DirectionsRequest {
+ export class Data extends google.maps.MVCObject {
/**
- * If true, instructs the Directions service to avoid ferries
- * where possible. Optional.
+ * Creates an empty collection, with the given DataOptions.
+ * @param options
*/
- avoidFerries?: boolean;
+ constructor(options?: google.maps.Data.DataOptions | null);
/**
- * If true, instructs the Directions service to avoid highways
- * where possible. Optional.
+ * 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.
*/
- avoidHighways?: boolean;
+ add(feature?: google.maps.Data.Feature | google.maps.Data.FeatureOptions | null): google.maps.Data.Feature;
/**
- * If true, instructs the Directions service to avoid toll
- * roads where possible. Optional.
+ * 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.
*/
- avoidTolls?: boolean;
+ addGeoJson(geoJson: object, options?: google.maps.Data.GeoJsonOptions | null): google.maps.Data.Feature[];
/**
- * Location of destination. This can be specified as either a string to be
- * geocoded, or a LatLng, or a Place. Required.
+ * Checks whether the given feature is in the collection.
*/
- destination:
- | string
- | google.maps.LatLng
- | google.maps.Place
- | google.maps.LatLngLiteral;
+ contains(feature: google.maps.Data.Feature): boolean;
/**
- * Settings that apply only to requests where travelMode is
- * DRIVING. This object will have no effect for other travel
- * modes.
+ * 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.
*/
- drivingOptions?: google.maps.DrivingOptions;
+ forEach(callback: (arg0: google.maps.Data.Feature) => void): void;
/**
- * A language identifier for the language in which results should be
- * returned, when possible. See the list of
- * supported languages.
+ * Returns the position of the drawing controls on the map.
*/
- language?: string | null;
+ getControlPosition(): google.maps.ControlPosition | null;
/**
- * 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.
+ * 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".
*/
- optimizeWaypoints?: boolean;
+ getControls(): string[] | null;
/**
- * Location of origin. This can be specified as either a string to be
- * geocoded, or a LatLng, or a Place. Required.
+ * 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".
*/
- origin:
- | string
- | google.maps.LatLng
- | google.maps.Place
- | google.maps.LatLngLiteral;
+ getDrawingMode(): string | null;
/**
- * Whether or not route alternatives should be provided. Optional.
+ * 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.
*/
- provideRouteAlternatives?: boolean;
+ getFeatureById(id: number | string): google.maps.Data.Feature | undefined;
/**
- * 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").
+ * Returns the map on which the features are displayed.
*/
- region?: string | null;
+ getMap(): google.maps.Map | null;
/**
- * Settings that apply only to requests where travelMode is
- * TRANSIT. This object will have no effect for other travel modes.
+ * Gets the style for all features in the collection.
*/
- transitOptions?: google.maps.TransitOptions;
+ getStyle(): google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null;
/**
- * Type of routing requested. Required.
+ * 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().
*/
- travelMode: google.maps.TravelMode;
+ loadGeoJson(url: string, options?: google.maps.Data.GeoJsonOptions | null, callback?: ((arg0: google.maps.Data.Feature[]) => void)): void;
/**
- * Preferred unit system to use when displaying distance.
- * @defaultValue The unit system used in the country of origin.
+ * 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().
*/
- unitSystem?: google.maps.UnitSystem;
+ overrideStyle(feature: google.maps.Data.Feature, style: google.maps.Data.StyleOptions): void;
/**
- * 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.
+ * Removes a feature from the collection.
*/
- waypoints?: google.maps.DirectionsWaypoint[];
- }
- /**
- * 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 {
+ remove(feature: google.maps.Data.Feature): void;
/**
- * 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'.
+ * 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.
*/ - available_travel_modes?: google.maps.TravelMode[]; + revertStyle(feature?: google.maps.Data.Feature | null): void; /** - * An array ofDirectionsGeocodedWaypoints, each of which
- * contains information about the geocoding of origin, destination and
- * waypoints.
+ * Sets the position of the drawing controls on the map.
*/
- geocoded_waypoints?: google.maps.DirectionsGeocodedWaypoint[];
+ setControlPosition(controlPosition: google.maps.ControlPosition | null): void;
/**
- * The DirectionsRequest that yielded this result.
+ * 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".
*/
- request: google.maps.DirectionsRequest;
+ setControls(controls: string[] | null): void;
/**
- * 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.
+ * 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".
*/
- routes: google.maps.DirectionsRoute[];
+ setDrawingMode(drawingMode: string | null): void;
+ /**
+ * Renders the features on the specified map. If map is set to null, the features will be removed from the map.
+ */
+ setMap(map: google.maps.Map | null): void;
+ /**
+ * 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.
+ */
+ setStyle(style: google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null): void;
+ /**
+ * Exports the features in the collection to a GeoJSON object.
+ */
+ toGeoJson(callback: (arg0: object) => void): void;
}
/**
- * A single route containing a set of legs in a Deprecated in alternative routes. Version 3.27 will be the last version of the API that adds extra 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[];
}
/**
- * Configures the Learn more
- * about place
- * IDs in the Places API developer guide.
+ * Creates a new instance of a Most methods that accept
- * The constructor also accepts {@link google.maps.LatLngLiteral}
- * and The possible calls to the
- * constructor are below: Most methods that
- * accept The constructor also
- * accepts {@link google.maps.LatLngLiteral} and The possible calls to the constructor are below:
- * Examples: LatLng object literals are not supported in the Geometry
- * library. Note: This property is not
- * recommended. To disable zooming on double click, you can use the
- * Note: This property is not recommended. To disable zooming on double click, you can use the
- * @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;
- /**
- * 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.
+ * 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}
*/
- renderingType?: google.maps.RenderingType | null;
+ renderingType?: google.maps.RenderingTypeString | 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.
+ * 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.
*/
restriction?: google.maps.MapRestriction | null;
/**
@@ -4298,25 +3124,15 @@ declare namespace google.maps {
*/
scaleControlOptions?: google.maps.ScaleControlOptions | null;
/**
- * If Note:
- * This property is not recommended. To disable zooming
- * using scrollwheel, you can use the Note: This property is not recommended. To disable zooming using scrollwheel, you can use the
+ * @deprecated The Pan control is deprecated as of September 2015.
*/
- mapPane: Element;
+ panControl?: boolean | null;
/**
- * This pane contains markers. It does not receive DOM events. (Pane 2).
+ * The display options for the Pan control.
+ * @deprecated The Pan control is deprecated as of September 2015.
*/
- markerLayer: Element;
+ panControlOptions?: google.maps.PanControlOptions | null;
+ }
+ /**
+ * 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.
+ */
+ export class MapTypeRegistry extends google.maps.MVCObject {
/**
- * This pane contains polylines, polygons, ground overlays and tile layer
- * overlays. It does not receive DOM events. (Pane 1).
+ * The Learn more about place IDs in the Places API developer guide.
*/
- strictBounds?: boolean;
+ placeId: string | null;
}
/**
- * This interface defines the map type, and is typically used for custom map
- * types. Immutable.
+ * These options specify the way the style of a Calling Calling Note: Note: Note: Note: Note: Note:
- * Note: Note:
- * DirectionsResult. Note that though this
- * object is "JSON-like," it is not strictly JSON, as it directly
- * and indirectly includes LatLng objects.
+ * 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 DirectionsRoute {
+ export enum UnitSystem {
/**
- * The bounds for this route.
+ * Specifies that distances in the DirectionsResult should be expressed in imperial units.
*/
- bounds: google.maps.LatLngBounds;
+ IMPERIAL = 1,
/**
- * Copyrights text to be displayed for this route.
+ * Specifies that distances in the DirectionsResult should be expressed in metric units.
*/
- copyrights: string;
+ METRIC = 0,
+ }
+ /**
+ * 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 {
/**
- * The total fare for the whole transit trip. Only applicable to transit
- * requests.
+ * Specifies a bicycling directions request.
*/
- fare?: google.maps.TransitFare;
+ BICYCLING = 'BICYCLING',
+ /**
+ * Specifies a driving directions request.
+ */
+ DRIVING = 'DRIVING',
/**
- * 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.
+ * Specifies a transit directions request.
*/
- legs: google.maps.DirectionsLeg[];
+ TRANSIT = 'TRANSIT',
/**
- * 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).
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * Specifies a two-wheeler directions request.
*/
- overview_path: google.maps.LatLng[];
+ TWO_WHEELER = 'TWO_WHEELER',
/**
- * An encoded
- * polyline representation of the route in overview_path. This polyline
- * is an approximate (smoothed) path of the resulting directions.
+ * Specifies a walking directions request.
*/
- overview_polyline: string;
+ WALKING = 'WALKING',
+ }
+ export type TravelModeString = `${google.maps.TravelMode}`;
+ /**
+ * A directions query to be sent to the DirectionsService.
+ */
+ export interface DirectionsRequest {
/**
- * Contains a short textual description for the route, suitable for naming
- * and disambiguating the route from alternatives.
+ * If true, instructs the Directions service to avoid ferries where possible. Optional.
*/
- summary: string;
+ avoidFerries?: boolean;
/**
- * Warnings to be displayed when showing these directions.
+ * If true, instructs the Directions service to avoid highways where possible. Optional.
*/
- warnings: string[];
+ avoidHighways?: boolean;
/**
- * 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.
+ * If true, instructs the Directions service to avoid toll roads where possible. Optional.
*/
- waypoint_order: number[];
+ 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;
+ /**
+ * A language identifier for the language in which results should be returned, when possible. See the list of supported languages.
+ */
+ language?: string | null;
+ /**
+ * 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.
+ */
+ optimizeWaypoints?: boolean;
+ /**
+ * Location of origin. This can be specified as either a string to be geocoded, or a LatLng, or a Place. Required.
+ */
+ origin: string | google.maps.LatLng | google.maps.Place | google.maps.LatLngLiteral;
+ /**
+ * Whether or not route alternatives should be provided. Optional.
+ */
+ provideRouteAlternatives?: boolean;
+ /**
+ * 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").
+ */
+ region?: string | null;
+ /**
+ * Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for other travel modes.
+ */
+ transitOptions?: google.maps.TransitOptions;
+ /**
+ * Type of routing requested. Required.
+ */
+ travelMode: google.maps.TravelModeString;
+ /**
+ * Preferred unit system to use when displaying distance.
+ * @defaultValue The unit system used in the country of origin.
+ */
+ unitSystem?: google.maps.UnitSystem;
+ /**
+ * 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.
+ */
+ waypoints?: google.maps.DirectionsWaypoint[];
}
/**
- * A service for computing directions between two or more places.
- *
- * Access by calling `const {DirectionsService} = await
- * google.maps.importLibrary("routes")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {DirectionsService} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ * @deprecated google.maps.DirectionsService is deprecated as of February 25th, 2026. At this time, google.maps.DirectionsService 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 DirectionsService {
+ /**
+ * Creates a new instance of a DirectionsService that sends directions queries to Google servers.
+ */
+ constructor();
/**
* Issue a directions search request.
*/
- route(
- request: google.maps.DirectionsRequest,
- callback?: (
- a: google.maps.DirectionsResult | null,
- b: google.maps.DirectionsStatus,
- ) => void,
- ): PromiseDirectionsService on the completion
- * of a call to route(). Specify these by value, or by using the
- * constant's name. For example, 'OK' or
- * google.maps.DirectionsStatus.OK.
+ * The status returned by the DirectionsService on the completion of a call to route(). Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.DirectionsStatus.OK.
*
- * Access by calling `const {DirectionsStatus} = await
- * google.maps.importLibrary("routes")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {DirectionsStatus} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
export enum DirectionsStatus {
/**
@@ -1261,15 +883,11 @@ declare namespace google.maps {
*/
INVALID_REQUEST = 'INVALID_REQUEST',
/**
- * Too many DirectionsWaypoints were provided in the
- * DirectionsRequest. See the
- * developer's guide for the maximum number of waypoints allowed.
+ * Too many DirectionsWaypoints were provided in the DirectionsRequest. See the developer's guide for the maximum number of waypoints allowed.
*/
MAX_WAYPOINTS_EXCEEDED = 'MAX_WAYPOINTS_EXCEEDED',
/**
- * At least one of the origin, destination, or waypoints could not be
- * geocoded.
+ * At least one of the origin, destination, or waypoints could not be geocoded.
*/
NOT_FOUND = 'NOT_FOUND',
/**
@@ -1277,8 +895,7 @@ declare namespace google.maps {
*/
OK = 'OK',
/**
- * The webpage has gone over the requests limit in too short a period of
- * time.
+ * The webpage has gone over the requests limit in too short a period of time.
*/
OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
/**
@@ -1286,8 +903,7 @@ declare namespace google.maps {
*/
REQUEST_DENIED = 'REQUEST_DENIED',
/**
- * A directions request could not be processed due to a server error. The
- * request may succeed if you try again.
+ * A directions request could not be processed due to a server error. The request may succeed if you try again.
*/
UNKNOWN_ERROR = 'UNKNOWN_ERROR',
/**
@@ -1295,407 +911,297 @@ declare namespace google.maps {
*/
ZERO_RESULTS = 'ZERO_RESULTS',
}
+ export type DirectionsStatusString = `${google.maps.DirectionsStatus}`;
/**
- * 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 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 interface DirectionsStep {
+ export enum TrafficModel {
/**
- * The distance covered by this step. This property may be
- * undefined as the distance may be unknown.
+ * Use historical traffic data to best estimate the time spent in traffic.
*/
- distance?: google.maps.Distance;
+ BEST_GUESS = 'bestguess',
/**
- * 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.
+ * Use historical traffic data to make an optimistic estimate of what the duration in traffic will be.
*/
- duration?: google.maps.Duration;
+ OPTIMISTIC = 'optimistic',
/**
- * An encoded
- * polyline representation of the step. This is an approximate
- * (smoothed) path of the step.
+ * Use historical traffic data to make a pessimistic estimate of what the duration in traffic will be.
*/
- encoded_lat_lngs: string;
+ 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 {
/**
- * The ending location of this step.
+ * Specifies bus as a preferred mode of transit.
*/
- end_location: google.maps.LatLng;
+ BUS = 'BUS',
/**
- * The ending location of this step.
- * @deprecated Please use {@link google.maps.DirectionsStep.end_location}.
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * Specifies light rail as a preferred mode of transit.
*/
- end_point: google.maps.LatLng;
+ LIGHT_RAIL = 'LIGHT_RAIL',
/**
- * Instructions for this step.
+ * Specifies rail as a preferred mode of transit.
*/
- instructions: string;
+ RAIL = 'RAIL',
/**
- * 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}.
+ * Specifies subway as a preferred mode of transit.
*/
- lat_lngs: google.maps.LatLng[];
+ SUBWAY = 'SUBWAY',
/**
- * 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.
+ * Specifies train as a preferred mode of transit.
*/
- maneuver: string;
+ TRAIN = 'TRAIN',
/**
- * A sequence of LatLngs describing the course of this step.
- * This is an approximate (smoothed) path of the step.
+ * Specifies tram as a preferred mode of transit.
*/
- path: google.maps.LatLng[];
+ 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 {
/**
- * 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}.
+ * Specifies that the calculated route should prefer a limited number of transfers.
*/
- polyline?: google.maps.DirectionsPolyline;
+ FEWER_TRANSFERS = 'FEWER_TRANSFERS',
/**
- * The starting location of this step.
+ * Specifies that the calculated route should prefer limited amounts of walking.
*/
- start_location: google.maps.LatLng;
+ 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 {
/**
- * The starting location of this step.
- * @deprecated Please use {@link google.maps.DirectionsStep.start_location}.
+ * Bus.
*/
- start_point: google.maps.LatLng;
+ BUS = 'BUS',
/**
- * Sub-steps of this step. Specified for non-transit sections of transit
- * routes.
+ * A vehicle that operates on a cable, usually on the ground. Aerial cable cars may be of the type GONDOLA_LIFT.
*/
- steps?: google.maps.DirectionsStep[];
+ CABLE_CAR = 'CABLE_CAR',
/**
- * Transit-specific details about this step. This property will be undefined
- * unless the travel mode of this step is TRANSIT.
+ * Commuter rail.
*/
- transit?: google.maps.TransitDetails;
+ COMMUTER_TRAIN = 'COMMUTER_TRAIN',
/**
- * Details pertaining to this step if the travel mode is
- * TRANSIT.
+ * Ferry.
*/
- transit_details?: google.maps.TransitDetails;
+ FERRY = 'FERRY',
/**
- * The mode of travel used in this step.
+ * A vehicle that is pulled up a steep incline by a cable.
*/
- travel_mode: google.maps.TravelMode;
- }
- /**
- * @deprecated Deprecated as of 2011. Use {@link google.maps.TravelMode}
- * instead.
- */
- export enum DirectionsTravelMode {}
- /**
- * @deprecated Deprecated as of 2011. Use {@link google.maps.UnitSystem}
- * instead.
- */
- export enum DirectionsUnitSystem {}
- /**
- * A DirectionsWaypoint represents a location between origin and
- * destination through which the trip should be routed.
- */
- export interface DirectionsWaypoint {
+ FUNICULAR = 'FUNICULAR',
/**
- * Waypoint location. Can be an address string, a LatLng, or a
- * Place. Optional.
- */
- location?:
- | string
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.Place;
- /**
- * 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
+ * An aerial cable car.
*/
- stopover?: boolean;
- }
- /**
- * A representation of distance as a numeric value and a display string.
- */
- export interface Distance {
+ GONDOLA_LIFT = 'GONDOLA_LIFT',
/**
- * A string representation of the distance value, using the
- * UnitSystem specified in the request.
+ * Heavy rail.
*/
- text: string;
+ HEAVY_RAIL = 'HEAVY_RAIL',
/**
- * The distance in meters.
+ * High speed train.
*/
- 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 {
+ HIGH_SPEED_TRAIN = 'HIGH_SPEED_TRAIN',
/**
- * The origin and/or destination of this pairing could not be geocoded.
+ * Intercity bus.
*/
- NOT_FOUND = 'NOT_FOUND',
+ INTERCITY_BUS = 'INTERCITY_BUS',
/**
- * The response contains a valid result.
+ * Light rail.
*/
- OK = 'OK',
+ METRO_RAIL = 'METRO_RAIL',
/**
- * No route could be found between the origin and destination.
+ * Monorail.
*/
- ZERO_RESULTS = 'ZERO_RESULTS',
- }
- /**
- * A distance matrix query sent by the DistanceMatrixService
- * containing arrays of origin and destination locations, and various options
- * for computing metrics.
- */
- export interface DistanceMatrixRequest {
+ MONORAIL = 'MONORAIL',
/**
- * If true, instructs the Distance Matrix service to avoid
- * ferries where possible. Optional.
+ * Other vehicles.
*/
- avoidFerries?: boolean;
+ OTHER = 'OTHER',
/**
- * If true, instructs the Distance Matrix service to avoid
- * highways where possible. Optional.
+ * Rail.
*/
- avoidHighways?: boolean;
+ RAIL = 'RAIL',
/**
- * If true, instructs the Distance Matrix service to avoid toll
- * roads where possible. Optional.
+ * 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.
*/
- avoidTolls?: boolean;
+ SHARE_TAXI = 'SHARE_TAXI',
/**
- * An array containing destination address strings, or LatLng,
- * or Place objects, to which to calculate distance and time.
- * Required.
+ * Underground light rail.
*/
- destinations: (
- | string
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.Place
- )[];
+ SUBWAY = 'SUBWAY',
/**
- * Settings that apply only to requests where travelMode is
- * DRIVING. This object will have no effect for other travel
- * modes.
+ * Above ground light rail.
*/
- drivingOptions?: google.maps.DrivingOptions;
+ TRAM = 'TRAM',
/**
- * A language identifier for the language in which results should be
- * returned, when possible. See the list of
- * supported languages.
+ * Trolleybus.
*/
- language?: string | null;
+ 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 {
/**
- * 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
- )[];
- /**
- * 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").
+ * 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'.
*/
- region?: string | null;
+ available_travel_modes?: google.maps.TravelModeString[];
/**
- * Settings that apply only to requests where travelMode is
- * TRANSIT. This object will have no effect for other travel modes.
+ * An array of DirectionsGeocodedWaypoints, each of which contains information about the geocoding of origin, destination and waypoints.
*/
- transitOptions?: google.maps.TransitOptions;
+ geocoded_waypoints?: google.maps.DirectionsGeocodedWaypoint[];
/**
- * Type of routing requested. Required.
+ * The DirectionsRequest that yielded this result.
*/
- travelMode: google.maps.TravelMode;
+ request: google.maps.DirectionsRequest;
/**
- * Preferred unit system to use when displaying distance. Optional; defaults
- * to metric.
+ * 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.
*/
- unitSystem?: google.maps.UnitSystem;
+ routes: google.maps.DirectionsRoute[];
}
/**
- * 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 geocoded waypoint.
*/
- export interface DistanceMatrixResponse {
+ export interface DirectionsGeocodedWaypoint {
/**
- * The formatted destination addresses.
+ * Whether the geocoder did not return an exact match for the original waypoint, though it was able to match part of the requested address.
*/
- destinationAddresses: string[];
+ partial_match?: boolean;
/**
- * The formatted origin addresses.
+ * 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.
*/
- originAddresses: string[];
+ place_id?: string;
/**
- * The rows of the matrix, corresponding to the origin addresses.
+ * 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.
*/
- rows: google.maps.DistanceMatrixResponseRow[];
+ types?: string[];
}
/**
- * A single element of a response to a DistanceMatrixService
- * request, which contains the duration and distance from one origin to one
- * destination.
+ * 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 DistanceMatrixResponseElement {
+ export interface DirectionsRoute {
/**
- * The distance for this origin-destination pairing. This property may be
- * undefined as the distance may be unknown.
+ * The bounds for this route.
*/
- distance: google.maps.Distance;
+ bounds: google.maps.LatLngBounds;
/**
- * The duration for this origin-destination pairing. This property may be
- * undefined as the duration may be unknown.
+ * Copyrights text to be displayed for this route.
*/
- duration: google.maps.Duration;
+ copyrights: 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.
+ * The total fare for the whole transit trip. Only applicable to transit requests.
*/
- duration_in_traffic: google.maps.Duration;
+ fare?: google.maps.TransitFare;
/**
- * The total fare for this origin-destination pairing. Only applicable to
- * transit requests.
+ * 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.
*/
- fare: google.maps.TransitFare;
+ legs: google.maps.DirectionsLeg[];
/**
- * The status of this particular origin-destination pairing.
+ * 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).
*/
- status: google.maps.DistanceMatrixElementStatus;
- }
- /**
- * A row of the response to a DistanceMatrixService request,
- * consisting of a sequence of DistanceMatrixResponseElements,
- * one for each corresponding destination address.
- */
- export interface DistanceMatrixResponseRow {
+ overview_path: google.maps.LatLng[];
/**
- * The row's elements, corresponding to the destination addresses.
+ * An encoded polyline representation of the route in overview_path. This polyline is an approximate (smoothed) path of the resulting directions.
*/
- elements: google.maps.DistanceMatrixResponseElement[];
- }
- /**
- * A service for computing distances between multiple origins and
- * destinations.
- *
- * Access by calling `const {DistanceMatrixService} = await
- * google.maps.importLibrary("routes")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class DistanceMatrixService {
+ overview_polyline: string;
/**
- * Issues a distance matrix request.
+ * Contains a short textual description for the route, suitable for naming and disambiguating the route from alternatives.
+ */
+ summary: string;
+ /**
+ * Warnings to be displayed when showing these directions.
+ */
+ warnings: string[];
+ /**
+ * 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.
*/
- getDistanceMatrix(
- request: google.maps.DistanceMatrixRequest,
- callback?: (
- a: google.maps.DistanceMatrixResponse | null,
- b: google.maps.DistanceMatrixStatus,
- ) => void,
- ): PromiseDistanceMatrixService 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.
+ * 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 enum DistanceMatrixStatus {
+ export interface DirectionsLeg {
/**
- * The provided request was invalid.
+ * An estimated arrival time for this leg. Only applicable for TRANSIT requests.
*/
- INVALID_REQUEST = 'INVALID_REQUEST',
+ arrival_time?: google.maps.Time;
/**
- * The request contains more than 25 origins, or more than 25 destinations.
+ * An estimated departure time for this leg. Only applicable for TRANSIT requests.
*/
- MAX_DIMENSIONS_EXCEEDED = 'MAX_DIMENSIONS_EXCEEDED',
+ departure_time?: google.maps.Time;
/**
- * The product of origins and destinations exceeds the per-query limit.
+ * The total distance covered by this leg. This property may be undefined as the distance may be unknown.
*/
- MAX_ELEMENTS_EXCEEDED = 'MAX_ELEMENTS_EXCEEDED',
+ distance?: google.maps.Distance;
/**
- * The response contains a valid result.
+ * The total duration of this leg. This property may be undefined as the duration may be unknown.
*/
- OK = 'OK',
+ duration?: google.maps.Duration;
/**
- * Too many elements have been requested within the allowed time period. The
- * request should succeed if you try again after some time.
+ * 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.
*/
- OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
+ duration_in_traffic?: google.maps.Duration;
/**
- * The service denied use of the Distance Matrix service by your web page.
+ * The address of the destination of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address.
*/
- REQUEST_DENIED = 'REQUEST_DENIED',
+ end_address: string;
/**
- * A Distance Matrix request could not be processed due to a server error.
- * The request may succeed if you try again.
+ * 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.
*/
- UNKNOWN_ERROR = 'UNKNOWN_ERROR',
- }
- export interface DrawingLibrary {
- DrawingManager: typeof google.maps.drawing.DrawingManager;
- OverlayType: typeof google.maps.drawing.OverlayType;
+ 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. via_waypoints in alternative routes. DirectionsRequest when the travel mode
- * is set to DRIVING.
+ * A representation of distance as a numeric value and a display string.
*/
- export interface DrivingOptions {
+ export interface Distance {
/**
- * 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.
+ * A string representation of the distance value, using the UnitSystem specified in the request.
*/
- departureTime: Date;
+ text: string;
/**
- * The preferred assumption to use when predicting duration in traffic. The
- * default is BEST_GUESS.
+ * The distance in meters.
*/
- trafficModel?: google.maps.TrafficModel;
+ value: number;
}
/**
* A representation of duration as a numeric value and a display string.
@@ -1710,1786 +1216,1236 @@ declare namespace google.maps {
*/
value: number;
}
- export interface ElevationLibrary {
- ElevationService: typeof google.maps.ElevationService;
- ElevationStatus: typeof google.maps.ElevationStatus;
- }
/**
- * 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.
+ * 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 interface ElevationResult {
- /**
- * The elevation of this point on Earth, in meters above sea level.
- */
- elevation: number;
- /**
- * The location of this elevation result.
- */
- location: google.maps.LatLng | null;
+ export interface DirectionsStep {
/**
- * 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 distance covered by this step. This property may be undefined as the distance may be unknown.
*/
- 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 {
+ distance?: google.maps.Distance;
/**
- * Makes an elevation request along a path, where the elevation data are
- * returned as distance-based samples along that path.
+ * 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.
*/
- getElevationAlongPath(
- request: google.maps.PathElevationRequest,
- callback?: (
- a: google.maps.ElevationResult[] | null,
- b: google.maps.ElevationStatus,
- ) => void,
- ): PromiseElevationService 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 {
+ encoded_lat_lngs: string;
/**
- * The request was invalid.
+ * The ending location of this step.
*/
- INVALID_REQUEST = 'INVALID_REQUEST',
+ end_location: google.maps.LatLng;
/**
- * The request did not encounter any errors.
+ * Instructions for this step.
*/
- OK = 'OK',
+ instructions: string;
/**
- * The webpage has gone over the requests limit in too short a period of
- * time.
+ * 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.
*/
- OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
+ maneuver: string;
/**
- * The webpage is not allowed to use the elevation service.
+ * A sequence of LatLngs describing the course of this step. This is an approximate (smoothed) path of the step.
*/
- REQUEST_DENIED = 'REQUEST_DENIED',
+ path: google.maps.LatLng[];
/**
- * The elevation request could not be successfully processed, yet the exact
- * reason for the failure is not known.
+ * The starting location of this step.
*/
- UNKNOWN_ERROR = 'UNKNOWN_ERROR',
- }
- /**
- * An event with an associated Error.
- */
- export interface ErrorEvent {
+ start_location: google.maps.LatLng;
/**
- * The Error related to the event.
+ * Sub-steps of this step. Specified for non-transit sections of transit routes.
*/
- error: Error;
- }
- /**
- * 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 enum ExtraGeocodeComputation {
+ steps?: google.maps.DirectionsStep[];
/**
- * Generate an address descriptor.
+ * Transit-specific details about this step. This property will be undefined unless the travel mode of this step is TRANSIT.
*/
- ADDRESS_DESCRIPTORS = 'ADDRESS_DESCRIPTORS',
- }
- /**
- * 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 {
+ transit?: google.maps.TransitDetails;
/**
- * FeatureType of this Feature.
+ * Details pertaining to this step if the travel mode is TRANSIT.
*/
- featureType: google.maps.FeatureType;
- }
- /**
- * 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 {
+ transit_details?: google.maps.TransitDetails;
/**
- * 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}.
- * @param eventName Observed event.
- * @param handler Function to handle events.
+ * The mode of travel used in this step.
*/
- addListener(
- eventName: string,
- handler: Function,
- ): google.maps.MapsEventListener;
+ travel_mode: google.maps.TravelModeString;
/**
- * 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.
+ * The starting location of this step.
+ * @deprecated Please use {@link google.maps.DirectionsStep.start_location}.
*/
- datasetId?: string;
+ start_point: google.maps.LatLng;
/**
- * The FeatureType associated with this
- * FeatureLayer.
+ * The ending location of this step.
+ * @deprecated Please use {@link google.maps.DirectionsStep.end_location}.
*/
- featureType: google.maps.FeatureType;
+ end_point: google.maps.LatLng;
/**
- * 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.
+ * 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}.
*/
- isAvailable: boolean;
+ lat_lngs: google.maps.LatLng[];
/**
- * 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.
+ * 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}.
*/
- style?:
- | google.maps.FeatureStyleOptions
- | null
- | google.maps.FeatureStyleFunction;
+ polyline?: google.maps.DirectionsPolyline;
}
/**
- * This object is returned from a mouse event on a FeatureLayer.
+ * An object containing a points property to describe the polyline of a {@link google.maps.DirectionsStep}.
*/
- export interface FeatureMouseEvent extends google.maps.MapMouseEvent {
+ export interface DirectionsPolyline {
/**
- * The Features at this mouse event.
+ * An encoded polyline.
*/
- features: google.maps.Feature[];
+ points: string;
}
- export type FeatureStyleFunction = (
- a: google.maps.FeatureStyleFunctionOptions,
- ) => google.maps.FeatureStyleOptions | null | undefined;
/**
- * Options passed to a FeatureStyleFunction.
+ * 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 FeatureStyleFunctionOptions {
+ export class DirectionsRenderer extends google.maps.MVCObject {
/**
- * Feature passed into the FeatureStyleFunction
- * for styling.
+ * 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
*/
- feature: google.maps.Feature;
- }
- /**
- * These options specify the way the style of a Feature should be
- * modified on a map.
- */
- export interface FeatureStyleOptions {
+ constructor(opts?: google.maps.DirectionsRendererOptions | null);
/**
- * Hex RGB string (like "#00FF00" for green). Only applies to
- * polygon geometries.
+ * Returns the renderer's current set of directions.
*/
- fillColor?: string;
+ getDirections(): google.maps.DirectionsResult | null;
/**
- * The fill opacity between 0.0 and 1.0. Only applies to polygon geometries.
+ * Returns the map on which the DirectionsResult is rendered.
*/
- fillOpacity?: number;
+ getMap(): google.maps.Map | null;
/**
- * Hex RGB string (like "#00FF00" for green).
+ * Returns the panel <div> in which the DirectionsResult is rendered.
*/
- strokeColor?: string;
+ getPanel(): HTMLElement | null;
/**
- * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon
- * geometries.
+ * Returns the current (zero-based) route index in use by this DirectionsRenderer object.
*/
- strokeOpacity?: number;
+ getRouteIndex(): number;
/**
- * The stroke width in pixels. Only applies to line and polygon geometries.
+ * 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.
*/
- strokeWeight?: number;
- }
- /**
- * Identifiers for feature types.
- *
- * Access by calling `const {FeatureType} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export enum FeatureType {
+ setDirections(directions: google.maps.DirectionsResult | null): void;
/**
- * Indicates a first-order civil entity below the country level.
+ * This method specifies the map on which directions will be rendered. Pass null to remove the directions from the map.
*/
- ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',
+ setMap(map: google.maps.Map | null): void;
/**
- * Indicates a second-order civil entity below the country level.
+ * Change the options settings of this DirectionsRenderer after initialization.
*/
- ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',
+ setOptions(options: google.maps.DirectionsRendererOptions | null): void;
/**
- * Indicates the national political entity.
+ * This method renders the directions in a <div>. Pass null to remove the content from the panel.
*/
- COUNTRY = 'COUNTRY',
+ setPanel(panel: HTMLElement | null): void;
/**
- * Indicates a third-party dataset.
+ * 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.
*/
- DATASET = 'DATASET',
+ 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 {
/**
- * Indicates an incorporated city or town political entity.
+ * The origin and/or destination of this pairing could not be geocoded.
*/
- LOCALITY = 'LOCALITY',
+ NOT_FOUND = 'NOT_FOUND',
/**
- * Indicates a postal code as used to address postal mail within the
- * country. Includes zip codes.
+ * The response contains a valid result.
*/
- POSTAL_CODE = 'POSTAL_CODE',
+ OK = 'OK',
/**
- * Indicates a school district.
+ * No route could be found between the origin and destination.
*/
- SCHOOL_DISTRICT = 'SCHOOL_DISTRICT',
+ ZERO_RESULTS = 'ZERO_RESULTS',
}
+ export type DistanceMatrixElementStatusString = `${google.maps.DistanceMatrixElementStatus}`;
/**
- * Options for the rendering of the fullscreen control.
+ * A distance matrix query sent by the DistanceMatrixService containing arrays of origin and destination locations, and various options for computing metrics.
*/
- export interface FullscreenControlOptions {
+ export interface DistanceMatrixRequest {
/**
- * Position id. Used to specify the position of the control on the map.
- * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_START}
+ * If true, instructs the Distance Matrix service to avoid ferries where possible. Optional.
*/
- 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 {
+ avoidFerries?: boolean;
/**
- * Geocode a request.
+ * If true, instructs the Distance Matrix service to avoid highways where possible. Optional.
*/
- geocode(
- request: google.maps.GeocoderRequest,
- callback?:
- | ((
- a: google.maps.GeocoderResult[] | null,
- b: google.maps.GeocoderStatus,
- ) => void)
- | null,
- ): PromiseGeocoderResult. A full
- * address may consist of multiple address components.
- */
- export interface GeocoderAddressComponent {
+ avoidHighways?: boolean;
/**
- * The full text of the address component
+ * If true, instructs the Distance Matrix service to avoid toll roads where possible. Optional.
*/
- long_name: string;
+ avoidTolls?: boolean;
/**
- * The abbreviated, short text of the given address component
+ * An array containing destination address strings, or LatLng, or Place objects, to which to calculate distance and time. Required.
*/
- short_name: string;
+ destinations: (string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place)[];
/**
- * An array of strings denoting the type of this address component. A list
- * of valid types can be found here
+ * Settings that apply only to requests where travelMode is DRIVING. This object will have no effect for other travel modes.
*/
- 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 {
+ drivingOptions?: google.maps.DrivingOptions;
/**
- * Matches all the administrative_area levels. Optional.
+ * A language identifier for the language in which results should be returned, when possible. See the list of supported languages.
*/
- administrativeArea?: string;
+ language?: string | null;
/**
- * Matches a country name or a two letter ISO 3166-1 country code. Optional.
+ * An array containing origin address strings, or LatLng, or Place objects, from which to calculate distance and time. Required.
*/
- country?: string;
+ origins: (string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place)[];
/**
- * Matches against both locality and sublocality
- * types. Optional.
+ * 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").
*/
- locality?: string;
+ region?: string | null;
/**
- * Matches postal_code and postal_code_prefix.
- * Optional.
+ * Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for other travel modes.
*/
- postalCode?: string;
+ transitOptions?: google.maps.TransitOptions;
/**
- * Matches the long or short name of a route. Optional.
+ * Type of routing requested. Required.
*/
- route?: string;
+ travelMode: google.maps.TravelModeString;
+ /**
+ * Preferred unit system to use when displaying distance. Optional; defaults to metric.
+ */
+ unitSystem?: google.maps.UnitSystem;
}
/**
- * Geometry information about this GeocoderResult
+ * 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 GeocoderGeometry {
+ export interface DistanceMatrixResponse {
/**
- * The precise bounds of this GeocoderResult, if applicable
+ * The formatted destination addresses.
*/
- bounds?: google.maps.LatLngBounds;
+ destinationAddresses: string[];
/**
- * The latitude/longitude coordinates of this result
+ * The formatted origin addresses.
*/
- location: google.maps.LatLng;
+ originAddresses: string[];
/**
- * The type of location returned in location
+ * The rows of the matrix, corresponding to the origin addresses.
*/
- location_type: google.maps.GeocoderLocationType;
+ 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 {
/**
- * The bounds of the recommended viewport for displaying this
- * GeocoderResult
+ * The row's elements, corresponding to the destination addresses.
*/
- viewport: google.maps.LatLngBounds;
+ elements: google.maps.DistanceMatrixResponseElement[];
}
/**
- * 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 single element of a response to a DistanceMatrixService request, which contains the duration and distance from one origin to one destination.
*/
- export enum GeocoderLocationType {
+ export interface DistanceMatrixResponseElement {
/**
- * The returned result is approximate.
+ * The distance for this origin-destination pairing. This property may be undefined as the distance may be unknown.
*/
- APPROXIMATE = 'APPROXIMATE',
+ distance: google.maps.Distance;
/**
- * The returned result is the geometric center of a result such a line (e.g.
- * street) or polygon (region).
+ * The duration for this origin-destination pairing. This property may be undefined as the duration may be unknown.
*/
- GEOMETRIC_CENTER = 'GEOMETRIC_CENTER',
+ duration: google.maps.Duration;
/**
- * 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 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.
*/
- RANGE_INTERPOLATED = 'RANGE_INTERPOLATED',
+ duration_in_traffic: google.maps.Duration;
/**
- * The returned result reflects a precise geocode.
+ * The total fare for this origin-destination pairing. Only applicable to transit requests.
*/
- ROOFTOP = 'ROOFTOP',
+ fare: google.maps.TransitFare;
+ /**
+ * The status of this particular origin-destination pairing.
+ */
+ status: google.maps.DistanceMatrixElementStatusString;
}
/**
- * The specification for a geocoding request to be sent to the
- * Geocoder.
+ * 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 interface GeocoderRequest {
+ export class DistanceMatrixService {
/**
- * Address to geocode. One, and only one, of address,
- * location and placeId must be supplied.
+ * Creates a new instance of a DistanceMatrixService that sends distance matrix queries to Google servers.
*/
- address?: string | null;
+ constructor();
/**
- * LatLngBounds within which to search. Optional.
+ * Issues a distance matrix request.
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ getDistanceMatrix(request: google.maps.DistanceMatrixRequest, callback?: ((arg0: google.maps.DistanceMatrixResponse | null, arg1: google.maps.DistanceMatrixStatusString) => void)): PromiseDistanceMatrixService 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 {
/**
- * 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.
+ * The provided request was invalid.
*/
- componentRestrictions?: google.maps.GeocoderComponentRestrictions | null;
+ INVALID_REQUEST = 'INVALID_REQUEST',
/**
- * 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 request contains more than 25 origins, or more than 25 destinations.
*/
- extraComputations?: google.maps.ExtraGeocodeComputation[];
+ MAX_DIMENSIONS_EXCEEDED = 'MAX_DIMENSIONS_EXCEEDED',
/**
- * 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 product of origins and destinations exceeds the per-query limit.
*/
- fulfillOnZeroResults?: boolean | null;
+ MAX_ELEMENTS_EXCEEDED = 'MAX_ELEMENTS_EXCEEDED',
/**
- * A language identifier for the language in which results should be
- * returned, when possible. See the list of
- * supported languages.
+ * The response contains a valid result.
*/
- language?: string | null;
+ OK = 'OK',
/**
- * 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.
+ * Too many elements have been requested within the allowed time period. The request should succeed if you try again after some time.
*/
- location?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
/**
- * 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.
+ * The service denied use of the Distance Matrix service by your web page.
*/
- placeId?: string | null;
+ REQUEST_DENIED = 'REQUEST_DENIED',
/**
- * 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.
+ * A Distance Matrix request could not be processed due to a server error. The request may succeed if you try again.
*/
- region?: string | null;
+ UNKNOWN_ERROR = 'UNKNOWN_ERROR',
}
+ export type DistanceMatrixStatusString = `${google.maps.DistanceMatrixStatus}`;
/**
- * A Geocoder response returned by the {@link google.maps.Geocoder} containing
- * the list of {@link google.maps.GeocoderResult}s.
+ * 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 interface GeocoderResponse {
+ export class ElevationService {
/**
- * 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.
+ * Creates a new instance of a ElevationService that sends elevation queries to Google servers.
*/
- address_descriptor?: google.maps.AddressDescriptor | null;
+ constructor();
/**
- * The plus code associated with the location.
+ * Makes an elevation request along a path, where the elevation data are returned as distance-based samples along that path.
*/
- plus_code?: google.maps.places.PlacePlusCode | null;
+ getElevationAlongPath(request: google.maps.PathElevationRequest, callback?: ((arg0: google.maps.ElevationResult[] | null, arg1: google.maps.ElevationStatusString) => void)): PromiseLatLng object.
+ * 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 interface GeocoderResult {
- /**
- * An array of GeocoderAddressComponents
- */
- address_components: google.maps.GeocoderAddressComponent[];
- /**
- * 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.
- */
- address_descriptor?: google.maps.AddressDescriptor;
+ export enum ElevationStatus {
/**
- * A string containing the human-readable address of this location.
+ * The request was invalid.
*/
- formatted_address: string;
+ INVALID_REQUEST = 'INVALID_REQUEST',
/**
- * A GeocoderGeometry object
+ * The request did not encounter any errors.
*/
- geometry: google.maps.GeocoderGeometry;
+ OK = 'OK',
/**
- * 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 webpage has gone over the requests limit in too short a period of time.
*/
- partial_match?: boolean;
+ OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
/**
- * 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 webpage is not allowed to use the elevation service.
*/
- place_id: string;
+ REQUEST_DENIED = 'REQUEST_DENIED',
/**
- * The plus code associated with the location.
+ * The elevation request could not be successfully processed, yet the exact reason for the failure is not known.
*/
- plus_code?: google.maps.places.PlacePlusCode;
+ UNKNOWN_ERROR = 'UNKNOWN_ERROR',
+ }
+ 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.
+ */
+ export interface AddressDescriptor {
/**
- * 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.
+ * A ranked list of containing or adjacent areas. The most useful (recognizable and precise) areas are ranked first.
*/
- postcode_localities?: string[];
+ areas: google.maps.Area[];
/**
- * 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.
+ * A ranked list of nearby landmarks. The most useful (recognizable and nearby) landmarks are ranked first.
*/
- types: string[];
+ landmarks: google.maps.Landmark[];
}
/**
- * 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.
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * A place that represents a point of reference for the address.
*/
- export enum GeocoderStatus {
+ export interface Landmark {
/**
- * There was a problem contacting the Google servers.
+ * The name for the landmark.
*/
- ERROR = 'ERROR',
+ display_name: string;
/**
- * This GeocoderRequest was invalid.
+ * The language of the name for the landmark.
*/
- INVALID_REQUEST = 'INVALID_REQUEST',
+ display_name_language_code: string;
/**
- * The response contains a valid GeocoderResponse.
+ * 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.
*/
- OK = 'OK',
+ place_id: string;
/**
- * The webpage has gone over the requests limit in too short a period of
- * time.
+ * Defines the spatial relationship between the target location and the landmark.
*/
- OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
+ spatial_relationship: google.maps.SpatialRelationshipString;
/**
- * The webpage is not allowed to use the geocoder.
+ * The straight line distance between the target location and the landmark.
*/
- REQUEST_DENIED = 'REQUEST_DENIED',
+ straight_line_distance_meters: number;
/**
- * A geocoding request could not be processed due to a server error. The
- * request may succeed if you try again.
+ * 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.
*/
- UNKNOWN_ERROR = 'UNKNOWN_ERROR',
+ travel_distance_meters?: number;
/**
- * No result was found for this GeocoderRequest.
+ * One or more values indicating the type of the returned result. Please see Types for more detail.
*/
- ZERO_RESULTS = 'ZERO_RESULTS',
- }
- 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;
+ types: string[];
}
/**
- * A rectangular image overlay on the map.
+ * 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 {GroundOverlay} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {SpatialRelationship} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class GroundOverlay extends google.maps.MVCObject {
+ export enum SpatialRelationship {
/**
- * 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.
+ * The target is directly opposite the landmark on the other side of the road.
*/
- constructor(
- url: string,
- bounds: google.maps.LatLngBounds | null | google.maps.LatLngBoundsLiteral,
- opts?: google.maps.GroundOverlayOptions | null,
- );
+ ACROSS_THE_ROAD = 'ACROSS_THE_ROAD',
/**
- * Gets the LatLngBounds of this overlay.
+ * Not on the same route as the landmark but a single turn away.
*/
- getBounds(): google.maps.LatLngBounds | null;
+ AROUND_THE_CORNER = 'AROUND_THE_CORNER',
/**
- * Returns the map on which this ground overlay is displayed.
+ * Close to the landmark's structure but further away from its access point.
*/
- getMap(): google.maps.Map | null;
+ BEHIND = 'BEHIND',
/**
- * Returns the opacity of this ground overlay.
+ * The target is directly adjacent to the landmark.
*/
- getOpacity(): number;
+ BESIDE = 'BESIDE',
/**
- * Gets the url of the projected image.
+ * On the same route as the landmark but not besides or across.
*/
- getUrl(): string;
+ DOWN_THE_ROAD = 'DOWN_THE_ROAD',
/**
- * Renders the ground overlay on the specified map. If map is set to
- * null, the overlay is removed.
+ * This is the default relationship when nothing more specific below applies.
*/
- setMap(map: google.maps.Map | null): void;
+ NEAR = 'NEAR',
/**
- * Sets the opacity of this ground overlay.
+ * The landmark has a spatial geometry and the target is within its bounds.
*/
- setOpacity(opacity: number): void;
+ WITHIN = 'WITHIN',
}
+ export type SpatialRelationshipString = `${google.maps.SpatialRelationship}`;
/**
- * This object defines the properties that can be set on a
- * GroundOverlay object.
+ * 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 GroundOverlayOptions {
+ export interface Area {
/**
- * If true, the ground overlay can receive mouse events.
+ * Defines the spatial relationship between the target location and the area.
*/
- clickable?: boolean | null;
+ containment: google.maps.ContainmentString;
/**
- * The map on which to display the overlay.
+ * The name for the area.
*/
- map?: google.maps.Map | null;
+ display_name: string;
/**
- * The opacity of the overlay, expressed as a number between 0 and 1.
- * Optional.
- * @defaultValue 1.0
+ * The language of the name for the area.
*/
- opacity?: number | null;
+ 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;
}
/**
- * A structure representing a Marker icon image.
+ * 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 interface Icon {
- /**
- * 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.
- */
- anchor?: google.maps.Point | null;
- /**
- * 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.
- */
- labelOrigin?: google.maps.Point | 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).
- */
- origin?: google.maps.Point | null;
+ export enum Containment {
/**
- * The size of the entire image after scaling, if any. Use this property to
- * stretch/shrink an image or a sprite.
+ * The target location is outside the area region, but close by.
*/
- scaledSize?: google.maps.Size | null;
+ NEAR = 'NEAR',
/**
- * 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.
+ * The target location is within the area region, close to the edge.
*/
- size?: google.maps.Size | null;
+ OUTSKIRTS = 'OUTSKIRTS',
/**
- * The URL of the image or sprite sheet.
+ * The target location is within the area region, close to the center.
*/
- url: string;
+ WITHIN = 'WITHIN',
}
+ export type ContainmentString = `${google.maps.Containment}`;
/**
- * 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.
+ * 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 interface IconMouseEvent extends google.maps.MapMouseEvent {
+ export class Geocoder {
/**
- * 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. Geocoder that sends geocode requests to Google servers.
*/
- placeId: string | null;
+ constructor();
+ /**
+ * Geocode a request.
+ */
+ geocode(request: google.maps.GeocoderRequest, callback?: ((arg0: google.maps.GeocoderResult[] | null, arg1: google.maps.GeocoderStatusString) => void) | null): Promise
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.
+ * 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 interface IconSequence {
+ export enum GeocoderLocationType {
/**
- * 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 returned result is approximate.
*/
- fixedRotation?: boolean;
+ APPROXIMATE = 'APPROXIMATE',
/**
- * The icon to render on the line.
+ * The returned result is the geometric center of a result such a line (e.g. street) or polygon (region).
*/
- icon?: google.maps.Symbol | null;
+ GEOMETRIC_CENTER = 'GEOMETRIC_CENTER',
/**
- * 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 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.
*/
- offset?: string;
+ RANGE_INTERPOLATED = 'RANGE_INTERPOLATED',
/**
- * 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
+ * The returned result reflects a precise geocode.
*/
- repeat?: string;
+ ROOFTOP = 'ROOFTOP',
}
+ export type GeocoderLocationTypeString = `${google.maps.GeocoderLocationType}`;
/**
- * This class implements the MapType interface and is provided for rendering
- * image tiles.
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * Extra computations to perform while completing a geocoding request.
*
- * 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
- {
- /**
- * 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.
+ * Access by calling `const {ExtraGeocodeComputation} = await google.maps.importLibrary("geocoding");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export enum ExtraGeocodeComputation {
+ /**
+ * Generate an address descriptor.
*/
- constructor(opts: google.maps.ImageMapTypeOptions | null);
- alt: string | null;
+ ADDRESS_DESCRIPTORS = 'ADDRESS_DESCRIPTORS',
+ }
+ export type ExtraGeocodeComputationString = `${google.maps.ExtraGeocodeComputation}`;
+ /**
+ * The specification for a geocoding request to be sent to the Geocoder.
+ */
+ export interface GeocoderRequest {
/**
- * Returns the opacity level (0 (transparent) to
- * 1.0) of the ImageMapType tiles.
+ * Address to geocode. One, and only one, of address, location and placeId must be supplied.
*/
- getOpacity(): number;
+ address?: string | null;
/**
- * @param tileCoord Tile coordinates.
- * @param zoom Tile zoom.
- * @param ownerDocument The document which owns this tile.
+ * LatLngBounds within which to search. Optional.
*/
- getTile(
- tileCoord: google.maps.Point | null,
- zoom: number,
- ownerDocument: Document | null,
- ): Element | null;
- maxZoom: number;
- minZoom: number;
- name: string | null;
- projection: google.maps.Projection | null;
- radius: number;
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
/**
- * @param tileDiv Tile to release.
+ * 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.
*/
- releaseTile(tileDiv: Element | null): void;
+ componentRestrictions?: google.maps.GeocoderComponentRestrictions | null;
+ /**
+ * 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.
+ */
+ extraComputations?: google.maps.ExtraGeocodeComputationString[];
/**
- * Sets the opacity level (0 (transparent) to 1.0)
- * of the ImageMapType tiles.
- * @param opacity The new opacity.
+ * 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.
*/
- setOpacity(opacity: number): void;
- tileSize: google.maps.Size | null;
+ fulfillOnZeroResults?: boolean | null;
+ /**
+ * A language identifier for the language in which results should be returned, when possible. See the list of supported languages.
+ */
+ language?: string | null;
+ /**
+ * 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.
+ */
+ location?: google.maps.LatLng | google.maps.LatLngLiteral | 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.
+ */
+ 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;
}
/**
- * This class is used to create a MapType that renders image tiles.
+ * 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.
*/
- export interface ImageMapTypeOptions {
+ export enum GeocoderStatus {
/**
- * Alt text to display when this MapType's button is hovered over in the
- * MapTypeControl.
+ * There was a problem contacting the Google servers.
*/
- alt?: string | null;
+ ERROR = 'ERROR',
/**
- * Returns a string (URL) for given tile coordinate (x, y) and zoom level.
+ * This GeocoderRequest was invalid.
*/
- getTileUrl?: ((a: google.maps.Point, b: number) => string | null) | null;
+ INVALID_REQUEST = 'INVALID_REQUEST',
/**
- * The maximum zoom level for the map when displaying this MapType.
+ * The response contains a valid GeocoderResponse.
*/
- maxZoom?: number | null;
+ OK = 'OK',
/**
- * The minimum zoom level for the map when displaying this MapType.
- * Optional.
+ * The webpage has gone over the requests limit in too short a period of time.
*/
- minZoom?: number | null;
+ OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
/**
- * Name to display in the MapTypeControl.
+ * The webpage is not allowed to use the geocoder.
*/
- name?: string | null;
+ REQUEST_DENIED = 'REQUEST_DENIED',
/**
- * 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.
+ * A geocoding request could not be processed due to a server error. The request may succeed if you try again.
*/
- opacity?: number | null;
+ UNKNOWN_ERROR = 'UNKNOWN_ERROR',
/**
- * The tile size.
+ * No result was found for this GeocoderRequest.
*/
- tileSize?: google.maps.Size | null;
+ ZERO_RESULTS = 'ZERO_RESULTS',
}
+ export type GeocoderStatusString = `${google.maps.GeocoderStatus}`;
/**
- * 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 {
/**
- * 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.
+ *
+ * @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);
/**
- * Closes this InfoWindow by removing it from the DOM structure.
+ * Returns the altitude.
*/
- close(): void;
+ get altitude(): 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 latitude.
*/
- focus(): void;
- getContent(): string | Element | null | Text | undefined;
- getHeaderContent(): string | Element | null | Text | undefined;
- getHeaderDisabled(): boolean | undefined;
- getPosition(): google.maps.LatLng | null | undefined;
- getZIndex(): number;
+ get lat(): number;
/**
- * Checks if the InfoWindow is open.
- */
- isOpen: boolean;
- /**
- * 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.
- * @param options Either an InfoWindowOpenOptions object (recommended) or
- * the map|panorama on which to render this InfoWindow.
- * @param anchor 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).
- */
- open(
- options?:
- | google.maps.InfoWindowOpenOptions
- | null
- | google.maps.Map
- | google.maps.StreetViewPanorama,
- anchor?:
- | google.maps.MVCObject
- | null
- | google.maps.marker.AdvancedMarkerElement,
- ): void;
- /**
- * @param content The content to be displayed by this InfoWindow.
- */
- setContent(content?: string | Element | null | Text): void;
- /**
- * @param headerContent The header content to be displayed by this
- * InfoWindow. See {@link google.maps.InfoWindowOptions.headerContent}.
- */
- setHeaderContent(headerContent?: string | Element | null | Text): void;
- /**
- * @param headerDisabled Specifies whether to disable the whole header row.
- * See {@link google.maps.InfoWindowOptions.headerDisabled}.
+ * Returns the longitude.
*/
- setHeaderDisabled(headerDisabled?: boolean | null): void;
- setOptions(options?: google.maps.InfoWindowOptions | null): void;
+ get lng(): number;
/**
- * @param position The LatLng position at which to display this InfoWindow.
+ * Comparison function.
*/
- setPosition(
- position?: google.maps.LatLng | null | google.maps.LatLngLiteral,
- ): void;
+ equals(other: google.maps.LatLngAltitude | null): boolean;
/**
- * @param zIndex The z-index for this InfoWindow. An InfoWindow with a
- * greater z-index will be displayed in front of all other InfoWindows
- * with a lower z-index.
+ * Converts to a plain object.
*/
- setZIndex(zIndex: number): void;
+ toJSON(key?: string): google.maps.LatLngAltitudeLiteral;
}
/**
- * Options for opening an InfoWindow
+ * 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 InfoWindowOpenOptions {
+ export interface Orientation3DLiteral {
/**
- * 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).
+ * 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.
*/
- anchor?:
- | google.maps.MVCObject
- | null
- | google.maps.marker.AdvancedMarkerElement;
+ heading?: number | null;
/**
- * The map or panorama on which to render this InfoWindow.
+ * Rotation about the y-axis. A positive rotation is clockwise around the y-axis and specified in degrees from 0 to 360.
*/
- map?: google.maps.Map | null | google.maps.StreetViewPanorama;
+ roll?: number | null;
/**
- * 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.
+ * Rotation about the x-axis. A positive rotation is clockwise around the x-axis and specified in degrees from 0 to 360.
*/
- shouldFocus?: boolean | null;
+ tilt?: number | null;
}
/**
- * InfoWindowOptions object used to define the properties that can be set on a
- * InfoWindow.
+ * 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.
*/
- export interface InfoWindowOptions {
+ export class Orientation3D implements google.maps.Orientation3DLiteral {
/**
- * AriaLabel to assign to the InfoWindow.
+ *
+ * @param value The initializing value.
*/
- ariaLabel?: string | null;
+ constructor(value: google.maps.Orientation3D | google.maps.Orientation3DLiteral);
/**
- * 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.
+ * 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
*/
- content?: string | Element | Text | null;
+ get heading(): number;
/**
- * Disable panning the map to make the InfoWindow fully visible when it
- * opens.
- * @defaultValue false
+ * 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
*/
- disableAutoPan?: boolean | null;
+ get roll(): number;
/**
- * 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.
+ * 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
*/
- headerContent?: string | Element | Text | null;
+ get tilt(): number;
/**
- * 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.
+ * Comparison function.
*/
- headerDisabled?: boolean | null;
+ equals(other: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null): boolean;
/**
- * 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().
+ * Converts to a plain object.
*/
- maxWidth?: number | null;
+ 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 {
/**
- * 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().
+ * A point on a two-dimensional plane.
+ * @param x
+ * @param y
*/
- minWidth?: number | null;
+ constructor(x: number, y: number);
/**
- * 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.
+ * The X coordinate
*/
- pixelOffset?: google.maps.Size | null;
+ x: number;
/**
- * The LatLng at which to display this InfoWindow. If the InfoWindow is
- * opened with an anchor, the anchor's position will be used instead.
+ * The Y coordinate
*/
- position?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ y: number;
/**
- * 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.
+ * Compares two Points
*/
- zIndex?: number | null;
- }
- export interface JourneySharingLibrary {
- AutomaticViewportMode: typeof google.maps.journeySharing.AutomaticViewportMode;
- DeliveryVehicleStopState: typeof google.maps.journeySharing.DeliveryVehicleStopState;
- 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;
+ equals(other: google.maps.Point | null): boolean;
+ /**
+ * Returns a string representation of this Point.
+ */
+ toString(): string;
}
/**
- * Contains details of the author of a KML document or feature.
+ * Access by calling `const {Size} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface KmlAuthor {
- /**
- * The author's e-mail address, or an empty string if not specified.
- */
- email: string;
+ export class Size {
/**
- * The author's name, or an empty string if not specified.
+ * 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
*/
- name: string;
+ constructor(width: number, height: number, widthUnit?: string, heightUnit?: string);
/**
- * The author's home page, or an empty string if not specified.
+ * The height along the y-axis, in pixels.
*/
- 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 {
+ height: number;
/**
- * The feature's <atom:author>, extracted from the
- * layer markup (if specified).
+ * The width along the x-axis, in pixels.
*/
- author: google.maps.KmlAuthor | null;
+ width: number;
/**
- * The feature's <description>, extracted from the
- * layer markup.
+ * Compares two Sizes.
*/
- description: string;
+ equals(other: google.maps.Size | null): boolean;
/**
- * The feature's <id>, extracted from the layer
- * markup. If no <id> has been specified, a unique ID
- * will be generated for this feature.
+ * Returns a string representation of this Size.
*/
- id: string;
+ 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 {
/**
- * The feature's balloon styled text, if set.
+ * X-component of the three-dimensional vector.
*/
- infoWindowHtml: string;
+ x: number;
/**
- * The feature's <name>, extracted from the layer
- * markup.
+ * Y-component of the three-dimensional vector.
*/
- name: string;
+ y: number;
/**
- * The feature's <Snippet>, extracted from the layer
- * markup.
+ * Z-component of the three-dimensional vector.
*/
- snippet: string;
+ z: number;
}
/**
- * A KmlLayer adds geographic markup to the map from a KML, KMZ
- * or GeoRSS file that is hosted on a publicly accessible web server. A
- * KmlFeatureData object is provided for each feature when
- * clicked.
- *
- * Access by calling `const {KmlLayer} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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.
*/
- export class KmlLayer extends google.maps.MVCObject {
- /**
- * A KmlLayer adds geographic markup to the map from a KML, KMZ
- * or GeoRSS file that is hosted on a publicly accessible web server. A
- * KmlFeatureData object is provided for each feature when
- * clicked.
- *
- * Access by calling `const {KmlLayer} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param opts Options for this layer.
- */
- constructor(opts?: google.maps.KmlLayerOptions | null);
+ export class Vector3D implements google.maps.Vector3DLiteral {
/**
- * Get the default viewport for the layer being displayed.
+ *
+ * @param value The initializing value.
*/
- getDefaultViewport(): google.maps.LatLngBounds | null;
+ constructor(value: google.maps.Vector3D | google.maps.Vector3DLiteral);
/**
- * Get the map on which the KML Layer is being rendered.
+ * X-component of the three-dimensional vector.
*/
- getMap(): google.maps.Map | null;
+ get x(): number;
/**
- * Get the metadata associated with this layer, as specified in the layer
- * markup.
+ * Y-component of the three-dimensional vector.
*/
- getMetadata(): google.maps.KmlLayerMetadata | null;
+ get y(): number;
/**
- * Get the status of the layer, set once the requested document has loaded.
+ * Z-component of the three-dimensional vector.
*/
- getStatus(): google.maps.KmlLayerStatus;
+ get z(): number;
/**
- * Gets the URL of the KML file being displayed.
+ * Comparison function.
*/
- getUrl(): string;
+ equals(other: google.maps.Vector3D | google.maps.Vector3DLiteral | null): boolean;
/**
- * Gets the z-index of the KML Layer.
+ * Converts to a plain object.
*/
- getZIndex(): number;
+ 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 {
/**
- * Renders the KML Layer on the specified map. If map is set to
- * null, the layer is removed.
+ * 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.
*/
- setMap(map: google.maps.Map | null): void;
- setOptions(options: google.maps.KmlLayerOptions | null): void;
+ OPTIONAL_AND_HIDES_LOWER_PRIORITY = 'OPTIONAL_AND_HIDES_LOWER_PRIORITY',
/**
- * Sets the URL of the KML file to display.
+ * Always display the marker regardless of collision. This is the default behavior.
*/
- setUrl(url: string): void;
+ REQUIRED = 'REQUIRED',
/**
- * Sets the z-index of the KML Layer.
- * @param zIndex The z-index to set.
+ * Always display the marker regardless of collision, and hide any OPTIONAL_AND_HIDES_LOWER_PRIORITY markers or labels that would overlap with the marker.
*/
- setZIndex(zIndex: number): void;
+ REQUIRED_AND_HIDES_OPTIONAL = 'REQUIRED_AND_HIDES_OPTIONAL',
}
+ export type CollisionBehaviorString = `${google.maps.CollisionBehavior}`;
/**
- * Metadata for a single KML layer, in JSON format.
+ * 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 KmlLayerMetadata {
+ export enum SymbolPath {
/**
- * The layer's <atom:author>, extracted from the
- * layer markup.
+ * A backward-pointing closed arrow.
*/
- author: google.maps.KmlAuthor | null;
+ BACKWARD_CLOSED_ARROW = 3,
/**
- * The layer's <description>, extracted from the
- * layer markup.
+ * A backward-pointing open arrow.
*/
- description: string;
+ BACKWARD_OPEN_ARROW = 4,
/**
- * Whether the layer has any screen overlays.
+ * A circle.
*/
- hasScreenOverlays: boolean;
+ CIRCLE = 0,
/**
- * The layer's <name>, extracted from the layer
- * markup.
+ * A forward-pointing closed arrow.
*/
- name: string;
+ FORWARD_CLOSED_ARROW = 1,
/**
- * The layer's <Snippet>, extracted from the layer
- * markup
+ * A forward-pointing open arrow.
*/
- snippet: string;
+ FORWARD_OPEN_ARROW = 2,
}
/**
- * This object defines the properties that can be set on a
- * KmlLayer object.
+ * 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 KmlLayerOptions {
+ export class Marker extends google.maps.MVCObject {
/**
- * If true, the layer receives mouse events.
- * @defaultValue true
+ * 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
*/
- clickable?: boolean | null;
+ constructor(opts?: google.maps.MarkerOptions);
/**
- * The map on which to display the layer.
+ * Get the currently running animation.
*/
- map?: google.maps.Map | null;
+ getAnimation(): google.maps.Animation | null | undefined;
/**
- * 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
+ * Get the clickable status of the {@link google.maps.Marker}.
*/
- preserveViewport?: boolean | null;
+ getClickable(): boolean;
/**
- * Whether to render the screen overlays.
- * @defaultValue true
+ * Get the mouse cursor type shown on hover.
*/
- screenOverlays?: boolean | null;
+ getCursor(): string | null | undefined;
/**
- * Suppress the rendering of info windows when layer features are clicked.
+ * Get the draggable status of the {@link google.maps.Marker}.
*/
- suppressInfoWindows?: boolean | null;
+ getDraggable(): boolean;
/**
- * The URL of the KML document to display.
+ * Get the icon of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.icon}.
*/
- url?: string | null;
+ getIcon(): string | google.maps.Icon | google.maps.Symbol | null | undefined;
/**
- * The z-index of the layer.
+ * Get the label of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.label}.
*/
- 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 {
+ getLabel(): google.maps.MarkerLabel | string | null | undefined;
/**
- * The document could not be found. Most likely it is an invalid URL, or the
- * document is not publicly available.
+ * Get the map or panaroama the {@link google.maps.Marker} is rendered on.
*/
- DOCUMENT_NOT_FOUND = 'DOCUMENT_NOT_FOUND',
+ getMap(): google.maps.Map | google.maps.StreetViewPanorama | null;
/**
- * The document exceeds the file size limits of KmlLayer.
+ * Get the opacity of the {@link google.maps.Marker}.
*/
- DOCUMENT_TOO_LARGE = 'DOCUMENT_TOO_LARGE',
+ getOpacity(): number | null | undefined;
/**
- * The document could not be fetched.
+ * Get the position of the {@link google.maps.Marker}.
*/
- FETCH_ERROR = 'FETCH_ERROR',
+ getPosition(): google.maps.LatLng | null | undefined;
/**
- * The document is not a valid KML, KMZ or GeoRSS document.
+ * Get the shape of the {@link google.maps.Marker} used for interaction. See {@link google.maps.MarkerOptions.shape} and {@link google.maps.MarkerShape}.
*/
- INVALID_DOCUMENT = 'INVALID_DOCUMENT',
+ getShape(): google.maps.MarkerShape | null | undefined;
/**
- * The KmlLayer is invalid.
+ * Get the title of the {@link google.maps.Marker} tooltip. See {@link google.maps.MarkerOptions.title}.
*/
- INVALID_REQUEST = 'INVALID_REQUEST',
+ getTitle(): string | null | undefined;
/**
- * The document exceeds the feature limits of KmlLayer.
+ * Get the visibility of the {@link google.maps.Marker}.
*/
- LIMITS_EXCEEDED = 'LIMITS_EXCEEDED',
+ getVisible(): boolean;
/**
- * The layer loaded successfully.
+ * Get the zIndex of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.zIndex}.
*/
- OK = 'OK',
+ getZIndex(): number | null | undefined;
/**
- * The document could not be loaded within a reasonable amount of time.
+ * 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.
*/
- TIMED_OUT = 'TIMED_OUT',
+ setAnimation(animation?: google.maps.Animation | null): void;
/**
- * The document failed to load for an unknown reason.
+ * Set if the {@link google.maps.Marker} is clickable.
*/
- UNKNOWN = 'UNKNOWN',
- }
- /**
- * The properties of a click event on a KML/KMZ or GeoRSS document.
- */
- export interface KmlMouseEvent {
+ setClickable(flag: boolean): void;
/**
- * A KmlFeatureData object, containing information about the
- * clicked feature.
+ * Set the mouse cursor type shown on hover.
*/
- featureData: google.maps.KmlFeatureData | null;
+ setCursor(cursor?: string | null): void;
/**
- * The position at which to anchor an infowindow on the clicked feature.
+ * Set if the {@link google.maps.Marker} is draggable.
*/
- latLng: google.maps.LatLng | null;
+ setDraggable(flag: boolean | null): void;
/**
- * The offset to apply to an infowindow anchored on the clicked feature.
+ * Set the icon for the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.icon}.
*/
- pixelOffset: google.maps.Size | null;
- }
- /**
- * 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 {
+ setIcon(icon?: string | google.maps.Icon | google.maps.Symbol | null): void;
/**
- * The name for the landmark.
+ * Set the label for the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.label}.
*/
- display_name: string;
+ setLabel(label?: string | google.maps.MarkerLabel | null): void;
/**
- * The language of the name for the landmark.
+ * Renders the {@link google.maps.Marker} on the specified map or panorama. If map is set to null, the marker will be removed.
*/
- display_name_language_code: string;
+ setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void;
/**
- * 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.
+ * Set the opacity of the {@link google.maps.Marker}.
*/
- place_id: string;
+ setOpacity(opacity?: number | null): void;
+ /**
+ * Set the options for the {@link google.maps.Marker}.
+ */
+ setOptions(options: google.maps.MarkerOptions | null): void;
/**
- * Defines the spatial relationship between the target location and the
- * landmark.
+ * Set the postition for the {@link google.maps.Marker}.
*/
- spatial_relationship: google.maps.SpatialRelationship;
+ setPosition(latlng?: google.maps.LatLng | google.maps.LatLngLiteral | null): void;
/**
- * The straight line distance between the target location and the landmark.
+ * Set the shape of the {@link google.maps.Marker} used for interaction. See {@link google.maps.MarkerOptions.shape} and {@link google.maps.MarkerShape}.
*/
- straight_line_distance_meters: number;
+ setShape(shape?: google.maps.MarkerShape | null): void;
/**
- * 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.
+ * Set the title of the {@link google.maps.Marker} tooltip. See {@link google.maps.MarkerOptions.title}.
*/
- travel_distance_meters?: number;
+ setTitle(title?: string | null): void;
/**
- * One or more values indicating the type of the returned result. Please see
- * Types
- * for more detail.
+ * Set if the {@link google.maps.Marker} is visible.
*/
- types: string[];
+ setVisible(visible: boolean): void;
+ /**
+ * Set the zIndex of the {@link google.maps.Marker}. See {@link google.maps.MarkerOptions.zIndex}.
+ */
+ setZIndex(zIndex?: number | null): void;
+ /**
+ * 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.
+ */
+ static readonly MAX_ZINDEX: 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.
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});
- * LatLng objects. If a LatLng instance is
- * passed to the constructor, a copy is created. new google.maps.LatLng(-34, 151);
- *
- * Access by calling `const {LatLng} = 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 LatLng {
+ export class InfoWindow extends google.maps.MVCObject {
/**
- * A
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);
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.
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}); LatLng
- * objects. If a LatLng instance is passed to the constructor,
- * a copy is created. new google.maps.LatLng(-34, 151);
- *
- * Access by calling `const {LatLng} = await
- * google.maps.importLibrary("core")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- constructor(
- latOrLatLngOrLatLngLiteral:
- | number
- | google.maps.LatLngLiteral
- | google.maps.LatLng,
- lngOrNoClampNoWrap?: number | boolean | null,
- noClampNoWrap?: boolean,
- );
+ * 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
+ */
+ constructor(opts?: google.maps.InfoWindowOptions | null);
/**
- * Comparison function.
+ * Checks if the InfoWindow is open.
*/
- equals(other: google.maps.LatLng | null): boolean;
+ get isOpen(): boolean;
/**
- * Returns the latitude in degrees.
+ * Closes this InfoWindow by removing it from the DOM structure.
*/
- lat(): number;
+ close(): void;
/**
- * Returns the longitude in degrees.
+ * Sets focus on this
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);
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.
*/
- lng(): number;
+ 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 JSON representation. This function is intended to be used via
- * JSON.stringify.
+ * 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(): google.maps.LatLngLiteral;
+ 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;
+ }
+ /**
+ * Options for opening an InfoWindow
+ */
+ export interface InfoWindowOpenOptions {
/**
- * Converts to string representation.
+ * 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).
*/
- toString(): string;
+ anchor?: google.maps.MVCObject | google.maps.marker.AdvancedMarkerElement | null;
+ /**
+ * The map or panorama on which to render this InfoWindow.
+ */
+ map?: google.maps.Map | google.maps.StreetViewPanorama | null;
/**
- * Returns a string of the form "lat,lng" for this LatLng. We
- * round the lat/lng values to 6 decimal places by default.
+ * 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.
*/
- toUrlValue(precision?: number): string;
+ shouldFocus?: boolean | null;
}
/**
- * 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 LatLngAltitude
- implements google.maps.LatLngAltitudeLiteral, google.maps.LatLngLiteral
- {
- /**
- * 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.
- * @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.LatLngAltitudeLiteral
- | google.maps.LatLng
- | google.maps.LatLngLiteral,
- noClampNoWrap?: boolean,
- );
+ * 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 class GroundOverlay extends google.maps.MVCObject {
/**
- * Returns the altitude.
+ * 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
*/
- altitude: number;
+ constructor(url: string, bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null, opts?: google.maps.GroundOverlayOptions | null);
/**
- * Comparison function.
- * @param other Another LatLngAltitude object.
+ * Gets the LatLngBounds of this overlay.
*/
- equals(other: google.maps.LatLngAltitude | null): boolean;
+ getBounds(): google.maps.LatLngBounds | null;
/**
- * Returns the latitude.
+ * Returns the map on which this ground overlay is displayed.
*/
- lat: number;
+ getMap(): google.maps.Map | null;
/**
- * Returns the longitude.
+ * Returns the opacity of this ground overlay.
*/
- lng: number;
- toJSON(): google.maps.LatLngAltitudeLiteral;
- }
- /**
- * 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 LatLngAltitudeLiteral extends google.maps.LatLngLiteral {
+ getOpacity(): number;
/**
- * Distance (in meters) above the ground surface. Negative value means
- * underneath the ground surface.
- * @defaultValue 0
+ * Gets the url of the projected image.
*/
- altitude: number;
+ getUrl(): string;
/**
- * 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.
+ * Renders the ground overlay on the specified map. If map is set to null, the overlay is removed.
*/
- lat: number;
+ setMap(map: google.maps.Map | null): 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.
+ * Sets the opacity of this ground overlay.
*/
- lng: number;
+ setOpacity(opacity: 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.
+ * A KmlLayer adds geographic markup to the map from a KML, KMZ or GeoRSS file that is hosted on a publicly accessible web server. A KmlFeatureData object is provided for each feature when clicked.
+ * Access by calling `const {KmlLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class LatLngBounds {
+ export class KmlLayer extends google.maps.MVCObject {
/**
- * 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.
- */
- constructor(
- swOrLatLngBounds?:
- | google.maps.LatLng
- | null
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral,
- ne?: google.maps.LatLng | null | google.maps.LatLngLiteral,
- );
+ * 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(opts?: google.maps.KmlLayerOptions | null);
/**
- * Returns true if the given lat/lng is in this bounds.
+ * Get the default viewport for the layer being displayed.
*/
- contains(latLng: google.maps.LatLng | google.maps.LatLngLiteral): boolean;
+ getDefaultViewport(): google.maps.LatLngBounds | null;
/**
- * Returns true if this bounds approximately equals the given
- * bounds.
+ * Get the map on which the KML Layer is being rendered.
*/
- equals(
- other: google.maps.LatLngBounds | null | google.maps.LatLngBoundsLiteral,
- ): boolean;
+ getMap(): google.maps.Map | null;
/**
- * Extends this bounds to contain the given point.
+ * Get the metadata associated with this layer, as specified in the layer markup.
*/
- extend(
- point: google.maps.LatLng | google.maps.LatLngLiteral,
- ): google.maps.LatLngBounds;
+ getMetadata(): google.maps.KmlLayerMetadata | null;
/**
- * Computes the center of this LatLngBounds
+ * Get the status of the layer, set once the requested document has loaded.
*/
- getCenter(): google.maps.LatLng;
+ getStatus(): google.maps.KmlLayerStatusString | null;
/**
- * Returns the north-east corner of this bounds.
+ * Gets the URL of the KML file being displayed.
*/
- getNorthEast(): google.maps.LatLng;
+ getUrl(): string;
/**
- * Returns the south-west corner of this bounds.
+ * Gets the z-index of the KML Layer.
*/
- getSouthWest(): google.maps.LatLng;
+ getZIndex(): number;
/**
- * Returns true if this bounds shares any points with the other
- * bounds.
+ * Renders the KML Layer on the specified map. If map is set to null, the layer is removed.
*/
- intersects(
- other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral,
- ): boolean;
+ setMap(map: google.maps.Map | null): void;
+
+ setOptions(options: google.maps.KmlLayerOptions | null): void;
/**
- * Returns if the bounds are empty.
+ * Sets the URL of the KML file to display.
*/
- isEmpty(): boolean;
+ setUrl(url: string): void;
/**
- * Converts to JSON representation. This function is intended to be used via
- * JSON.stringify.
+ * Sets the z-index of the KML Layer.
*/
- toJSON(): google.maps.LatLngBoundsLiteral;
+ setZIndex(zIndex: number): void;
+ }
+ /**
+ * 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 {
/**
- * Converts the given map bounds to a lat/lng span.
+ * The document could not be found. Most likely it is an invalid URL, or the document is not publicly available.
*/
- toSpan(): google.maps.LatLng;
+ DOCUMENT_NOT_FOUND = 'DOCUMENT_NOT_FOUND',
/**
- * Converts to string.
+ * The document exceeds the file size limits of KmlLayer.
*/
- toString(): string;
+ DOCUMENT_TOO_LARGE = 'DOCUMENT_TOO_LARGE',
/**
- * 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.
+ * The document could not be fetched.
*/
- toUrlValue(precision?: number): string;
+ FETCH_ERROR = 'FETCH_ERROR',
/**
- * Extends this bounds to contain the union of this and the given bounds.
+ * The document is not a valid KML, KMZ or GeoRSS document.
*/
- union(
- other: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral,
- ): google.maps.LatLngBounds;
+ INVALID_DOCUMENT = 'INVALID_DOCUMENT',
/**
- * LatLngBounds for the max bounds of the Earth. These bounds will encompass
- * the entire globe.
+ * The KmlLayer is invalid.
*/
- static readonly MAX_BOUNDS: google.maps.LatLngBounds;
- }
- /**
- * 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 interface LatLngBoundsLiteral {
+ INVALID_REQUEST = 'INVALID_REQUEST',
/**
- * 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.
+ * The document exceeds the feature limits of KmlLayer.
*/
- east: number;
+ LIMITS_EXCEEDED = 'LIMITS_EXCEEDED',
/**
- * 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.
+ * The layer loaded successfully.
*/
- north: number;
+ OK = 'OK',
/**
- * 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.
+ * The document could not be loaded within a reasonable amount of time.
*/
- south: number;
+ TIMED_OUT = 'TIMED_OUT',
/**
- * 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.
+ * The document failed to load for an unknown reason.
*/
- west: number;
+ UNKNOWN = 'UNKNOWN',
}
+ export type KmlLayerStatusString = `${google.maps.KmlLayerStatus}`;
/**
- * 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.
- * map.setCenter({lat: -34, lng: 151});
new
- * google.maps.Marker({position: {lat: -34, lng: 151}, map: map}); ElevationService containing
- * the list of discrete coordinates (LatLngs) for which to return
- * elevation data.
- */
- export interface LocationElevationRequest {
+ getMap(): google.maps.Map | null;
/**
- * The discrete locations for which to retrieve elevations.
+ * Renders the layer on the specified map. If map is set to null, the layer will be removed.
*/
- locations?: (google.maps.LatLng | google.maps.LatLngLiteral)[] | null;
+ setMap(map: google.maps.Map | null): void;
}
/**
- * 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}.
+ * A traffic layer.
+ * Access by calling `const {TrafficLayer} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface LocationElevationResponse {
+ export class TrafficLayer extends google.maps.MVCObject {
/**
- * The list of {@link google.maps.ElevationResult}s matching the locations
- * of the {@link google.maps.LocationElevationRequest}.
+ * A layer that displays current road traffic.
+ * @param opts
*/
- results: google.maps.ElevationResult[];
- }
- /**
- * Access by calling `const {MVCArray} = await
- * google.maps.importLibrary("core")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class MVCArraynull, the layer will be removed.
+ */
+ setMap(map: google.maps.Map | null): void;
+
+ setOptions(options: google.maps.TrafficLayerOptions | null): void;
+ }
+ /**
+ * 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 {
+ /**
+ * A layer that displays transit lines.
+ */
+ constructor();
+ /**
+ * Returns the map on which this layer is displayed.
+ */
+ 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;
+ }
+ /**
+ * Access by calling `const {MVCArray} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class MVCArray< T = any > extends google.maps.MVCObject {
+ /**
+ * A mutable MVC Array.
+ * @param array
+ */
+ constructor(array?: T[] | null);
+ /**
+ * Removes all elements from the array.
*/
clear(): void;
/**
- * Iterate over each element, calling the provided callback. The callback is
- * called for each element like: callback(element, index).
+ * Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index).
*/
- forEach(callback: (a: T, b: number) => void): void;
+ forEach(callback: (arg0: T, arg1: number) => void): void;
/**
- * Returns a reference to the underlying Array. Warning: if the Array is
- * mutated, no events will be fired by this object.
+ * Returns a reference to the underlying Array. Warning: if the Array is mutated, no events will be fired by this object.
*/
getArray(): T[];
/**
@@ -3509,8 +2465,7 @@ declare namespace google.maps {
*/
pop(): T;
/**
- * Adds one element to the end of the array and returns the new length of
- * the array.
+ * Adds one element to the end of the array and returns the new length of the array.
*/
push(elem: T): number;
/**
@@ -3523,571 +2478,519 @@ declare namespace google.maps {
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.
+ * 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 MVCObject {
+ export class Circle extends google.maps.MVCObject {
/**
- * 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.
+ * Create a circle using the passed {@link google.maps.CircleOptions}, which specify the center, radius, and style.
+ * @param circleOrCircleOptions
*/
- addListener(
- eventName: string,
- handler: Function,
- ): google.maps.MapsEventListener;
+ constructor(circleOrCircleOptions?: google.maps.Circle | google.maps.CircleLiteral | google.maps.CircleOptions | null);
/**
- * Binds a View to a Model.
+ * Gets the LatLngBounds of this Circle.
*/
- bindTo(
- key: string,
- target: google.maps.MVCObject,
- targetKey?: string | null,
- noNotify?: boolean,
- ): void;
+ getBounds(): google.maps.LatLngBounds | null;
/**
- * Gets a value.
+ * Returns the center of this circle.
*/
- get(key: string): any;
+ getCenter(): google.maps.LatLng | null;
/**
- * 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.
+ * Returns whether this circle can be dragged by the user.
*/
- notify(key: string): void;
+ getDraggable(): boolean;
/**
- * Sets a value.
+ * Returns whether this circle can be edited by the user.
*/
- set(key: string, value: unknown): void;
+ getEditable(): boolean;
/**
- * Sets a collection of key-value pairs.
+ * Returns the map on which this circle is displayed.
*/
- setValues(values?: object | null): void;
+ getMap(): google.maps.Map | null;
/**
- * 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.
+ * Returns the radius of this circle (in meters).
*/
- unbind(key: string): void;
+ getRadius(): number;
/**
- * Removes all bindings.
+ * Returns whether this circle is visible on the map.
*/
- unbindAll(): void;
- }
- /**
- * 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 {
+ getVisible(): boolean;
/**
- * Access by calling `const {Map} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param mapDiv The map will render to fill this element.
- * @param opts Options
+ * Sets the center of this circle.
*/
- constructor(mapDiv: HTMLElement, opts?: google.maps.MapOptions);
+ setCenter(center: google.maps.LatLng | google.maps.LatLngLiteral | null): void;
/**
- * 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.
+ * If set to true, the user can drag this circle over the map.
*/
- controls: google.maps.MVCArrayData, bound to the map. Add features to this
- * Data object to conveniently display them on this map.
+ * 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.
*/
- data: google.maps.Data;
+ setEditable(editable: boolean): void;
/**
- * 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.
- * @param bounds Bounds to show.
- * @param padding Padding in pixels. The bounds will be fit in the part of
- * the map that remains after padding is removed. A number value will
- * yield the same padding on all 4 sides. Supply 0 here to make a
- * fitBounds idempotent on the result of getBounds.
- */
- fitBounds(
- bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral,
- padding?: number | google.maps.Padding,
- ): void;
- /**
- * 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.
+ * Renders the circle on the specified map. If map is set to null, the circle will be removed.
*/
- getBounds(): google.maps.LatLngBounds | undefined;
+ setMap(map: google.maps.Map | null): void;
+
+ setOptions(options: google.maps.CircleOptions | null): void;
/**
- * 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.
+ * Sets the radius of this circle (in meters).
*/
- getCenter(): google.maps.LatLng | undefined;
+ setRadius(radius: number): void;
/**
- * 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.
+ * Hides this circle if set to false.
*/
- getClickableIcons(): boolean | undefined;
+ setVisible(visible: boolean): void;
+ }
+ /**
+ * MapElementOptions object used to define the properties that can be set on a MapElement.
+ */
+ export interface MapElementOptions {
/**
- * 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.
+ * See {@link google.maps.MapElement.center}.
*/
- getDatasetFeatureLayer(datasetId: string): google.maps.FeatureLayer;
- getDiv(): HTMLElement;
+ center?: google.maps.LatLng | google.maps.LatLngLiteral | null;
/**
- * 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.
+ * See {@link google.maps.MapElement.headingInteractionDisabled}.
*/
- getFeatureLayer(
- featureType: google.maps.FeatureType,
- ): google.maps.FeatureLayer;
+ headingInteractionDisabled?: boolean | null;
/**
- * 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.
+ * See {@link google.maps.MapElement.internalUsageAttributionIds}.
*/
- getHeading(): number | undefined;
+ internalUsageAttributionIds?: IterableProjection. 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.
+ * See {@link google.maps.MapElement.tiltInteractionDisabled}.
*/
- getProjection(): google.maps.Projection | undefined;
+ tiltInteractionDisabled?: boolean | null;
/**
- * Returns the current RenderingType of the map.
+ * See {@link google.maps.MapElement.zoom}.
*/
- getRenderingType(): google.maps.RenderingType;
+ zoom?: number | null;
+ }
+ /**
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * Used for setting the map's camera options.
+ */
+ export interface CameraOptions {
+
+ center?: google.maps.LatLngLiteral | google.maps.LatLng;
+
+ heading?: number;
+
+ tilt?: number;
+
+ zoom?: 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.
+ */
+ export interface MapCapabilities {
/**
- * 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.
+ * If true, this map is configured properly to allow for the use of advanced markers. Note that you must still import the marker library in order to use advanced markers. See https://goo.gle/gmp-isAdvancedMarkersAvailable for more information.
*/
- getStreetView(): google.maps.StreetViewPanorama;
+ isAdvancedMarkersAvailable?: boolean;
/**
- * 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.
+ * If true, this map is configured properly to allow for the use of data-driven styling for at least one FeatureLayer. See https://goo.gle/gmp-data-driven-styling and https://goo.gle/gmp-FeatureLayerIsAvailable for more information.
*/
- getTilt(): number | undefined;
+ isDataDrivenStylingAvailable?: boolean;
/**
- * 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).
+ * If true, this map is configured properly to allow for the use of {@link google.maps.WebGLOverlayView}.
*/
- getTiltInteractionEnabled(): boolean | null;
+ 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.
+ */
+ export enum FeatureType {
/**
- * Returns the zoom of the map. If the zoom has not been set then the result
- * is undefined.
+ * Indicates a first-order civil entity below the country level.
*/
- getZoom(): number | undefined;
+ ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',
/**
- * A registry of MapType instances by string ID.
+ * Indicates a second-order civil entity below the country level.
*/
- mapTypes: google.maps.MapTypeRegistry;
+ ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',
/**
- * Immediately sets the map's camera to the target camera options,
- * without animation.
+ * Indicates the national political entity.
*/
- moveCamera(cameraOptions: google.maps.CameraOptions): void;
+ COUNTRY = 'COUNTRY',
/**
- * 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).
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * Indicates a third-party dataset.
*/
- overlayMapTypes: google.maps.MVCArrayLatLng. If the
- * change is less than both the width and height of the map, the transition
- * will be smoothly animated.
- * @param latLng The new center latitude/longitude of the map.
+ * Indicates a postal code as used to address postal mail within the country. Includes zip codes.
*/
- panTo(latLng: google.maps.LatLng | google.maps.LatLngLiteral): void;
+ POSTAL_CODE = 'POSTAL_CODE',
/**
- * 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.
- * @param latLngBounds The bounds to pan the map to.
- * @param padding Padding in pixels. A number value will yield the same
- * padding on all 4 sides. The default value is 0.
- */
- panToBounds(
- latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral,
- padding?: number | google.maps.Padding,
- ): void;
- setCenter(latlng: google.maps.LatLng | google.maps.LatLngLiteral): void;
+ * Indicates a school district.
+ */
+ 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 {
/**
- * 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.
+ * FeatureType of this Feature.
*/
- setClickableIcons(value: boolean): void;
+ 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 {
/**
- * Sets the compass heading for map measured in degrees from cardinal
- * direction North. For raster maps, this method only applies to aerial
- * imagery.
+ * Key-value mapping of the feature's attributes.
*/
- setHeading(heading: number): void;
+ datasetAttributes: { [key: string]: 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).
+ * Dataset id of the dataset that this feature belongs to.
*/
- setHeadingInteractionEnabled(headingInteractionEnabled: boolean): void;
- setMapTypeId(mapTypeId: string): void;
- setOptions(options: google.maps.MapOptions | null): void;
+ datasetId: string;
+ }
+ /**
+ * 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 {
/**
- * Sets the current RenderingType of the map.
+ * 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.
*/
- setRenderingType(renderingType: google.maps.RenderingType): void;
+ datasetId?: string;
/**
- * 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.
- * @param panorama The panorama to bind to the map.
+ * The FeatureType associated with this FeatureLayer.
*/
- setStreetView(panorama: google.maps.StreetViewPanorama | null): void;
+ featureType: google.maps.FeatureTypeString;
/**
- * 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.
+ * 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.
*/
- setTilt(tilt: number): void;
+ isAvailable: boolean;
/**
- * 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).
+ * 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.
*/
- setTiltInteractionEnabled(tiltInteractionEnabled: boolean): void;
+ style?: google.maps.FeatureStyleOptions | google.maps.FeatureStyleFunction | null;
/**
- * Sets the zoom of the map.
- * @param zoom Larger zoom values correspond to a higher resolution.
+ * 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}.
*/
- setZoom(zoom: number): void;
+ addListener(eventName: string, handler: Function): google.maps.MapsEventListener;
+ }
+ /**
+ * Options passed to a FeatureStyleFunction.
+ */
+ export interface FeatureStyleFunctionOptions {
/**
- * 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).
+ * Feature passed into the FeatureStyleFunction for styling.
*/
- static readonly DEMO_MAP_ID: string;
+ feature: google.maps.Feature;
}
+
+ export type FeatureStyleFunction = (arg0: google.maps.FeatureStyleFunctionOptions) => (google.maps.FeatureStyleOptions | null | undefined);
/**
- * This object is made available to the OverlayView from within
- * the draw method. It is not guaranteed to be initialized until draw is
- * called.
+ * 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 interface MapCanvasProjection {
+ export class WebGLOverlayView extends google.maps.MVCObject {
/**
- * Computes the geographical coordinates from pixel coordinates in the
- * map's container.
+ * Creates a WebGLOverlayView.
*/
- fromContainerPixelToLatLng(
- pixel: google.maps.Point | null,
- noClampNoWrap?: boolean,
- ): google.maps.LatLng | null;
+ constructor();
+
+ getMap(): google.maps.Map | null | undefined;
/**
- * Computes the geographical coordinates from pixel coordinates in the div
- * that holds the draggable map.
+ * 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.
*/
- fromDivPixelToLatLng(
- pixel: google.maps.Point | null,
- noClampNoWrap?: boolean,
- ): google.maps.LatLng | null;
+ onAdd(): void;
/**
- * Computes the pixel coordinates of the given geographical location in the
- * map's container element.
+ * 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.
*/
- fromLatLngToContainerPixel(
- latLng: google.maps.LatLng | google.maps.LatLngLiteral,
- ): google.maps.Point | null;
+ onContextLost(): void;
/**
- * Computes the pixel coordinates of the given geographical location in the
- * DOM element that holds the draggable map.
+ * 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.
*/
- fromLatLngToDivPixel(
- latLng: google.maps.LatLng | null | google.maps.LatLngLiteral,
- ): google.maps.Point | null;
+ onContextRestored(options: google.maps.WebGLStateOptions): void;
/**
- * The visible region of the map. Returns null if the map has
- * no size. Returns null if the OverlayView is on a
- * StreetViewPanorama.
+ * 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}.
*/
- getVisibleRegion(): google.maps.VisibleRegion | null;
+ onDraw(options: google.maps.WebGLDrawOptions): void;
/**
- * 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.
+ * 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.
*/
- 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.
- */
- export interface MapCapabilities {
+ onRemove(): void;
/**
- * If true, this map is configured properly to allow for the use of advanced
- * markers. Note that you must still import the marker library
- * in order to use advanced markers. See https://goo.gle/gmp-isAdvancedMarkersAvailable
- * for more information.
+ * Implement this method to handle any GL state updates outside of the render animation frame.
*/
- isAdvancedMarkersAvailable?: boolean;
+ onStateUpdate(options: google.maps.WebGLStateOptions): void;
/**
- * If true, this map is configured properly to allow for the use of
- * data-driven styling for at least one FeatureLayer. See https://goo.gle/gmp-data-driven-styling
- * and https://goo.gle/gmp-FeatureLayerIsAvailable
- * for more information.
+ * Triggers the map to redraw a frame.
*/
- isDataDrivenStylingAvailable?: boolean;
+ requestRedraw(): void;
/**
- * If true, this map is configured properly to allow for the use of {@link
- * google.maps.WebGLOverlayView}.
+ * Triggers the map to update GL state.
*/
- isWebGLOverlayViewAvailable?: boolean;
+ requestStateUpdate(): void;
+ /**
+ * Adds the overlay to the map.
+ */
+ setMap(map?: google.maps.Map | null): void;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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
- * innerMap property.
- *
- * Access by calling `const {MapElement} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * GL state options.
*/
- export class MapElement
- extends HTMLElement
- implements google.maps.MapElementOptions
- {
+ export interface WebGLStateOptions {
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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
- * innerMap property.
- *
- * Access by calling `const {MapElement} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * The WebGLRenderingContext on which to render this WebGLOverlayView.
*/
- constructor(options?: google.maps.MapElementOptions);
+ gl: WebGLRenderingContext;
+ }
+ /**
+ * Drawing options.
+ */
+ export interface WebGLDrawOptions {
/**
- * The center latitude/longitude of the map.
+ * The WebGLRenderingContext on which to render this WebGLOverlayView.
*/
- center: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ gl: WebGLRenderingContext;
/**
- * 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
+ * The matrix transformation from camera space to latitude/longitude coordinates.
*/
- headingInteractionDisabled: boolean | null;
+ 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 {
/**
- * A reference to the {@link google.maps.Map} that the MapElement uses
- * internally.
+ * The camera heading in degrees relative to true north. True north is 0°, east is 90°, south is 180°, west is 270°.
*/
- innerMap: google.maps.Map;
+ heading: 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.
+ * The camera pitch in degrees, relative to the street view vehicle. Ranges from 90° (directly upwards) to -90° (directly downwards).
*/
- mapId: string | null;
+ 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 {
/**
- * 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}
+ * Creates a panorama with the passed StreetViewPanoramaOptions.
+ * @param container
+ * @param opts
*/
- renderingType: google.maps.RenderingType | null;
+ constructor(container: HTMLElement, opts?: google.maps.StreetViewPanoramaOptions | 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
+ * 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.
*/
- tiltInteractionDisabled: boolean | null;
+ controls: google.maps.MVCArrayStreetViewPanorama. 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.
*/
- zoom: number | null;
+ focus(): void;
+ /**
+ * Returns the set of navigation links for the Street View panorama.
+ */
+ getLinks(): (google.maps.StreetViewLink | null)[] | null;
+ /**
+ * Returns the StreetViewLocation of the current panorama.
+ */
+ getLocation(): google.maps.StreetViewLocation;
+ /**
+ * 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.
+ */
+ getMotionTracking(): boolean;
+ /**
+ * Returns the current panorama ID for the Street View panorama. This id is stable within the browser's current session only.
+ */
+ getPano(): string;
+ /**
+ * 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.
+ */
+ getPhotographerPov(): google.maps.StreetViewPov;
+ /**
+ * Returns the current LatLng position for the Street View panorama.
+ */
+ getPosition(): google.maps.LatLng | null;
+ /**
+ * Returns the current point of view for the Street View panorama.
+ */
+ getPov(): google.maps.StreetViewPov;
+ /**
+ * Returns the status of the panorama on completion of the setPosition() or setPano() request.
+ */
+ getStatus(): google.maps.StreetViewStatusString;
+ /**
+ * Returns true if the panorama is visible. It does not specify whether Street View imagery is available at the specified position.
+ */
+ getVisible(): boolean;
+ /**
+ * 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.
+ */
+ getZoom(): number;
+ /**
+ * Set the custom panorama provider called on pano change to load custom panoramas.
+ */
+ registerPanoProvider(provider: (arg0: string) => google.maps.StreetViewPanoramaData | null, opt_options?: google.maps.PanoProviderOptions): void;
+ /**
+ * Sets the set of navigation links for the Street View panorama.
+ */
+ setLinks(links: (google.maps.StreetViewLink | null)[] | null): void;
+ /**
+ * 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.
+ */
+ setMotionTracking(motionTracking: boolean): void;
+ /**
+ * Sets a collection of key-value pairs.
+ */
+ setOptions(options: google.maps.StreetViewPanoramaOptions | null): void;
+ /**
+ * Sets the current panorama ID for the Street View panorama.
+ */
+ setPano(pano: string): void;
+ /**
+ * Sets the current LatLng position for the Street View panorama.
+ */
+ setPosition(latLng: google.maps.LatLng | google.maps.LatLngLiteral | null): void;
+ /**
+ * Sets the point of view for the Street View panorama.
+ */
+ setPov(pov: google.maps.StreetViewPov): void;
+ /**
+ * 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>.
+ */
+ setVisible(flag: boolean): void;
+ /**
+ * 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.
+ */
+ setZoom(zoom: number): void;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * MapElementOptions object used to define the properties that can be set on a
- * MapElement.
+ * The display options for the Camera control.
*/
- export interface MapElementOptions {
+ export interface CameraControlOptions {
/**
- * See {@link google.maps.MapElement.center}.
+ * Position id. Used to specify the position of the control on the map.
+ * @defaultValue {@link google.maps.ControlPosition.INLINE_START_BLOCK_END}
*/
- center?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ position?: google.maps.ControlPosition | null;
+ }
+ /**
+ * Options for the rendering of the fullscreen control.
+ */
+ export interface FullscreenControlOptions {
/**
- * See {@link google.maps.MapElement.headingInteractionDisabled}.
+ * Position id. Used to specify the position of the control on the map.
+ * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_START}
*/
- headingInteractionDisabled?: boolean | null;
+ position?: google.maps.ControlPosition | null;
+ }
+ /**
+ * Options for the rendering of the rotate control.
+ */
+ export interface RotateControlOptions {
/**
- * See {@link google.maps.MapElement.mapId}.
+ * Position id. Used to specify the position of the control on the map.
+ * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
*/
- mapId?: string | null;
+ 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 {
/**
- * See {@link google.maps.MapElement.renderingType}.
+ * 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}.
*/
- renderingType?: google.maps.RenderingType | null;
+ latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
/**
- * See {@link google.maps.MapElement.tiltInteractionDisabled}.
+ * 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.
*/
- tiltInteractionDisabled?: boolean | null;
+ strictBounds?: boolean;
+ }
+ /**
+ * Options for the rendering of the map type control.
+ */
+ export interface MapTypeControlOptions {
/**
- * See {@link google.maps.MapElement.zoom}.
+ * IDs of map types to show in the control.
*/
- zoom?: number | null;
+ mapTypeIds?: (google.maps.MapTypeIdString | string)[] | null;
+ /**
+ * Position id. Used to specify the position of the control on the map.
+ * @defaultValue {@link google.maps.ControlPosition.BLOCK_START_INLINE_START}
+ */
+ position?: google.maps.ControlPosition | null;
+ /**
+ * Style id. Used to select what style of map type control to display.
+ */
+ style?: google.maps.MapTypeControlStyle | null;
}
/**
- * This object is returned from various mouse events on the map and overlays,
- * and contains all the fields shown below.
+ *
+ * Access by calling `const {RenderingType} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface MapMouseEvent {
+ export enum RenderingType {
/**
- * 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).
+ * Indicates that the map is a raster map.
*/
- domEvent: MouseEvent | TouchEvent | PointerEvent | KeyboardEvent | Event;
+ RASTER = 'RASTER',
/**
- * The latitude/longitude that was below the cursor when the event occurred.
+ * Indicates that it is unknown yet whether the map is vector or raster, because the map has not finished initializing yet.
*/
- latLng: google.maps.LatLng | null;
+ UNINITIALIZED = 'UNINITIALIZED',
/**
- * Prevents this event from propagating further.
+ * Indicates that the map is a vector map.
*/
- stop(): void;
+ VECTOR = 'VECTOR',
+ }
+ export type RenderingTypeString = `${google.maps.RenderingType}`;
+ /**
+ * Options for the rendering of the scale control.
+ */
+ export interface ScaleControlOptions {
+ /**
+ * Style id. Used to select what style of scale control to display.
+ */
+ style?: google.maps.ScaleControlStyle | null;
+ }
+ /**
+ * Options for the rendering of the Street View pegman control on the map.
+ */
+ 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;
+ /**
+ * 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}]
+ */
+ sources?: Iterablefalse, map icons are not clickable. A map icon
- * represents a point of interest, also known as a POI.
+ * When false, map icons are not clickable. A map icon represents a point of interest, also known as a POI.
* @defaultValue true
*/
clickableIcons?: boolean | null;
/**
- * The initial Map color scheme. This option can only be set when the map is
- * initialized.
+ * The initial Map color scheme. This option can only be set when the map is initialized.
* @defaultValue {@link google.maps.ColorScheme.LIGHT}
*/
- colorScheme?: string | null;
+ colorScheme?: google.maps.ColorSchemeString | string | null;
/**
- * 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.
+ * 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.
*/
controlSize?: number | null;
/**
- * 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.
+ * 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.
*/
disableDefaultUI?: boolean | null;
/**
- * Enables/disables zoom and center on double click. Enabled by default.
- * gestureHandling property, and set it to "none".
+ * Enables/disables zoom and center on double click. Enabled by default. gestureHandling property, and set it to "none".
*/
disableDoubleClickZoom?: boolean | null;
/**
- * If false, prevents the map from being dragged. 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 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;'.
+ * 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;'.
*/
draggableCursor?: string | null;
/**
- * 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;'.
+ * 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;'.
*/
draggingCursor?: string | null;
/**
@@ -4173,52 +3044,34 @@ declare namespace google.maps {
*/
fullscreenControlOptions?: google.maps.FullscreenControlOptions | null;
/**
- * This setting controls how the API handles gestures on the map. Allowed
- * values:
+ * 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.
- *
*/
gestureHandling?: string | null;
/**
- * 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.
+ * 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.
*/
heading?: number | 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).
+ * 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 "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. false
*/
headingInteractionEnabled?: boolean | null;
/**
- * 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
+ * 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
+ */
+ internalUsageAttributionIds?: Iterableisfractionalzoomenabled_changed to know when the default has been set.
+ * @defaultValue true for vector maps and false for raster maps
*/
isFractionalZoomEnabled?: boolean | null;
/**
- * If false, prevents the map from being controlled by the
- * keyboard. Keyboard shortcuts are enabled by default.
+ * If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are enabled by default.
*/
keyboardShortcuts?: boolean | 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.
+ * 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.
*/
mapId?: string | null;
/**
@@ -4232,23 +3085,13 @@ declare namespace google.maps {
/**
* The initial Map mapTypeId. Defaults to ROADMAP.
*/
- mapTypeId?: string | null;
+ mapTypeId?: google.maps.MapTypeIdString | string | null;
/**
- * 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.
+ * 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.
*/
maxZoom?: number | null;
/**
- * 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.
+ * 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.
*/
minZoom?: number | null;
/**
@@ -4256,29 +3099,12 @@ declare namespace google.maps {
*/
noClear?: boolean | null;
/**
- * The enabled/disabled state of the Pan control. false, disables zooming on the map using a mouse scroll
- * wheel. The scrollwheel is enabled by default. gestureHandling property,
- * and set it to either "cooperative" or "none".
+ * If false, disables zooming on the map using a mouse scroll wheel. The scrollwheel is enabled by default. gestureHandling property, and set it to either "cooperative" or "none".
*/
scrollwheel?: boolean | 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.
+ * 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.
*/
streetView?: google.maps.StreetViewPanorama | 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).
+ * 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).
*/
streetViewControl?: boolean | null;
/**
@@ -4324,45 +3140,20 @@ declare namespace google.maps {
*/
streetViewControlOptions?: google.maps.StreetViewControlOptions | 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).
+ * 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).
*/
styles?: google.maps.MapTypeStyle[] | 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.
+ * 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.
*/
tilt?: number | 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).
+ * 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
*/
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.
+ * 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;
/**
@@ -4373,12046 +3164,12975 @@ declare namespace google.maps {
* The display options for the Zoom control.
*/
zoomControlOptions?: google.maps.ZoomControlOptions | null;
- }
- export interface MapPanes {
/**
- * This pane contains the info window. It is above all map overlays. (Pane
- * 4).
+ * 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".
*/
- floatPane: Element;
+ draggable?: boolean | null;
/**
- * This pane is the lowest pane and is above the tiles. It does not receive
- * DOM events. (Pane 0).
+ * The enabled/disabled state of the Pan control. MapTypeRegistry holds the collection of custom map types available to the map for its use. The API consults this registry when providing the list of available map types within controls, for example.
*/
- overlayLayer: Element;
+ constructor();
/**
- * This pane contains elements that receive DOM events. (Pane 3).
+ * Sets the registry to associate the passed string identifier with the passed MapType.
*/
- overlayMouseTarget: Element;
+ set(id: string, mapType: google.maps.MapType | unknown): void;
}
/**
- * A restriction that can be applied to the Map. The map's viewport will
- * not exceed these restrictions.
+ * 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 interface MapRestriction {
- /**
- * 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}.
- */
- latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
+ export interface IconMouseEvent extends google.maps.MapMouseEvent {
/**
- * 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.
+ * 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. Feature should be modified on a map.
*/
- export interface MapType {
+ export interface FeatureStyleOptions {
/**
- * Alt text to display when this MapType's button is hovered over in the
- * MapTypeControl. Optional.
+ * Hex RGB string (like "#00FF00" for green). Only applies to polygon geometries.
*/
- alt: string | null;
+ fillColor?: string;
/**
- * 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.
- * @param tileCoord Tile coordinates.
- * @param zoom Tile zoom.
- * @param ownerDocument The document which owns this tile.
+ * The fill opacity between 0.0 and 1.0. Only applies to polygon geometries.
*/
- getTile(
- tileCoord: google.maps.Point | null,
- zoom: number,
- ownerDocument: Document | null,
- ): Element | null;
+ fillOpacity?: number;
/**
- * The maximum zoom level for the map when displaying this MapType. Required
- * for base MapTypes, ignored for overlay MapTypes.
+ * Hex RGB string (like "#00FF00" for green).
*/
- maxZoom: number;
+ strokeColor?: string;
/**
- * The minimum zoom level for the map when displaying this MapType.
- * Optional; defaults to 0.
+ * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon geometries.
*/
- minZoom: number;
+ strokeOpacity?: number;
/**
- * Name to display in the MapTypeControl. Optional.
+ * The stroke width in pixels. Only applies to line and polygon geometries.
*/
- name: string | null;
+ 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 {
/**
- * The Projection used to render this MapType. Optional; defaults to
- * Mercator.
+ * 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
*/
- projection: google.maps.Projection | null;
+ constructor(mapDiv: HTMLElement, opts?: google.maps.MapOptions);
/**
- * Radius of the planet for the map, in meters. Optional; defaults to
- * Earth's equatorial radius of 6378137 meters.
+ * 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.
*/
- radius: number;
+ controls: google.maps.MVCArrayData, bound to the map. Add features to this Data object to conveniently display them on this map.
*/
- releaseTile(tile: Element | null): void;
+ data: google.maps.Data;
/**
- * The dimensions of each tile. Required.
+ * A registry of MapType instances by string ID.
*/
- tileSize: google.maps.Size | null;
- }
- /**
- * Options for the rendering of the map type control.
- */
- export interface MapTypeControlOptions {
+ mapTypes: google.maps.MapTypeRegistry;
/**
- * IDs of map types to show in the control.
+ * 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).
*/
- mapTypeIds?: string[] | null;
+ overlayMapTypes: google.maps.MVCArraydisplay: 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.
*/
- position?: google.maps.ControlPosition | null;
+ fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void;
/**
- * Style id. Used to select what style of map type control to display.
+ * 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.
*/
- 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 {
+ getBounds(): google.maps.LatLngBounds | undefined;
/**
- * 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.
+ * 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.
*/
- DEFAULT = 0.0,
+ getCenter(): google.maps.LatLng | undefined;
/**
- * A dropdown menu for the screen realestate conscious.
+ * 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.
*/
- DROPDOWN_MENU = 1.0,
+ getClickableIcons(): boolean | undefined;
/**
- * The standard horizontal radio buttons bar.
+ * 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.
*/
- HORIZONTAL_BAR = 2.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 {
+ getDatasetFeatureLayer(datasetId: string): google.maps.FeatureLayer;
+
+ getDiv(): HTMLElement;
/**
- * This map type displays a transparent layer of major streets on satellite
- * images.
+ * 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.
*/
- HYBRID = 'hybrid',
+ getFeatureLayer(featureType: google.maps.FeatureTypeString): google.maps.FeatureLayer;
/**
- * This map type displays a normal street map.
+ * 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.
*/
- ROADMAP = 'roadmap',
+ getHeading(): number | undefined;
/**
- * This map type displays satellite images.
+ * 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).
*/
- SATELLITE = 'satellite',
+ getHeadingInteractionEnabled(): boolean | null;
/**
- * This map type displays maps with physical features such as terrain and
- * vegetation.
+ * 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.
*/
- TERRAIN = 'terrain',
- }
- /**
- * 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.
- */
- export class MapTypeRegistry extends google.maps.MVCObject {
+ getInternalUsageAttributionIds(): IterableMapTypeStyle 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 {
+ getMapCapabilities(): google.maps.MapCapabilities;
+
+ getMapTypeId(): google.maps.MapTypeIdString | string | undefined;
/**
- * 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.
+ * 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.
*/
- elementType?: string | null;
+ getProjection(): google.maps.Projection | undefined;
/**
- * 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.
+ * Returns the current RenderingType of the map.
*/
- featureType?: string | null;
+ getRenderingType(): google.maps.RenderingTypeString;
/**
- * 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.
+ * 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.
*/
- stylers: object[];
- }
- /**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- */
- export interface Maps3DLibrary {
- AltitudeMode: typeof google.maps.maps3d.AltitudeMode;
- CenterChangeEvent: typeof google.maps.maps3d.CenterChangeEvent;
- HeadingChangeEvent: typeof google.maps.maps3d.HeadingChangeEvent;
- LocationClickEvent: typeof google.maps.maps3d.LocationClickEvent;
- Map3DElement: typeof google.maps.maps3d.Map3DElement;
- Polygon3DElement: typeof google.maps.maps3d.Polygon3DElement;
- Polyline3DElement: typeof google.maps.maps3d.Polyline3DElement;
- RangeChangeEvent: typeof google.maps.maps3d.RangeChangeEvent;
- RollChangeEvent: typeof google.maps.maps3d.RollChangeEvent;
- SteadyChangeEvent: typeof google.maps.maps3d.SteadyChangeEvent;
- TiltChangeEvent: typeof google.maps.maps3d.TiltChangeEvent;
- }
- /**
- * An event listener, created by google.maps.event.addListener() and friends.
- */
- export interface MapsEventListener {
+ getStreetView(): google.maps.StreetViewPanorama;
/**
- * Removes the listener. listener.remove() is
- * equivalent to google.maps.event.removeListener(listener).
+ * 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.
*/
- 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;
- 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;
- }
- /**
- * 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 class MapsNetworkError extends Error {
+ getTilt(): number | undefined;
/**
- * 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.
+ * 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).
*/
- constructor();
+ getTiltInteractionEnabled(): boolean | null;
/**
- * Identifies the type of error produced by the API.
+ * Returns the zoom of the map. If the zoom has not been set then the result is undefined.
*/
- code:
- | google.maps.DirectionsStatus
- | google.maps.DistanceMatrixStatus
- | google.maps.ElevationStatus
- | google.maps.GeocoderStatus
- | google.maps.MaxZoomStatus
- | google.maps.places.PlacesServiceStatus
- | google.maps.StreetViewStatus;
+ getZoom(): number | undefined;
/**
- * Represents the network service that responded with the error.
+ * Immediately sets the map's camera to the target camera options, without animation.
*/
- endpoint: google.maps.MapsNetworkErrorEndpoint;
- }
- /**
- * 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 {
+ moveCamera(cameraOptions: google.maps.CameraOptions): void;
/**
- * Identifies the Routes API within the Directions API.
+ * 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).
*/
- DIRECTIONS_ROUTE = 'DIRECTIONS_ROUTE',
+ panBy(x: number, y: number): void;
/**
- * Identifies the DistanceMatrix API.
+ * 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.
*/
- DISTANCE_MATRIX = 'DISTANCE_MATRIX',
+ panTo(latLng: google.maps.LatLng | google.maps.LatLngLiteral): void;
/**
- * Identifies the getElevationsAlongPath API within the Elevation API.
+ * 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.
*/
- ELEVATION_ALONG_PATH = 'ELEVATION_ALONG_PATH',
+ panToBounds(latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void;
+
+ setCenter(latlng: google.maps.LatLng | google.maps.LatLngLiteral): void;
/**
- * Identifies the getElevationForLocations API within the Elevation API.
+ * 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.
*/
- ELEVATION_LOCATIONS = 'ELEVATION_LOCATIONS',
+ setClickableIcons(value: boolean): void;
/**
- * Identifies the Get DeliveryVehicle API within Fleet Engine.
+ * Sets the compass heading for map measured in degrees from cardinal direction North. For raster maps, this method only applies to aerial imagery.
*/
- FLEET_ENGINE_GET_DELIVERY_VEHICLE = 'FLEET_ENGINE_GET_DELIVERY_VEHICLE',
+ setHeading(heading: number): void;
/**
- * Identifies the Get Trip API within Fleet Engine.
+ * 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).
*/
- FLEET_ENGINE_GET_TRIP = 'FLEET_ENGINE_GET_TRIP',
+ setHeadingInteractionEnabled(headingInteractionEnabled: boolean): void;
+
+ setMapTypeId(mapTypeId: google.maps.MapTypeIdString | string): void;
+
+ setOptions(options: google.maps.MapOptions | null): void;
/**
- * Identifies the Get Vehicle API within Fleet Engine.
+ * Sets the current RenderingType of the map.
*/
- FLEET_ENGINE_GET_VEHICLE = 'FLEET_ENGINE_GET_VEHICLE',
+ setRenderingType(renderingType: google.maps.RenderingTypeString): void;
/**
- * Identifies the List DeliveryVehicles API within Fleet Engine.
+ * 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.
*/
- FLEET_ENGINE_LIST_DELIVERY_VEHICLES = 'FLEET_ENGINE_LIST_DELIVERY_VEHICLES',
+ setStreetView(panorama: google.maps.StreetViewPanorama | null): void;
/**
- * Identifies the List Tasks API within Fleet Engine.
+ * 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.
*/
- FLEET_ENGINE_LIST_TASKS = 'FLEET_ENGINE_LIST_TASKS',
+ setTilt(tilt: number): void;
/**
- * Identifies the List Vehicles API within Fleet Engine.
+ * 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).
*/
- FLEET_ENGINE_LIST_VEHICLES = 'FLEET_ENGINE_LIST_VEHICLES',
+ setTiltInteractionEnabled(tiltInteractionEnabled: boolean): void;
/**
- * Identifies the Search Tasks API within Fleet Engine.
+ * Sets the zoom of the map.
*/
- FLEET_ENGINE_SEARCH_TASKS = 'FLEET_ENGINE_SEARCH_TASKS',
+ setZoom(zoom: number): void;
/**
- * Identifies the geocode API within the Geocoder.
+ * 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).
*/
- GEOCODER_GEOCODE = 'GEOCODER_GEOCODE',
+ 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 {
/**
- * Identifies the MaximumZoomImageryService API within the Maps API.
+ *
+ * @param options
*/
- MAPS_MAX_ZOOM = 'MAPS_MAX_ZOOM',
+ constructor(options?: google.maps.MapElementOptions);
/**
- * Identifies the Autocomplete API within the Places API.
+ * The center latitude/longitude of the map.
*/
- PLACES_AUTOCOMPLETE = 'PLACES_AUTOCOMPLETE',
+ center: google.maps.LatLng | google.maps.LatLngLiteral | null;
/**
- * Identifies the Details API within the Places API.
+ * 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
*/
- PLACES_DETAILS = 'PLACES_DETAILS',
+ headingInteractionDisabled: boolean | null;
/**
- * Identifies the findPlaceFromPhoneNumber API within the Places API.
+ * A reference to the {@link google.maps.Map} that the MapElement uses internally.
*/
- PLACES_FIND_PLACE_FROM_PHONE_NUMBER = 'PLACES_FIND_PLACE_FROM_PHONE_NUMBER',
+ innerMap: google.maps.Map;
/**
- * Identifies the findPlaceFromQuery API within the Places API.
+ * 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
*/
- PLACES_FIND_PLACE_FROM_QUERY = 'PLACES_FIND_PLACE_FROM_QUERY',
+ internalUsageAttributionIds: Iterablefalse
*/
- PLACES_LOCAL_CONTEXT_SEARCH = 'PLACES_LOCAL_CONTEXT_SEARCH',
+ tiltInteractionDisabled: boolean | null;
/**
- * Identifies the NearbySearch API within the Places API.
+ * 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.
*/
- PLACES_NEARBY_SEARCH = 'PLACES_NEARBY_SEARCH',
+ zoom: number | null;
+ addEventListenernull.
*/
- PLACES_SEARCH_TEXT = 'PLACES_SEARCH_TEXT',
+ BOUNCE = 1,
/**
- * Identifies the getPanorama method within the Streetview service.
+ * 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.
*/
- STREETVIEW_GET_PANORAMA = 'STREETVIEW_GET_PANORAMA',
+ DROP = 2,
}
/**
- * 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.
+ * 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 MapsRequestError extends google.maps.MapsNetworkError {
+ export class MaxZoomService {
/**
- * 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.
+ * Creates a new instance of a MaxZoomService that can be used to send queries about the maximum zoom level available for satellite imagery.
*/
constructor();
+ /**
+ * Returns the maximum zoom level for which detailed imagery is available at a particular LatLng for the satellite map type. As this request is asynchronous, you must pass a callback function which will be executed upon completion of the request, being passed a MaxZoomResult.
+ */
+ getMaxZoomAtLatLng(latlng: google.maps.LatLng | google.maps.LatLngLiteral, callback?: ((arg0: google.maps.MaxZoomResult) => void)): PromiseMaxZoomService on the completion of a call to getMaxZoomAtLatLng(). Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.MaxZoomStatus.OK.
*
- * Access by calling `const {MapsServerError} = await
- * google.maps.importLibrary("core")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {MaxZoomStatus} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class MapsServerError extends google.maps.MapsNetworkError {
+ export enum MaxZoomStatus {
/**
- * 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.
+ * An unknown error occurred.
*/
- constructor();
+ ERROR = 'ERROR',
+ /**
+ * The response contains a valid MaxZoomResult.
+ */
+ OK = 'OK',
}
+ export type MaxZoomStatusString = `${google.maps.MaxZoomStatus}`;
/**
- * 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 is returned from a mouse event on a FeatureLayer.
*/
- export class Marker extends google.maps.MVCObject {
- /**
- * Access by calling `const {Marker} = await
- * google.maps.importLibrary("marker")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param opts Named optional arguments
- * @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.
- */
- constructor(opts?: google.maps.MarkerOptions | null);
+ export interface FeatureMouseEvent extends google.maps.MapMouseEvent {
/**
- * Get the currently running animation.
+ * The Features at this mouse event.
*/
- getAnimation(): google.maps.Animation | null | undefined;
+ features: google.maps.Feature[];
+ }
+ /**
+ * 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().
You must call onAdd() method, you should create DOM objects and append them as children of the panes.draw() method, you should position these elements.onRemove() method, you should remove the objects from the DOM.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 {
/**
- * Get the clickable status of the {@link google.maps.Marker}.
+ * Creates an OverlayView.
*/
- getClickable(): boolean;
+ constructor();
/**
- * Get the mouse cursor type shown on hover.
+ * 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.
*/
- getCursor(): string | null | undefined;
+ static preventMapHitsAndGesturesFrom(element: Element): void;
/**
- * Get the draggable status of the {@link google.maps.Marker}.
+ * Stops click or tap on the element from bubbling up to the map. Use this to prevent the map from triggering "click" events.
*/
- getDraggable(): boolean;
+ static preventMapHitsFrom(element: Element): void;
/**
- * Get the icon of the {@link google.maps.Marker}. See {@link
- * google.maps.MarkerOptions.icon}.
+ * 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.
*/
- getIcon():
- | string
- | google.maps.Icon
- | null
- | google.maps.Symbol
- | undefined;
+ draw(): void;
+
+ getMap(): google.maps.Map | google.maps.StreetViewPanorama;
/**
- * Get the label of the {@link google.maps.Marker}. See {@link
- * google.maps.MarkerOptions.label}.
+ * Returns the panes in which this OverlayView can be rendered. The panes are not initialized until onAdd is called by the API.
*/
- getLabel(): google.maps.MarkerLabel | null | string | undefined;
+ getPanes(): google.maps.MapPanes | null;
/**
- * Get the map or panaroama the {@link google.maps.Marker} is rendered on.
+ * Returns the MapCanvasProjection object associated with this OverlayView. The projection is not initialized until onAdd is called by the API.
*/
- getMap(): google.maps.Map | null | google.maps.StreetViewPanorama;
+ getProjection(): google.maps.MapCanvasProjection;
/**
- * Get the opacity of the {@link google.maps.Marker}.
+ * 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.
*/
- getOpacity(): number | null | undefined;
+ onAdd(): void;
/**
- * Get the position of the {@link google.maps.Marker}.
+ * Implement this method to remove your elements from the DOM. This method is called once following a call to setMap(null).
*/
- getPosition(): google.maps.LatLng | null | undefined;
+ onRemove(): void;
/**
- * Get the shape of the {@link google.maps.Marker} used for interaction.
- * See {@link google.maps.MarkerOptions.shape} and {@link
- * google.maps.MarkerShape}.
+ * Adds the overlay to the map or panorama.
*/
- getShape(): google.maps.MarkerShape | null | undefined;
+ 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 {
/**
- * Get the title of the {@link google.maps.Marker} tooltip. See {@link
- * google.maps.MarkerOptions.title}.
+ * 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
*/
- getTitle(): string | null | undefined;
+ constructor(opts?: google.maps.PolygonOptions | null);
/**
- * Get the visibility of the {@link google.maps.Marker}.
+ * Returns whether this shape can be dragged by the user.
*/
- getVisible(): boolean;
+ getDraggable(): boolean;
/**
- * Get the zIndex of the {@link google.maps.Marker}. See {@link
- * google.maps.MarkerOptions.zIndex}.
+ * Returns whether this shape can be edited by the user.
*/
- getZIndex(): number | null | undefined;
+ getEditable(): boolean;
/**
- * 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.
- * @param animation The animation to play.
+ * Returns the map on which this shape is attached.
*/
- setAnimation(animation?: google.maps.Animation | null): void;
+ getMap(): google.maps.Map | null;
/**
- * Set if the {@link google.maps.Marker} is clickable.
- * @param flag If true, the Marker can be clicked.
+ * Retrieves the first path.
*/
- setClickable(flag: boolean): void;
+ getPath(): google.maps.MVCArraytrue, the Marker can be dragged.
+ * Returns whether this poly is visible on the map.
*/
- setDraggable(flag: boolean | null): void;
+ getVisible(): boolean;
/**
- * Set the icon for the {@link google.maps.Marker}. See {@link
- * google.maps.MarkerOptions.icon}.
+ * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging.
*/
- setIcon(icon?: string | google.maps.Icon | null | google.maps.Symbol): void;
+ setDraggable(draggable: boolean): void;
/**
- * Set the label for the {@link google.maps.Marker}. See {@link
- * google.maps.MarkerOptions.label}.
- * @param label The label can either be a character string or a {@link
- * google.maps.MarkerLabel} object.
+ * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment.
*/
- setLabel(label?: string | google.maps.MarkerLabel | null): void;
+ setEditable(editable: boolean): void;
/**
- * Renders the {@link google.maps.Marker} on the specified map or panorama.
- * If map is set to null, the marker will be removed.
+ * Renders this shape on the specified map. If map is set to null, the shape will be removed.
*/
- setMap(map: google.maps.Map | null | google.maps.StreetViewPanorama): void;
+ setMap(map: google.maps.Map | null): void;
+
+ setOptions(options: google.maps.PolygonOptions | null): void;
/**
- * Set the opacity of the {@link google.maps.Marker}.
- * @param opacity A number between 0.0, transparent, and 1.0, opaque.
+ * Sets the first path. See PolygonOptions for more details.
*/
- setOpacity(opacity?: number | null): void;
+ setPath(path: google.maps.MVCArrayfalse.
*/
- setPosition(
- latlng?: google.maps.LatLng | null | google.maps.LatLngLiteral,
- ): void;
+ setVisible(visible: boolean): 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.
+ */
+ export class Polyline extends google.maps.MVCObject {
/**
- * Set the shape of the {@link google.maps.Marker} used for interaction.
- * See {@link google.maps.MarkerOptions.shape} and {@link
- * google.maps.MarkerShape}.
+ * 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
*/
- setShape(shape?: google.maps.MarkerShape | null): void;
+ constructor(opts?: google.maps.PolylineOptions | null);
/**
- * Set the title of the {@link google.maps.Marker} tooltip. See {@link
- * google.maps.MarkerOptions.title}.
+ * Returns whether this shape can be dragged by the user.
*/
- setTitle(title?: string | null): void;
+ getDraggable(): boolean;
/**
- * Set if the {@link google.maps.Marker} is visible.
- * @param visible If true, the Marker is visible
+ * Returns whether this shape can be edited by the user.
*/
- setVisible(visible: boolean): void;
+ getEditable(): boolean;
/**
- * Set the zIndex of the {@link google.maps.Marker}. See {@link
- * google.maps.MarkerOptions.zIndex}.
+ * Returns the map on which this shape is attached.
*/
- setZIndex(zIndex?: number | null): void;
+ getMap(): google.maps.Map | null;
/**
- * 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.
+ * Retrieves the path.
*/
- 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 {
+ getPath(): google.maps.MVCArrayMarkerLabel. 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 whether this poly is visible on the map.
*/
- className?: string;
+ getVisible(): boolean;
/**
- * The color of the label text.
- * @defaultValue 'black'
+ * If set to true, the user can drag this shape over the map. The geodesic property defines the mode of dragging.
*/
- color?: string;
+ setDraggable(draggable: boolean): void;
/**
- * The font family of the label text (equivalent to the CSS font-family
- * property).
+ * If set to true, the user can edit this shape by dragging the control points shown at the vertices and on each segment.
*/
- fontFamily?: string;
+ setEditable(editable: boolean): void;
/**
- * The font size of the label text (equivalent to the CSS font-size
- * property).
- * @defaultValue '14px'
+ * Renders this shape on the specified map. If map is set to null, the shape will be removed.
*/
- fontSize?: string;
+ setMap(map: google.maps.Map | null): void;
+
+ setOptions(options: google.maps.PolylineOptions | null): void;
/**
- * The font weight of the label text (equivalent to the CSS font-weight
- * property).
+ * Sets the path. See PolylineOptions for more details.
*/
- fontWeight?: string;
+ setPath(path: google.maps.MVCArrayfalse.
*/
- text: string;
- }
- 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;
+ setVisible(visible: boolean): void;
}
/**
- * 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 rectangle overlay.
+ * Access by calling `const {Rectangle} = await google.maps.importLibrary("maps");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface MarkerOptions {
+ export class Rectangle extends google.maps.MVCObject {
/**
- * The offset from the marker's position to the tip of an InfoWindow
- * that has been opened with the marker as anchor.
+ * Create a rectangle using the passed RectangleOptions, which specify the bounds and style.
+ * @param opts
*/
- anchorPoint?: google.maps.Point | null;
+ constructor(opts?: google.maps.RectangleOptions | null);
/**
- * Which animation to play when marker is added to a map.
- * @defaultValue null
+ * Returns the bounds of this rectangle.
*/
- animation?: google.maps.Animation | null;
+ getBounds(): google.maps.LatLngBounds | null;
/**
- * If true, the marker receives mouse and touch events.
- * @defaultValue true
+ * Returns whether this rectangle can be dragged by the user.
*/
- clickable?: boolean | null;
+ getDraggable(): boolean;
/**
- * 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.
+ * Returns whether this rectangle can be edited by the user.
*/
- collisionBehavior?: string | null;
+ getEditable(): boolean;
/**
- * If false, disables cross that appears beneath the marker
- * when dragging.
- * @defaultValue true
+ * Returns the map on which this rectangle is displayed.
*/
- crossOnDrag?: boolean | null;
+ getMap(): google.maps.Map | null;
/**
- * Mouse cursor type to show on hover.
- * @defaultValue pointer
+ * Returns whether this rectangle is visible on the map.
*/
- cursor?: string | null;
+ getVisible(): boolean;
/**
- * If true, the marker can be dragged.
- * @defaultValue false
+ * Sets the bounds of this rectangle.
*/
- draggable?: boolean | null;
+ setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): void;
/**
- * Icon for the foreground. If a string is provided, it is treated as though
- * it were an Icon with the string as url.
+ * If set to true, the user can drag this rectangle over the map.
*/
- icon?: string | google.maps.Icon | null | google.maps.Symbol;
+ setDraggable(draggable: boolean): void;
/**
- * 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
+ * If set to true, the user can edit this rectangle by dragging the control points shown at the corners and on each edge.
*/
- label?: string | google.maps.MarkerLabel | null;
+ setEditable(editable: boolean): void;
/**
- * 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.
+ * Renders the rectangle on the specified map. If map is set to null, the rectangle will be removed.
*/
- map?: google.maps.Map | null | google.maps.StreetViewPanorama;
+ setMap(map: google.maps.Map | null): void;
+
+ setOptions(options: google.maps.RectangleOptions | null): void;
/**
- * A number between 0.0, transparent, and 1.0, opaque.
- * @defaultValue 1.0
+ * Hides this rectangle if set to false.
*/
- opacity?: number | null;
+ 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 {
/**
- * 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.
+ * The stroke is centered on the polygon's path, with half the stroke inside the polygon and half the stroke outside the polygon.
*/
- optimized?: boolean | null;
+ CENTER = 0,
/**
- * 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.
+ * The stroke lies inside the polygon.
*/
- position?: google.maps.LatLng | null | google.maps.LatLngLiteral;
+ INSIDE = 1,
/**
- * Image map region definition used for drag/click.
+ * The stroke lies outside the polygon.
*/
- shape?: google.maps.MarkerShape | null;
+ 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 {
/**
- * 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
+ * Creates a new instance of StreetViewCoverageLayer.
*/
- title?: string | null;
+ constructor();
/**
- * If true, the marker is visible.
- * @defaultValue true
+ * Returns the map on which this layer is displayed.
*/
- visible?: boolean | null;
+ getMap(): google.maps.Map | 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.
+ * Renders the layer on the specified map. If the map is set to null, the layer will be removed.
*/
- zIndex?: number | null;
+ setMap(map: google.maps.Map | null): undefined;
}
/**
- * 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.
+ * 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 interface MarkerShape {
+ export enum StreetViewPreference {
/**
- * 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.
+ * 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.
*/
- coords: number[] | null;
+ BEST = 'best',
/**
- * Describes the shape's type and can be circle,
- * poly or rect.
+ * 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.
*/
- type: string;
+ NEAREST = 'nearest',
}
+ export type StreetViewPreferenceString = `${google.maps.StreetViewPreference}`;
/**
- * A MaxZoom result in JSON format retrieved from the MaxZoomService.
+ * The response resolved for a Promise from {@link google.maps.StreetViewService.getPanorama}.
*/
- export interface MaxZoomResult {
- /**
- * 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.MaxZoomStatus | null;
+ export interface StreetViewResponse {
/**
- * The maximum zoom level found at the given LatLng.
+ * The representation of a panorama.
*/
- zoom: number;
+ data: google.maps.StreetViewPanoramaData;
}
/**
- * 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 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 MaxZoomService {
+ export class StreetViewService {
+ /**
+ * Creates a StreetViewService, which provides an interface to the data stored in the Street View service.
+ */
+ constructor();
/**
- * Returns the maximum zoom level for which detailed imagery is available at
- * a particular LatLng for the satellite map type.
- * As this request is asynchronous, you must pass a callback
- * function which will be executed upon completion of the request, being
- * passed a MaxZoomResult.
+ * Retrieves the StreetViewPanoramaData for a panorama that matches the supplied Street View query request. The StreetViewPanoramaData is passed to the provided callback.
*/
- getMaxZoomAtLatLng(
- latlng: google.maps.LatLng | google.maps.LatLngLiteral,
- callback?: (a: google.maps.MaxZoomResult) => void,
- ): PromiseMaxZoomService on the completion of
- * a call to getMaxZoomAtLatLng(). Specify these by value, or by
- * using the constant's name. For example, 'OK' or
- * google.maps.MaxZoomStatus.OK.
+ * Identifiers to limit Street View searches to selected sources. These values are specified as strings. For example, 'outdoor'.
*
- * Access by calling `const {MaxZoomStatus} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {StreetViewSource} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export enum MaxZoomStatus {
+ export enum StreetViewSource {
/**
- * An unknown error occurred.
+ * Uses the default sources of Street View, searches will not be limited to specific sources.
*/
- ERROR = 'ERROR',
+ DEFAULT = 'default',
/**
- * The response contains a valid MaxZoomResult.
+ * Limits Street View searches to official Google collections.
*/
- OK = 'OK',
- }
- /**
- * Options for the rendering of the motion tracking control.
- */
- export interface MotionTrackingControlOptions {
+ GOOGLE = 'google',
/**
- * Position id. This is used to specify the position of this control on the
- * panorama.
- * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
+ * 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.
*/
- position?: google.maps.ControlPosition | null;
+ OUTDOOR = 'outdoor',
}
+ export type StreetViewSourceString = `${google.maps.StreetViewSource}`;
/**
- * 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().
You must call onAdd() method, you
- * should create DOM objects and append them as children of the panes.draw() method, you should position these
- * elements.onRemove() method, you should remove
- * the objects from the DOM.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.
+ * 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 {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 {StreetViewStatus} = await google.maps.importLibrary("streetView");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class OverlayView extends google.maps.MVCObject {
+ export enum StreetViewStatus {
/**
- * 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.
+ * The request was successful.
*/
- draw(): void;
- getMap(): google.maps.Map | null | google.maps.StreetViewPanorama;
+ OK = 'OK',
/**
- * Returns the panes in which this OverlayView can be rendered. The panes
- * are not initialized until onAdd is called by the API.
+ * The request could not be successfully processed, yet the exact reason for failure is unknown.
*/
- getPanes(): google.maps.MapPanes | null;
+ UNKNOWN_ERROR = 'UNKNOWN_ERROR',
/**
- * Returns the MapCanvasProjection object associated with this
- * OverlayView. The projection is not initialized until
- * onAdd is called by the API.
+ * There are no panoramas found that match the search criteria.
*/
- getProjection(): google.maps.MapCanvasProjection;
+ ZERO_RESULTS = 'ZERO_RESULTS',
+ }
+ export type StreetViewStatusString = `${google.maps.StreetViewStatus}`;
+ /**
+ * This class is used to create a MapType that renders image tiles.
+ */
+ export interface ImageMapTypeOptions {
/**
- * 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.
+ * Alt text to display when this MapType's button is hovered over in the MapTypeControl.
*/
- onAdd(): void;
+ alt?: string | null;
/**
- * Implement this method to remove your elements from the DOM. This method
- * is called once following a call to setMap(null).
+ * Returns a string (URL) for given tile coordinate (x, y) and zoom level.
*/
- onRemove(): void;
+ getTileUrl?: ((arg0: google.maps.Point, arg1: number) => (string | null)) | null;
/**
- * Adds the overlay to the map or panorama.
- * @param map The map or panorama. If null, the layer will be
- * removed.
+ * The maximum zoom level for the map when displaying this MapType.
*/
- setMap(map: google.maps.Map | null | google.maps.StreetViewPanorama): void;
+ maxZoom?: number | null;
/**
- * 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.
+ * The minimum zoom level for the map when displaying this MapType. Optional.
*/
- static preventMapHitsAndGesturesFrom(this: any, element: Element): void;
+ minZoom?: number | null;
/**
- * Stops click or tap on the element from bubbling up to the map. Use this
- * to prevent the map from triggering "click" events.
+ * Name to display in the MapTypeControl.
*/
- static preventMapHitsFrom(this: any, element: Element): void;
- }
- export interface Padding {
+ name?: string | null;
/**
- * Padding for the bottom, in pixels.
+ * 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.
*/
- bottom?: number;
+ opacity?: number | null;
/**
- * Padding for the left, in pixels.
+ * The tile size.
*/
- left?: number;
+ tileSize?: google.maps.Size | null;
+ }
+ /**
+ * 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 {
/**
- * Padding for the right, in pixels.
+ * Constructs an ImageMapType using the provided ImageMapTypeOptions
+ * @param opts
*/
- right?: number;
+ 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;
/**
- * Padding for the top, in pixels.
+ * Returns the opacity level (0 (transparent) to 1.0) of the ImageMapType tiles.
*/
- top?: number;
- }
- /**
- * Options for the rendering of the pan control.
- */
- export interface PanControlOptions {
+ getOpacity(): number;
+
+ getTile(tileCoord: google.maps.Point | null, zoom: number, ownerDocument: Document | null): Element | null;
+
+ releaseTile(tileDiv: Element | null): void;
/**
- * Position id. Used to specify the position of the control on the map.
- * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
+ * Sets the opacity level (0 (transparent) to 1.0) of the ImageMapType tiles.
*/
- position?: google.maps.ControlPosition | null;
+ setOpacity(opacity: number): void;
}
/**
- * Options for the Custom Pano Provider.
+ * 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 PanoProviderOptions {
+ export interface MapTypeStyle {
/**
- * 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.
+ * 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.
*/
- cors?: boolean;
- }
- /**
- * 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 interface PathElevationRequest {
+ elementType?: string | null;
/**
- * The path along which to collect elevation values.
+ * 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.
*/
- path?: (google.maps.LatLng | google.maps.LatLngLiteral)[] | null;
+ featureType?: string | null;
/**
- * 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 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.
*/
- samples: number;
+ stylers: object[];
}
/**
- * 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}.
+ * 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);
+
+ 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;
+ }
+ /**
+ * An event listener, created by google.maps.event.addListener() and friends.
+ */
+ export interface MapsEventListener {
+ /**
+ * Removes the listener. 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}`;
+
+ 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;
+ }
+
+ 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;
+ }
+
+ 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 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;
+ }
+ /**
+ * A DirectionsWaypoint represents a location between origin and destination through which the trip should be routed.
+ */
+ export interface DirectionsWaypoint {
+ /**
+ * Waypoint location. Can be an address string, a LatLng, or a Place. Optional.
+ */
+ location?: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.Place;
+ /**
+ * 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
+ */
+ stopover?: boolean;
+ }
+ /**
+ * Configures the DirectionsRequest when the travel mode is set to DRIVING.
+ */
+ export interface DrivingOptions {
+ /**
+ * 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.
+ */
+ departureTime: Date;
+ /**
+ * The preferred assumption to use when predicting duration in traffic. The default is BEST_GUESS.
+ */
+ trafficModel?: google.maps.TrafficModelString;
+ }
+ /**
+ * The TransitOptions object to be included in a DirectionsRequest when the travel mode is set to TRANSIT.
+ */
+ export interface TransitOptions {
+ /**
+ * 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.
+ */
+ arrivalTime?: Date | 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".
+ */
+ departureTime?: Date | null;
+ /**
+ * One or more preferred modes of transit, such as bus or train. If no preference is given, the API returns the default best route.
+ */
+ 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;
+ }
+ /**
+ * A representation of time as a Date object, a localized string, and a time zone.
+ */
+ export interface Time {
+ /**
+ * A string representing the time's value. The time is displayed in the time zone of the transit stop.
+ */
+ text: string;
+ /**
+ * 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".
+ */
+ time_zone: string;
+ /**
+ * The time of this departure or arrival, specified as a JavaScript Date object.
+ */
+ value: Date;
+ }
+ /**
+ * Information about an agency that operates a transit line.
+ */
+ export interface TransitAgency {
+ /**
+ * The name of this transit agency.
+ */
+ name: string;
+ /**
+ * The transit agency's phone number.
+ */
+ phone: string;
+ /**
+ * The transit agency's URL.
+ */
+ url: string;
+ }
+ /**
+ * Information about the vehicle that operates on a transit line.
+ */
+ export interface TransitVehicle {
+ /**
+ * A URL for an icon that corresponds to the type of vehicle used on this line.
+ */
+ 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;
+ }
+ /**
+ * Information about the transit line that operates this transit step.
+ */
+ export interface TransitLine {
+ /**
+ * The transit agency that operates this transit line.
+ */
+ agencies: google.maps.TransitAgency[];
+ /**
+ * The color commonly used in signage for this transit line, represented as a hex string.
+ */
+ color: string;
+ /**
+ * The URL for an icon associated with this line.
+ */
+ icon: string;
+ /**
+ * The full name of this transit line, e.g. "8 Avenue Local".
+ */
+ 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;
+ }
+ /**
+ * Details about a transit stop or station.
+ */
+ export interface TransitStop {
+ /**
+ * The location of this stop.
+ */
+ location: google.maps.LatLng;
+ /**
+ * The name of this transit stop.
+ */
+ name: string;
+ }
+ /**
+ * Details about the departure, arrival, and mode of transit used in this step.
+ */
+ export interface TransitDetails {
+ /**
+ * The arrival stop of this transit step.
+ */
+ arrival_stop: google.maps.TransitStop;
+ /**
+ * The arrival time of this step, specified as a Time object.
+ */
+ arrival_time: google.maps.Time;
+ /**
+ * The departure stop of this transit step.
+ */
+ departure_stop: google.maps.TransitStop;
+ /**
+ * The departure time of this step, specified as a Time object.
+ */
+ departure_time: google.maps.Time;
+ /**
+ * The direction in which to travel on this line, as it is marked on the vehicle or at the departure stop.
+ */
+ headsign: string;
+ /**
+ * The expected number of seconds between equivalent vehicles at this stop.
+ */
+ headway: number;
+ /**
+ * Details about the transit line used in this step.
+ */
+ line: google.maps.TransitLine;
+ /**
+ * The number of stops on this step. Includes the arrival stop, but not the departure stop.
+ */
+ num_stops: number;
+ /**
+ * 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.
+ */
+ trip_short_name: string;
+ }
+ /**
+ * A fare of a DirectionsRoute consisting of value and currency.
+ */
+ export interface TransitFare {
+ /**
+ * An ISO 4217 currency code indicating the currency in which the fare is expressed.
+ */
+ currency: string;
+ /**
+ * The value of the fare, expressed in the given currency, as a string.
+ */
+ text: string;
+ /**
+ * The numerical value of the fare, expressed in the given currency.
+ */
+ value: number;
+ }
+ /**
+ * This object defines the properties that can be set on a DirectionsRenderer object.
+ */
+ export interface DirectionsRendererOptions {
+ /**
+ * The directions to display on the map and/or in a <div> panel, retrieved as a DirectionsResult object from DirectionsService.
+ */
+ directions?: google.maps.DirectionsResult | null;
+ /**
+ * If true, allows the user to drag and modify the paths of routes rendered by this DirectionsRenderer.
+ */
+ draggable?: boolean | null;
+ /**
+ * This property indicates whether the renderer should provide a user-selectable list of routes shown in the directions panel.
+ * @defaultValue false
+ */
+ hideRouteList?: 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.
+ */
+ infoWindow?: google.maps.InfoWindow | null;
+ /**
+ * Map on which to display the directions.
+ */
+ map?: google.maps.Map | null;
+ /**
+ * Options for the markers. All markers rendered by the DirectionsRenderer will use these options.
+ */
+ markerOptions?: google.maps.MarkerOptions | null;
+ /**
+ * The <div> in which to display the directions steps.
+ */
+ 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;
+ /**
+ * Suppress the rendering of markers.
+ */
+ suppressMarkers?: boolean | null;
+ /**
+ * Suppress the rendering of polylines.
+ */
+ 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 {
+ /**
+ * The elevation of this point on Earth, in meters above sea level.
+ */
+ elevation: number;
+ /**
+ * The location of this elevation result.
+ */
+ location: google.maps.LatLng | 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.
+ */
+ resolution: number;
+ }
+ /**
+ * 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 interface PathElevationRequest {
+ /**
+ * The path along which to collect elevation values.
+ */
+ path?: (google.maps.LatLng | google.maps.LatLngLiteral)[] | null;
+ /**
+ * 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.
+ */
+ 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 {
/**
- * The list of {@link google.maps.ElevationResult}s matching the samples of
- * the {@link google.maps.PathElevationRequest}.
+ * The list of {@link google.maps.ElevationResult}s matching the samples of the {@link google.maps.PathElevationRequest}.
+ */
+ results: google.maps.ElevationResult[];
+ }
+ /**
+ * An elevation request sent by the ElevationService containing the list of discrete coordinates (LatLngs) for which to return elevation data.
+ */
+ export interface LocationElevationRequest {
+ /**
+ * The discrete locations for which to retrieve elevations.
+ */
+ 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 {
+ /**
+ * The list of {@link google.maps.ElevationResult}s matching the locations of the {@link google.maps.LocationElevationRequest}.
+ */
+ results: google.maps.ElevationResult[];
+ }
+ /**
+ * A single address component within a GeocoderResult. A full address may consist of multiple address components.
+ */
+ export interface GeocoderAddressComponent {
+ /**
+ * The full text of the address component
+ */
+ long_name: string;
+ /**
+ * The abbreviated, short text of the given address component
+ */
+ short_name: string;
+ /**
+ * An array of strings denoting the type of this address component. A list of valid types can be found here
+ */
+ 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 {
+ /**
+ * Matches all the administrative_area levels. Optional.
+ */
+ administrativeArea?: string;
+ /**
+ * Matches a country name or a two letter ISO 3166-1 country code. Optional.
+ */
+ country?: string;
+ /**
+ * Matches against both locality and sublocality types. Optional.
+ */
+ locality?: string;
+ /**
+ * Matches postal_code and postal_code_prefix. Optional.
+ */
+ postalCode?: string;
+ /**
+ * Matches the long or short name of a route. Optional.
+ */
+ route?: string;
+ }
+ /**
+ * A Geocoder response returned by the {@link google.maps.Geocoder} containing the list of {@link google.maps.GeocoderResult}s.
+ */
+ export interface GeocoderResponse {
+ /**
+ * 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.
+ */
+ address_descriptor?: google.maps.AddressDescriptor | null;
+ /**
+ * The plus code associated with the location.
+ */
+ plus_code?: google.maps.places.PlacePlusCode | null;
+ /**
+ * The list of {@link google.maps.GeocoderResult}s.
+ */
+ results: google.maps.GeocoderResult[];
+ }
+ /**
+ * 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 GeocoderResult {
+ /**
+ * An array of GeocoderAddressComponents
+ */
+ address_components: google.maps.GeocoderAddressComponent[];
+ /**
+ * 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.
+ */
+ address_descriptor?: google.maps.AddressDescriptor;
+ /**
+ * A string containing the human-readable address of this location.
+ */
+ formatted_address: string;
+ /**
+ * A GeocoderGeometry object
+ */
+ geometry: google.maps.GeocoderGeometry;
+ /**
+ * 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.
+ */
+ partial_match?: boolean;
+ /**
+ * 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.
+ */
+ place_id: string;
+ /**
+ * 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[];
+ }
+ /**
+ * Geometry information about this GeocoderResult
+ */
+ export interface GeocoderGeometry {
+ /**
+ * The precise bounds of this GeocoderResult, if applicable
+ */
+ bounds?: google.maps.LatLngBounds;
+ /**
+ * The latitude/longitude coordinates of this result
+ */
+ location: google.maps.LatLng;
+ /**
+ * The type of location returned in location
+ */
+ location_type: google.maps.GeocoderLocationTypeString;
+ /**
+ * The bounds of the recommended viewport for displaying this GeocoderResult
+ */
+ viewport: google.maps.LatLngBounds;
+ }
+ /**
+ * 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 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;
+ /**
+ * 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.
+ */
+ north: number;
+ /**
+ * 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.
+ */
+ south: number;
+ /**
+ * 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.
+ */
+ west: number;
+ }
+ /**
+ * 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 VisibleRegion {
+
+ farLeft: google.maps.LatLng;
+
+ farRight: google.maps.LatLng;
+ /**
+ * The smallest bounding box that includes the visible region.
+ */
+ latLngBounds: google.maps.LatLngBounds;
+
+ nearLeft: google.maps.LatLng;
+
+ 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;
+ /**
+ * 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.
+ */
+ 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;
+ }
+ /**
+ * This object defines the properties that can be set on a GroundOverlay object.
+ */
+ export interface GroundOverlayOptions {
+ /**
+ * If true, the ground overlay can receive mouse events.
+ */
+ clickable?: boolean | null;
+ /**
+ * The map on which to display the overlay.
+ */
+ 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;
+ }
+ /**
+ * Contains details of the author of a KML document or feature.
+ */
+ export interface KmlAuthor {
+ /**
+ * The author's e-mail address, or an empty string if not specified.
+ */
+ email: string;
+ /**
+ * The author's name, or an empty string if not specified.
+ */
+ name: string;
+ /**
+ * The author's home page, or an empty string if not specified.
+ */
+ 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 {
+ /**
+ * The feature's <atom:author>, extracted from the layer markup (if specified).
+ */
+ author: google.maps.KmlAuthor;
+ /**
+ * The feature's <description>, extracted from the layer markup.
+ */
+ description: string;
+ /**
+ * The feature's <id>, extracted from the layer markup. If no <id> has been specified, a unique ID will be generated for this feature.
+ */
+ id: string;
+ /**
+ * The feature's balloon styled text, if set.
+ */
+ infoWindowHtml: string;
+ /**
+ * The feature's <name>, extracted from the layer markup.
+ */
+ name: string;
+ /**
+ * The feature's <Snippet>, extracted from the layer markup.
+ */
+ snippet: string;
+ }
+ /**
+ * Metadata for a single KML layer, in JSON format.
+ */
+ export interface KmlLayerMetadata {
+ /**
+ * The layer's <atom:author>, extracted from the layer markup.
+ */
+ author: google.maps.KmlAuthor | null;
+ /**
+ * The layer's <description>, extracted from the layer markup.
+ */
+ description: string;
+ /**
+ * Whether the layer has any screen overlays.
+ */
+ hasScreenOverlays: boolean;
+ /**
+ * The layer's <name>, extracted from the layer markup.
+ */
+ name: string;
+ /**
+ * The layer's <Snippet>, extracted from the layer markup
+ */
+ snippet: string;
+ }
+ /**
+ * This object defines the properties that can be set on a KmlLayer object.
+ */
+ export interface KmlLayerOptions {
+ /**
+ * If true, the layer receives mouse events.
+ * @defaultValue true
+ */
+ clickable?: boolean | null;
+ /**
+ * The map on which to display the layer.
+ */
+ map?: google.maps.Map | null;
+ /**
+ * 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
+ */
+ preserveViewport?: boolean | null;
+ /**
+ * Whether to render the screen overlays.
+ * @defaultValue true
+ */
+ screenOverlays?: boolean | null;
+ /**
+ * Suppress the rendering of info windows when layer features are clicked.
+ */
+ suppressInfoWindows?: boolean | null;
+ /**
+ * The URL of the KML document to display.
+ */
+ url?: string | null;
+ /**
+ * The z-index of the layer.
+ */
+ zIndex?: number | null;
+ }
+ /**
+ * The properties of a click event on a KML/KMZ or GeoRSS document.
+ */
+ export interface KmlMouseEvent {
+ /**
+ * A KmlFeatureData object, containing information about the clicked feature.
+ */
+ featureData: google.maps.KmlFeatureData;
+ /**
+ * The position at which to anchor an infowindow on the clicked feature.
+ */
+ latLng: google.maps.LatLng;
+ /**
+ * The offset to apply to an infowindow anchored on the clicked feature.
+ */
+ pixelOffset: google.maps.Size;
+ }
+ /**
+ * TrafficLayerOptions object used to define the properties that can be set on a TrafficLayer.
+ */
+ export interface TrafficLayerOptions {
+ /**
+ * Whether the traffic layer refreshes with updated information automatically.
+ * @defaultValue true
+ */
+ autoRefresh?: boolean | null;
+ /**
+ * Map on which to display the traffic layer.
+ */
+ 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 {
+ /**
+ * Padding for the bottom, in pixels.
+ */
+ bottom?: number;
+ /**
+ * Padding for the left, in pixels.
+ */
+ left?: number;
+ /**
+ * Padding for the right, in pixels.
+ */
+ right?: number;
+ /**
+ * Padding for the top, in pixels.
+ */
+ top?: number;
+ }
+ /**
+ * A structure representing a Marker icon image.
+ */
+ export interface Icon {
+ /**
+ * 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.
+ */
+ anchor?: google.maps.Point | null;
+ /**
+ * 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.
+ */
+ labelOrigin?: google.maps.Point | 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).
+ */
+ origin?: google.maps.Point | null;
+ /**
+ * The size of the entire image after scaling, if any. Use this property to stretch/shrink an image or a sprite.
+ */
+ 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;
+ }
+ /**
+ * 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 {
+ /**
+ * The offset from the marker's position to the tip of an InfoWindow that has been opened with the marker as anchor.
+ */
+ anchorPoint?: google.maps.Point | null;
+ /**
+ * Which animation to play when marker is added to a map.
+ * @defaultValue null
+ */
+ animation?: google.maps.Animation | null;
+ /**
+ * If true, the marker receives mouse and touch events.
+ * @defaultValue true
+ */
+ clickable?: boolean | null;
+ /**
+ * If false, disables cross that appears beneath the marker when dragging.
+ * @defaultValue true
+ */
+ crossOnDrag?: boolean | null;
+ /**
+ * Mouse cursor type to show on hover.
+ * @defaultValue pointer
+ */
+ cursor?: string | 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
+ */
+ draggable?: boolean | null;
+ /**
+ * Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url.
+ */
+ icon?: string | google.maps.Icon | google.maps.Symbol | null;
+ /**
+ * 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
+ */
+ label?: string | google.maps.MarkerLabel | 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.
+ */
+ map?: google.maps.Map | google.maps.StreetViewPanorama | null;
+ /**
+ * A number between 0.0, transparent, and 1.0, opaque.
+ * @defaultValue 1.0
+ */
+ opacity?: 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.
+ */
+ optimized?: boolean | 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.
+ */
+ position?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ /**
+ * Image map region definition used for drag/click.
+ */
+ shape?: google.maps.MarkerShape | 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.
+ */
+ 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;
+ }
+ /**
+ * 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 {
+ /**
+ * 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.
+ */
+ coords: number[] | null;
+ /**
+ * Describes the shape's type and can be circle, poly or rect.
+ */
+ 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 {
+ /**
+ * 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)
+ */
+ className?: string;
+ /**
+ * The color of the label text.
+ * @defaultValue 'black'
+ */
+ color?: string;
+ /**
+ * The font family of the label text (equivalent to the CSS font-family property).
+ */
+ fontFamily?: string;
+ /**
+ * The font size of the label text (equivalent to the CSS font-size property).
+ * @defaultValue '14px'
+ */
+ 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;
+ }
+ /**
+ * A MaxZoom result in JSON format retrieved from the MaxZoomService.
+ */
+ export interface MaxZoomResult {
+ /**
+ * 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;
+ }
+ /**
+ * CircleOptions object used to define the properties that can be set on a Circle.
+ */
+ export interface CircleOptions {
+ /**
+ * The center of the Circle.
+ */
+ center?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ /**
+ * Indicates whether this Circle handles mouse events.
+ * @defaultValue true
+ */
+ clickable?: boolean | null;
+ /**
+ * If set to true, the user can drag this circle over the map.
+ * @defaultValue false
+ */
+ draggable?: boolean | null;
+ /**
+ * 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
+ */
+ editable?: boolean | null;
+ /**
+ * The fill color. All CSS3 colors are supported except for extended named colors.
+ */
+ fillColor?: string | null;
+ /**
+ * The fill opacity between 0.0 and 1.0.
+ */
+ fillOpacity?: number | null;
+ /**
+ * Map on which to display the Circle.
+ */
+ 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;
+ }
+ /**
+ * 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 IconSequence {
+ /**
+ * 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
+ */
+ fixedRotation?: boolean;
+ /**
+ * The icon to render on the line.
+ */
+ icon?: google.maps.Symbol | 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%'
+ */
+ offset?: string;
+ /**
+ * 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
+ */
+ repeat?: string;
+ }
+ /**
+ * This object is returned from mouse events on polylines and polygons.
+ */
+ export interface PolyMouseEvent extends google.maps.MapMouseEvent {
+ /**
+ * 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.
+ */
+ edge?: number;
+ /**
+ * 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.
+ */
+ path?: number;
+ /**
+ * 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.
+ */
+ vertex?: number;
+ }
+ /**
+ * PolygonOptions object used to define the properties that can be set on a Polygon.
+ */
+ export interface PolygonOptions {
+ /**
+ * Indicates whether this Polygon handles mouse events.
+ * @defaultValue true
+ */
+ clickable?: 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
+ */
+ draggable?: boolean | 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
+ */
+ editable?: boolean | null;
+ /**
+ * The fill color. All CSS3 colors are supported except for extended named colors.
+ */
+ fillColor?: string | null;
+ /**
+ * The fill opacity between 0.0 and 1.0
+ */
+ fillOpacity?: number | 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
+ */
+ geodesic?: boolean | null;
+ /**
+ * Map on which to display Polygon.
+ */
+ map?: google.maps.Map | 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.
+ */
+ paths?: google.maps.MVCArraytrue
+ */
+ visible?: boolean | null;
+ /**
+ * The zIndex compared to other polys.
+ */
+ zIndex?: number | null;
+ }
+ /**
+ * PolylineOptions object used to define the properties that can be set on a Polyline.
+ */
+ export interface PolylineOptions {
+ /**
+ * Indicates whether this Polyline handles mouse events.
+ * @defaultValue true
+ */
+ clickable?: 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
+ */
+ draggable?: boolean | 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
+ */
+ editable?: 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
+ */
+ geodesic?: boolean | null;
+ /**
+ * The icons to be rendered along the polyline.
+ */
+ icons?: google.maps.IconSequence[] | null;
+ /**
+ * Map on which to display Polyline.
+ */
+ map?: google.maps.Map | null;
+ /**
+ * 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.
+ */
+ path?: google.maps.MVCArraytrue
+ */
+ visible?: boolean | null;
+ /**
+ * The zIndex compared to other polys.
+ */
+ zIndex?: number | null;
+ }
+ /**
+ * RectangleOptions object used to define the properties that can be set on a Rectangle.
+ */
+ export interface RectangleOptions {
+ /**
+ * The bounds.
+ */
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ /**
+ * Indicates whether this Rectangle handles mouse events.
+ * @defaultValue true
+ */
+ clickable?: boolean | null;
+ /**
+ * If set to true, the user can drag this rectangle over the map.
+ * @defaultValue false
+ */
+ draggable?: boolean | null;
+ /**
+ * 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
+ */
+ editable?: boolean | null;
+ /**
+ * The fill color. All CSS3 colors are supported except for extended named colors.
+ */
+ fillColor?: string | null;
+ /**
+ * The fill opacity between 0.0 and 1.0
+ */
+ fillOpacity?: number | null;
+ /**
+ * Map on which to display Rectangle.
+ */
+ map?: google.maps.Map | 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 rectangle is visible on the map.
+ * @defaultValue true
+ */
+ visible?: boolean | null;
+ /**
+ * The zIndex compared to other polys.
+ */
+ zIndex?: number | null;
+ }
+ /**
+ * 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 PlaceFeature extends google.maps.Feature {
+ /**
+ * The {@link google.maps.places.PlaceResult.place_id}.
+ */
+ placeId: string;
+ /**
+ * 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.
+ */
+ fetchPlace(): PromisegetPanorama. StreetViewLocationRequest lets you search for a Street View panoroma at a specified location.
+ */
+ export interface StreetViewLocationRequest {
+ /**
+ * Specifies the location where to search for a Street View panorama.
+ */
+ location?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ /**
+ * 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.
+ */
+ preference?: google.maps.StreetViewPreferenceString | null;
+ /**
+ * Sets a radius in meters in which to search for a panorama.
+ * @defaultValue 50
+ */
+ radius?: 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}]
+ */
+ sources?: Iterablesources instead.
+ */
+ source?: google.maps.StreetViewSourceString | null;
+ }
+ /**
+ * A StreetViewPanoRequest is used with the getPanorama to find a panorama with a specified ID.
+ */
+ export interface StreetViewPanoRequest {
+ /**
+ * Specifies the pano ID to search for.
+ */
+ pano?: string | null;
+ }
+ /**
+ * The representation of a panorama returned from the provider defined using registerPanoProvider.
+ */
+ export interface StreetViewPanoramaData {
+ /**
+ * Specifies the copyright text for this panorama.
+ */
+ copyright?: string;
+ /**
+ * Specifies the year and month in which the imagery in this panorama was acquired. The date string is in the form YYYY-MM.
+ */
+ imageDate?: string;
+ /**
+ * Specifies the navigational links to adjacent panoramas.
+ */
+ links?: google.maps.StreetViewLink[];
+ /**
+ * Specifies the location meta-data for this panorama.
+ */
+ location?: google.maps.StreetViewLocation;
+ /**
+ * Specifies the custom tiles for this panorama.
+ */
+ tiles: google.maps.StreetViewTileData;
+ }
+ /**
+ * Options for the rendering of the pan control.
+ */
+ export interface PanControlOptions {
+ /**
+ * Position id. Used to specify the position of the control on the map.
+ * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
+ */
+ position?: google.maps.ControlPosition | null;
+ }
+ /**
+ * Options for the rendering of the zoom control.
+ */
+ export interface ZoomControlOptions {
+ /**
+ * Position id. Used to specify the position of the control on the map.
+ * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
+ */
+ position?: google.maps.ControlPosition | null;
+ }
+ /**
+ * Options for the rendering of the motion tracking control.
+ */
+ export interface MotionTrackingControlOptions {
+ /**
+ * Position id. This is used to specify the position of this control on the panorama.
+ * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
+ */
+ position?: google.maps.ControlPosition | null;
+ }
+ /**
+ * Options for the rendering of the Street View address control.
+ */
+ export interface StreetViewAddressControlOptions {
+ /**
+ * Position id. This id is used to specify the position of the control on the map. The default position is TOP_LEFT.
+ */
+ position?: google.maps.ControlPosition | null;
+ }
+ /**
+ * Options defining the properties of a StreetViewPanorama object.
+ */
+ export interface StreetViewPanoramaOptions {
+ /**
+ * The enabled/disabled state of the address control.
+ */
+ addressControl?: boolean | null;
+ /**
+ * The display options for the address control.
+ */
+ addressControlOptions?: google.maps.StreetViewAddressControlOptions | null;
+ /**
+ * The enabled/disabled state of click-to-go. Not applicable to custom panoramas.
+ * @defaultValue true
+ */
+ clickToGo?: 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.
+ */
+ controlSize?: number | null;
+ /**
+ * Enables/disables all default UI. May be overridden individually.
+ */
+ disableDefaultUI?: boolean | null;
+ /**
+ * Enables/disables zoom on double click.
+ * @defaultValue true
+ */
+ disableDoubleClickZoom?: boolean | null;
+ /**
+ * If true, the close button is displayed.
+ * @defaultValue false
+ */
+ enableCloseButton?: boolean | null;
+ /**
+ * The enabled/disabled state of the fullscreen control.
+ */
+ fullscreenControl?: boolean | null;
+ /**
+ * The display options for the fullscreen control.
+ */
+ fullscreenControlOptions?: google.maps.FullscreenControlOptions | null;
+ /**
+ * The enabled/disabled state of the imagery acquisition date control. Disabled by default.
+ */
+ imageDateControl?: boolean | null;
+ /**
+ * The enabled/disabled state of the links control.
+ */
+ linksControl?: boolean | null;
+ /**
+ * 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.
+ */
+ motionTracking?: boolean | null;
+ /**
+ * 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.
+ */
+ motionTrackingControl?: boolean | null;
+ /**
+ * The display options for the motion tracking control.
+ */
+ motionTrackingControlOptions?: google.maps.MotionTrackingControlOptions | null;
+ /**
+ * The enabled/disabled state of the pan control.
+ */
+ panControl?: boolean | null;
+ /**
+ * The display options for the pan control.
+ */
+ panControlOptions?: google.maps.PanControlOptions | null;
+ /**
+ * The panorama ID, which should be set when specifying a custom panorama.
+ */
+ pano?: string | null;
+ /**
+ * The LatLng position of the Street View panorama.
+ */
+ position?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ /**
+ * The camera orientation, specified as heading and pitch, for the panorama.
+ */
+ pov?: google.maps.StreetViewPov | null;
+ /**
+ * If false, disables scrollwheel zooming in Street View.
+ * @defaultValue true
+ */
+ scrollwheel?: boolean | null;
+ /**
+ * 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
+ */
+ showRoadLabels?: boolean | null;
+ /**
+ * If true, the Street View panorama is visible on load.
+ */
+ visible?: boolean | null;
+ /**
+ * The zoom of the panorama, specified as a number. A zoom of 0 gives a 180 degrees Field of View.
+ */
+ 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;
+ }
+ /**
+ * The properties of the tile set used in a Street View panorama.
+ */
+ export interface StreetViewTileData {
+ /**
+ * The heading (in degrees) at the center of the panoramic tiles.
+ */
+ centerHeading: number;
+ /**
+ * The size (in pixels) at which tiles will be rendered.
+ */
+ tileSize: google.maps.Size;
+ /**
+ * The size (in pixels) of the whole panorama's "world".
+ */
+ worldSize: google.maps.Size;
+ /**
+ * 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.
+ */
+ getTileUrl(pano: string, tileZoom: number, tileX: number, tileY: number): string;
+ }
+ /**
+ * This object is returned from various mouse events on the map and overlays, and contains all the fields shown below.
+ */
+ export interface MapMouseEvent {
+ /**
+ * 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).
+ */
+ domEvent: MouseEvent | TouchEvent | PointerEvent | KeyboardEvent | Event;
+ /**
+ * The latitude/longitude that was below the cursor when the event occurred.
+ */
+ latLng: google.maps.LatLng | null;
+ /**
+ * Prevents this event from propagating further.
+ */
+ stop(): void;
+ }
+ /**
+ * 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 LatLngAltitudeLiteral extends google.maps.LatLngLiteral {
+ /**
+ * Distance (in meters) above the ground surface. Negative value means underneath the ground surface.
+ * @defaultValue 0
+ */
+ altitude?: number | 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.
+ */
+ lat: number;
+ /**
+ * 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.
+ */
+ lng: number;
+ }
+ /**
+ * 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 interface CoordinateTransformer {
+
+ fromLatLngAltitude(latLngAltitude: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral, rotations?: Float32Array, scale?: Float32Array): Float64Array;
+
+ getCameraParams(): google.maps.CameraParams;
+ }
+ /**
+ * 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 interface Place {
+ /**
+ * The LatLng of the entity described by this place.
+ */
+ location?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ /**
+ * 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.
+ */
+ placeId?: string;
+ /**
+ * 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.
+ */
+ query?: string;
+ }
+
+ 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;
+ /**
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ */
+ 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;
+ }
+ /**
+ * Object literal which represents a circle.
+ */
+ export interface CircleLiteral extends google.maps.CircleOptions {
+ /**
+ * The center of the Circle.
+ */
+ center: google.maps.LatLng | google.maps.LatLngLiteral;
+ /**
+ * The radius in meters on the Earth's surface.
+ */
+ radius: number;
+ }
+
+ export interface GeometryLibrary {
+
+ encoding: typeof google.maps.geometry.encoding;
+
+ poly: typeof google.maps.geometry.poly;
+
+ spherical: typeof google.maps.geometry.spherical;
+ }
+ /**
+ * 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 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;
+ }
+
+ 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;
+
+ Attribution: typeof google.maps.places.Attribution;
+
+ 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;
+
+ BusinessStatus: typeof google.maps.places.BusinessStatus;
+
+ ConnectorAggregation: typeof google.maps.places.ConnectorAggregation;
+
+ ConsumerAlert: typeof google.maps.places.ConsumerAlert;
+
+ ConsumerAlertDetails: typeof google.maps.places.ConsumerAlertDetails;
+
+ 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;
+
+ 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;
+
+ PlaceContextualElement: typeof google.maps.places.PlaceContextualElement;
+
+ PlaceContextualListConfigElement: typeof google.maps.places.PlaceContextualListConfigElement;
+
+ PlaceContextualListLayout: typeof google.maps.places.PlaceContextualListLayout;
+
+ PlacePrediction: typeof google.maps.places.PlacePrediction;
+
+ PlacesService: typeof google.maps.places.PlacesService;
+
+ PlacesServiceStatus: typeof google.maps.places.PlacesServiceStatus;
+
+ 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;
+
+ StringRange: typeof google.maps.places.StringRange;
+ }
+
+ 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"): Promisetrue 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.MVCArraynull 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.MVCArrayDrawingManager.
+ */
+ export interface OverlayCompleteEvent {
+ /**
+ * The completed overlay.
+ */
+ overlay: google.maps.Marker | google.maps.Polygon | google.maps.Polyline | google.maps.Rectangle | google.maps.Circle;
+ /**
+ * The completed overlay's type.
+ */
+ type: google.maps.drawing.OverlayTypeString;
+ }
+ /**
+ * Options for the rendering of the drawing control.
+ */
+ export interface DrawingControlOptions {
+ /**
+ * The drawing modes to display in the drawing control, in the order in which they are to be displayed. The hand icon (which corresponds to the null drawing mode) is always available and is not to be specified in this array.
+ * @defaultValue [{@link google.maps.drawing.OverlayType.MARKER}, {@link google.maps.drawing.OverlayType.POLYLINE}, {@link google.maps.drawing.OverlayType.RECTANGLE}, {@link google.maps.drawing.OverlayType.CIRCLE}, {@link google.maps.drawing.OverlayType.POLYGON}]
+ */
+ drawingModes?: google.maps.drawing.OverlayTypeString[] | null;
+ /**
+ * Position id. Used to specify the position of the control on the map.
+ * @defaultValue {@link google.maps.ControlPosition.TOP_LEFT}
+ */
+ position?: google.maps.ControlPosition | null;
+ }
+ /**
+ * Options for the drawing manager.
+ */
+ export interface DrawingManagerOptions {
+ /**
+ * Options to apply to any new circles created with this DrawingManager. The center and radius properties are ignored, and the map property of a new circle is always set to the DrawingManager's map.
+ */
+ circleOptions?: google.maps.CircleOptions | null;
+ /**
+ * The enabled/disabled state of the drawing control.
+ * @defaultValue true
+ */
+ drawingControl?: boolean | null;
+ /**
+ * The display options for the drawing control.
+ */
+ drawingControlOptions?: google.maps.drawing.DrawingControlOptions | null;
+ /**
+ * The DrawingManager's drawing mode, which defines the type of overlay to be added on the map. Accepted values are 'marker', 'polygon', 'polyline', 'rectangle', 'circle', or null. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything.
+ */
+ drawingMode?: google.maps.drawing.OverlayTypeString | null;
+ /**
+ * The Map to which the DrawingManager is attached, which is the Map on which the overlays created will be placed.
+ */
+ map?: google.maps.Map | null;
+ /**
+ * Options to apply to any new markers created with this DrawingManager. The position property is ignored, and the map property of a new marker is always set to the DrawingManager's map.
+ */
+ markerOptions?: google.maps.MarkerOptions | null;
+ /**
+ * Options to apply to any new polygons created with this DrawingManager. The paths property is ignored, and the map property of a new polygon is always set to the DrawingManager's map.
+ */
+ polygonOptions?: google.maps.PolygonOptions | null;
+ /**
+ * Options to apply to any new polylines created with this DrawingManager. The path property is ignored, and the map property of a new polyline is always set to the DrawingManager's map.
+ */
+ polylineOptions?: google.maps.PolylineOptions | null;
+ /**
+ * Options to apply to any new rectangles created with this DrawingManager. The bounds property is ignored, and the map property of a new rectangle is always set to the DrawingManager's map.
+ */
+ rectangleOptions?: google.maps.RectangleOptions | null;
+ }
+ /**
+ * 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 Drawing library functionality in the Maps JavaScript API is deprecated. This API was deprecated in August 2025 and will be made unavailable in a later version of the Maps JavaScript API, releasing in May 2026. For more info, see https://developers.google.com/maps/deprecations
+ */
+ export class DrawingManager extends google.maps.MVCObject {
+ /**
+ * Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control.
+ * @param options
+ */
+ constructor(options?: google.maps.drawing.DrawingManagerOptions | null);
+ /**
+ * Returns the DrawingManager's drawing mode.
+ */
+ getDrawingMode(): google.maps.drawing.OverlayTypeString | null;
+ /**
+ * Returns the Map to which the DrawingManager is attached, which is the Map on which the overlays created will be placed.
+ */
+ getMap(): google.maps.Map | null;
+ /**
+ * Changes the DrawingManager's drawing mode, which defines the type of overlay to be added on the map. Accepted values are 'marker', 'polygon', 'polyline', 'rectangle', 'circle', or null. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything.
+ */
+ setDrawingMode(drawingMode: google.maps.drawing.OverlayTypeString | null): void;
+ /**
+ * Attaches the DrawingManager object to the specified Map.
+ */
+ setMap(map: google.maps.Map | null): void;
+ /**
+ * Sets the DrawingManager's options.
+ */
+ setOptions(options: google.maps.drawing.DrawingManagerOptions | null): void;
+ }
+ /**
+ * 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 {
+ /**
+ * Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete event is a circle.
+ */
+ CIRCLE = 'circle',
+ /**
+ * Specifies that the DrawingManager creates markers, and that the overlay given in the overlaycomplete event is a marker.
+ */
+ MARKER = 'marker',
+ /**
+ * 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.
+ */
+ RECTANGLE = 'rectangle',
+ }
+ export type OverlayTypeString = `${google.maps.drawing.OverlayType}`;
+}
+
+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;
+ /**
+ * 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;
+ /**
+ * 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;
+ /**
+ * 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;
+ /**
+ * 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;
+ /**
+ * 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;
+ /**
+ * 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.
+ */
+ destinationMarkers: google.maps.Marker[];
+ /**
+ * 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.
+ */
+ originMarkers: google.maps.Marker[];
+ /**
+ * 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.
+ */
+ successfulTaskMarkers: google.maps.Marker[];
+ /**
+ * 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.
+ */
+ taskOutcomeMarkers: google.maps.Marker[];
+ /**
+ * 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.
+ */
+ unsuccessfulTaskMarkers: google.maps.Marker[];
+ /**
+ * 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.
+ */
+ vehicleMarkers: google.maps.Marker[];
+ /**
+ * 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.
+ */
+ waypointMarkers: google.maps.Marker[];
+ /**
+ * 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.
+ */
+ anticipatedRoutePolylines: google.maps.Polyline[];
+ /**
+ * 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.
+ */
+ takenRoutePolylines: google.maps.Polyline[];
+ /**
+ * Adds a location provider to the map view. If the location provider is already added, no action is performed.
+ */
+ addLocationProvider(locationProvider: google.maps.journeySharing.LocationProvider): void;
+ /**
+ * Removes a location provider from the map view. If the location provider is not already added to the map view, no action is performed.
+ */
+ 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 {
+ /**
+ * Marker options.
+ */
+ 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 {
+ /**
+ * Default marker options.
+ */
+ 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 {
+ /**
+ * Polyline options.
+ */
+ polylineOptions?: google.maps.PolylineOptions | null;
+ /**
+ * Polyline visibility.
+ */
+ visible?: boolean | null;
+ }
+ /**
+ * PolylineSetup default options.
+ * @deprecated Polyline setup is deprecated. Use the PolylineCustomizationFunction methods for your location provider instead.
+ */
+ export interface DefaultPolylineSetupOptions {
+ /**
+ * Default polyline options.
+ */
+ defaultPolylineOptions: google.maps.PolylineOptions;
+ /**
+ * Default polyline visibility.
+ */
+ defaultVisible: boolean;
+ }
+ /**
+ * @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
+ */
+ tasks: google.maps.journeySharing.TaskInfo[];
+ }
+ /**
+ * VehicleJourneySegment type
+ */
+ export interface VehicleJourneySegment {
+ /**
+ * The travel distance from the previous stop to this stop, in meters.
+ */
+ drivingDistanceMeters: number | null;
+ /**
+ * The travel time from the previous stop this stop, in milliseconds.
+ */
+ drivingDurationMillis: number | null;
+ /**
+ * 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.
+ */
+ path: google.maps.LatLngLiteral[] | null;
+ /**
+ * Information about the stop.
+ */
+ stop: google.maps.journeySharing.DeliveryVehicleStop | null;
+ }
+ /**
+ * VehicleLocationUpdate type
+ */
+ export interface VehicleLocationUpdate {
+ /**
+ * The heading of the update. 0 corresponds to north, 180 to south.
+ */
+ heading: number | null;
+ /**
+ * The location of the update.
+ */
+ location: google.maps.LatLngLiteral | google.maps.LatLng | null;
+ /**
+ * The speed in kilometers per hour.
+ */
+ speedKilometersPerHour: number | null;
+ /**
+ * The time this update was received from the vehicle.
+ */
+ time: Date | null;
+ }
+ /**
+ * VehicleWaypoint type.
+ */
+ export interface VehicleWaypoint {
+ /**
+ * 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;
+ /**
+ * The location of the waypoint.
+ */
+ location: google.maps.LatLngLiteral | 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.
+ */
+ path: google.maps.LatLngLiteral[] | null;
+ /**
+ * 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.
+ */
+ speedReadingIntervals: google.maps.journeySharing.SpeedReadingInterval[] | null;
+ }
+ /**
+ * TripWaypoint type.
+ */
+ 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;
+ /**
+ * The location of the waypoint.
+ */
+ location: google.maps.LatLng | null;
+ /**
+ * 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.
+ */
+ path: google.maps.LatLng[] | null;
+ /**
+ * 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.
+ */
+ speedReadingIntervals: google.maps.journeySharing.SpeedReadingInterval[] | null;
+ /**
+ * The trip associated with this waypoint.
+ */
+ tripId: string | null;
+ /**
+ * The role this waypoint plays in this trip, such as pickup or dropoff.
+ */
+ waypointType: google.maps.journeySharing.WaypointTypeString | null;
+ }
+ /**
+ * The classification of polyline speed based on traffic data.
+ *
+ * Access by calling `const {Speed} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export enum Speed {
+ /**
+ * Normal speed, no slowdown is detected.
+ */
+ NORMAL = 'NORMAL',
+ /**
+ * Slowdown detected, but no traffic jam formed.
+ */
+ SLOW = 'SLOW',
+ /**
+ * Traffic jam detected.
+ */
+ 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 {
+ /**
+ * The zero-based index of the ending point of the interval in the path.
+ */
+ endPolylinePointIndex: number;
+ /**
+ * Traffic speed in this interval.
+ */
+ speed: google.maps.journeySharing.SpeedString;
+ /**
+ * The zero-based index of the starting point of the interval in the path.
+ */
+ startPolylinePointIndex: number;
+ }
+ /**
+ * Options for shipment location provider.
+ */
+ export interface FleetEngineShipmentLocationProviderOptions {
+ /**
+ * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through. id: the ID of the task. extraDurationMillis: the extra time it takes to perform the task, in milliseconds.
Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
+ */
+ activePolylineCustomization?: ((arg0: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ */
+ authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher;
+ /**
+ * Customization applied to the delivery vehicle marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Customization applied to the destination marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Minimum time between fetching location updates in milliseconds. If it takes longer than 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.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).
+ */
+ 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. 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.
Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
+ */
+ 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;
+ }
+ /**
+ * Shipment location provider.
+ * Access by calling `const {FleetEngineShipmentLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class FleetEngineShipmentLocationProvider extends google.maps.journeySharing.PollingLocationProvider {
+ /**
+ * Creates a new location provider for Fleet Engine shipment tracking.
+ * @param options Options for the location provider.
+ */
+ constructor(options: google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions);
+ /**
+ * The tracking ID for the task that this location provider observes. Set this field to begin tracking.
+ */
+ trackingId: string;
+ /**
+ * Explicitly refreshes the tracked location.
+ */
+ refresh(): void;
+ }
+ /**
+ * 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;
+ }
+ /**
+ * A time range.
+ */
+ export interface TimeWindow {
+ /**
+ * The end time of the time window (inclusive).
+ */
+ endTime: Date;
+ /**
+ * The start time of the time window (inclusive).
+ */
+ startTime: Date;
+ }
+ /**
+ * The details for a task tracking info object returned by Fleet Engine.
+ */
+ export interface TaskTrackingInfo {
+ /**
+ * Attributes assigned to the task.
+ */
+ attributes: { [key: string]: unknown };
+ /**
+ * The estimated arrival time to the stop location.
+ */
+ estimatedArrivalTime: Date | null;
+ /**
+ * The estimated completion time of a Task.
+ */
+ estimatedTaskCompletionTime: Date | null;
+ /**
+ * Information specific to the last location update.
+ */
+ latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null;
+ /**
+ * The name in the format "providers/{provider_id}/taskTrackingInfo/{tracking_id}", where 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.tracking_id represents the tracking ID.
+ */
+ name: string;
+ /**
+ * The location where the Task will be completed.
+ */
+ plannedLocation: google.maps.LatLng | null;
+ /**
+ * The total remaining distance in meters to the VehicleStop of interest.
+ */
+ remainingDrivingDistanceMeters: number | 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.
+ */
+ remainingStopCount: number | null;
+ /**
+ * A list of points which when connected forms a polyline of the vehicle's expected route to the location of this task.
+ */
+ routePolylinePoints: google.maps.LatLng[] | null;
+ /**
+ * The current execution state of the Task.
+ */
+ state: string | null;
+ /**
+ * The time window during which the task should be completed.
+ */
+ targetTimeWindow: google.maps.journeySharing.TimeWindow | null;
+ /**
+ * The outcome of attempting to execute a Task.
+ */
+ taskOutcome: string | null;
+ /**
+ * The time when the Task's outcome was set by the provider.
+ */
+ taskOutcomeTime: Date | null;
+ /**
+ * The tracking ID of a Task.
+ */
+ trackingId: string;
+ }
+ /**
+ * The details for a task returned by Fleet Engine.
+ */
+ export interface Task {
+ /**
+ * Attributes assigned to the task.
+ */
+ attributes: { [key: string]: unknown };
+ /**
+ * The timestamp of the estimated completion time of the task.
+ */
+ estimatedCompletionTime: Date | null;
+ /**
+ * Information specific to the last location update.
+ */
+ latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | 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.
+ */
+ name: string;
+ /**
+ * The outcome of the task.
+ */
+ outcome: string | null;
+ /**
+ * The location where the task was completed (from provider).
+ */
+ outcomeLocation: google.maps.LatLngLiteral | null;
+ /**
+ * The setter of the task outcome location ('PROVIDER' or 'LAST_VEHICLE_LOCATION').
+ */
+ outcomeLocationSource: string | null;
+ /**
+ * The timestamp of when the task's outcome was set (from provider).
+ */
+ outcomeTime: Date | null;
+ /**
+ * The location where the task is to be completed.
+ */
+ 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 tracking ID of the shipment.
+ */
+ trackingId: string | null;
+ /**
+ * The task type; for example, a break or shipment.
+ */
+ type: string;
+ /**
+ * The ID of the vehicle performing this task.
+ */
+ vehicleId: string | null;
+ }
+ /**
+ * Options for trip location provider.
+ */
+ export interface FleetEngineTripLocationProviderOptions {
+ /**
+ * 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).
+ */
+ activePolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ */
+ authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher;
+ /**
+ * Customization applied to the destination marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Customization applied to the origin marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ originMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Minimum time between fetching location updates in milliseconds. If it takes longer than 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.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.
+ */
+ 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).
+ */
+ remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => 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. 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.
Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
+ */
+ takenPolylineCustomization?: ((arg0: google.maps.journeySharing.TripPolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | 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.
+ */
+ tripId: string | null;
+ /**
+ * Customization applied to the vehicle marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.TripMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Customization applied to a waypoint marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ 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 {
+ /**
+ * Creates a new location provider for a Fleet Engine trip.
+ * @param options Options for the location provider.
+ */
+ constructor(options: google.maps.journeySharing.FleetEngineTripLocationProviderOptions);
+ /**
+ * The ID for the trip that this location provider observes. Set this field to begin tracking.
+ */
+ tripId: string;
+ /**
+ * 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.
+ */
+ static TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.TripPolylineCustomizationFunctionParams): void;
+ /**
+ * 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.
+ */
+ static TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION(params: google.maps.journeySharing.TripPolylineCustomizationFunctionParams): void;
+ /**
+ * Explicitly refreshes the tracked location.
+ */
+ refresh(): void;
+ }
+ /**
+ * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineTripLocationProvider.update} event is triggered.
+ */
+ export interface FleetEngineTripLocationProviderUpdateEvent {
+ /**
+ * The trip structure returned by the update. Unmodifiable.
+ */
+ trip: google.maps.journeySharing.Trip | null;
+ }
+ /**
+ * The details for a trip returned by Fleet Engine.
+ */
+ export interface Trip {
+ /**
+ * Location where the customer was dropped off.
+ */
+ actualDropOffLocation: google.maps.LatLngLiteral | null;
+ /**
+ * Location where the customer was picked up.
+ */
+ actualPickupLocation: google.maps.LatLngLiteral | null;
+ /**
+ * The estimated future time when the passengers will be dropped off, or the actual time when they were dropped off.
+ */
+ dropOffTime: Date | null;
+ /**
+ * Information specific to the last location update.
+ */
+ latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null;
+ /**
+ * In the format "providers/{provider_id}/trips/{trip_id}". The trip_id must be a unique identifier.
+ */
+ name: string;
+ /**
+ * Number of passengers on this trip; does not include the driver.
+ */
+ passengerCount: number;
+ /**
+ * The estimated future time when the passengers will be picked up, or the actual time when they were picked up.
+ */
+ pickupTime: Date | null;
+ /**
+ * Location where the customer indicates they will be dropped off.
+ */
+ plannedDropOffLocation: google.maps.LatLngLiteral | null;
+ /**
+ * Location where customer indicates they will be picked up.
+ */
+ plannedPickupLocation: google.maps.LatLngLiteral | null;
+ /**
+ * An array of waypoints indicating the path from the current location to the drop-off point.
+ */
+ remainingWaypoints: google.maps.journeySharing.VehicleWaypoint[];
+ /**
+ * 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.
+ */
+ 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;
+ }
+ /**
+ * 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 state of the task. Valid values are OPEN or CLOSED.
+ */
+ state: string | null;
+ }
+ /**
+ * Options for delivery vehicle location provider.
+ */
+ export interface FleetEngineDeliveryVehicleLocationProviderOptions {
+ /**
+ * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through. 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.
Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
+ */
+ activePolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ */
+ authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher;
+ /**
+ * 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.
+ */
+ deliveryVehicleId: string | null;
+ /**
+ * Customization applied to the delivery vehicle marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Customization applied to a planned stop marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ plannedStopMarkerCustomization?: ((arg0: google.maps.journeySharing.PlannedStopMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Minimum time between fetching location updates in milliseconds. If it takes longer than 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.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.
+ */
+ 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).
+ */
+ remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * Boolean to show or hide outcome locations for the fetched tasks.
+ */
+ shouldShowOutcomeLocations: boolean | 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.
+ */
+ shouldShowTasks: boolean | null;
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number | null;
+ /**
+ * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through. 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.
Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
+ */
+ takenPolylineCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * Filter options to apply when fetching tasks. The options can include specific vehicle, time, and task status.
+ */
+ taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions | null;
+ /**
+ * Customization applied to a task marker. A task marker is rendered at the planned location of each task assigned to the delivery vehicle. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ taskMarkerCustomization?: ((arg0: google.maps.journeySharing.TaskMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * 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. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ taskOutcomeMarkerCustomization?: ((arg0: google.maps.journeySharing.TaskMarkerCustomizationFunctionParams) => void) | 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 {
+ /**
+ * Creates a new location provider for a Fleet Engine delivery vehicle.
+ * @param options Options to pass to the location provider.
+ */
+ constructor(options: google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions);
+ /**
+ * ID for the vehicle that this location provider observes. Set this field to track a vehicle.
+ */
+ deliveryVehicleId: string;
+ /**
+ * Optionally allow users to display the task's outcome location.
+ */
+ shouldShowOutcomeLocations: boolean | null;
+ /**
+ * Optionally allow users to display fetched tasks.
+ */
+ shouldShowTasks: boolean | null;
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number;
+ /**
+ * Returns the filter options to apply when fetching tasks.
+ */
+ taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions;
+ }
+ /**
+ * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider.update} event is triggered.
+ */
+ export interface FleetEngineDeliveryVehicleLocationProviderUpdateEvent {
+ /**
+ * The journey segments that have been completed by this vehicle. Unmodifiable.
+ */
+ completedVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[] | null;
+ /**
+ * The delivery vehicle data structure returned by the update. Unmodifiable.
+ */
+ deliveryVehicle: google.maps.journeySharing.DeliveryVehicle | null;
+ /**
+ * The list of tasks served by this delivery vehicle. Unmodifiable.
+ */
+ tasks: google.maps.journeySharing.Task[] | null;
+ }
+ /**
+ * Options for delivery fleet location provider.
+ */
+ export interface FleetEngineDeliveryFleetLocationProviderOptions {
+ /**
+ * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ */
+ authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher;
+ /**
+ * A filter query to apply when fetching delivery vehicles. This filter is passed directly to Fleet Engine. 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.
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".
+ */
+ deliveryVehicleFilter: string | null;
+ /**
+ * Customization applied to a delivery vehicle marker.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ deliveryVehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams) => void) | null;
+ /**
+ * 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.
+ */
+ locationRestriction: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ /**
+ * The consumer's project ID from Google Cloud Console.
+ */
+ projectId: string;
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number | null;
+ }
+ /**
+ * Delivery Fleet Location Provider.
+ * Access by calling `const {FleetEngineDeliveryFleetLocationProvider} = await google.maps.importLibrary("journeySharing");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class FleetEngineDeliveryFleetLocationProvider extends google.maps.journeySharing.PollingLocationProvider {
+ /**
+ * Creates a new location provider for vehicles tracked by Fleet Engine.
+ * @param options Options to pass to the location provider.
+ */
+ constructor(options: google.maps.journeySharing.FleetEngineDeliveryFleetLocationProviderOptions);
+ /**
+ * The filter applied when fetching the delivery vehicles.
+ */
+ deliveryVehicleFilter?: string | null;
+ /**
+ * 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.
+ */
+ locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number;
+ }
+ /**
+ * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider.update} event is triggered.
+ */
+ export interface FleetEngineDeliveryFleetLocationProviderUpdateEvent {
+ /**
+ * The list of delivery vehicles returned by the query. Unmodifiable.
+ */
+ deliveryVehicles: google.maps.journeySharing.DeliveryVehicle[] | null;
+ }
+ /**
+ * The details for a delivery vehicle returned by Fleet Engine.
+ */
+ 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;
+ /**
+ * In the format "providers/{provider_id}/deliveryVehicles/{delivery_vehicle_id}". The delivery_vehicle_id must be a unique identifier.
+ */
+ name: string;
+ /**
+ * The current navigation status of the vehicle.
+ */
+ navigationStatus: string;
+ /**
+ * The remaining driving distance in the current route segment, in meters.
+ */
+ remainingDistanceMeters: number;
+ /**
+ * The remaining driving duration in the current route segment, in milliseconds.
+ */
+ remainingDurationMillis: number | null;
+ /**
+ * 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}.
+ */
+ remainingVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[];
+ }
+ /**
+ * Options for vehicle location provider.
+ */
+ export interface FleetEngineVehicleLocationProviderOptions {
+ /**
+ * Customization applied to the active polyline. An active polyline corresponds to a portion of the route the vehicle is currently traversing through. 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.
Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
+ */
+ activePolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ */
+ authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher;
+ /**
+ * Customization applied to the vehicle trip destination marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ destinationMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Customization applied to the vehicle trip intermediate destination markers. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ intermediateDestinationMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Customization applied to the vehicle trip origin marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ originMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | null;
+ /**
+ * Minimum time between fetching location updates in milliseconds. If it takes longer than 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.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.
+ */
+ 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).
+ */
+ remainingPolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number | null;
+ /**
+ * Customization applied to the taken polyline. A taken polyline corresponds to a portion of the route the vehicle has already traversed through. 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.
Use this field to specify custom styling (such as polyline color) and interactivity (such as click handling).
+ */
+ takenPolylineCustomization?: ((arg0: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams) => void) | google.maps.PolylineOptions | null;
+ /**
+ * 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.
+ */
+ vehicleId: string | null;
+ /**
+ * Customization applied to the vehicle marker. 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.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams) => void) | google.maps.MarkerOptions | 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 {
+ /**
+ * Creates a new location provider for a Fleet Engine vehicle.
+ * @param options Options to pass to the location provider.
+ */
+ constructor(options: google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions);
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number;
+ /**
+ * ID for the vehicle that this location provider observes. Set this field to track a vehicle.
+ */
+ 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;
+ }
+ /**
+ * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider.update} event is triggered.
+ */
+ export interface FleetEngineVehicleLocationProviderUpdateEvent {
+ /**
+ * The list of trips completed by this vehicle. Unmodifiable.
+ */
+ trips: google.maps.journeySharing.Trip[] | null;
+ /**
+ * The vehicle data structure returned by the update. Unmodifiable.
+ */
+ vehicle: google.maps.journeySharing.Vehicle | null;
+ }
+ /**
+ * Options for fleet location provider.
+ */
+ export interface FleetEngineFleetLocationProviderOptions {
+ /**
+ * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ */
+ authTokenFetcher: google.maps.journeySharing.AuthTokenFetcher;
+ /**
+ * 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.
+ */
+ locationRestriction: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ /**
+ * The consumer's project ID from Google Cloud Console.
+ */
+ projectId: string;
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number | null;
+ /**
+ * A filter query to apply when fetching vehicles. This filter is passed directly to Fleet Engine. 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.
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".
+ */
+ vehicleFilter: string | null;
+ /**
+ * Customization applied to a vehicle marker.
Use this field to specify custom styling (such as marker icon) and interactivity (such as click handling).
+ */
+ vehicleMarkerCustomization?: ((arg0: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams) => void) | 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 {
+ /**
+ * Creates a new location provider for vehicles tracked by Fleet Engine.
+ * @param options Options to pass to the location provider.
+ */
+ constructor(options: google.maps.journeySharing.FleetEngineFleetLocationProviderOptions);
+ /**
+ * 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.
+ */
+ locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ /**
+ * 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.
+ */
+ staleLocationThresholdMillis: number;
+ /**
+ * The filter applied when fetching the vehicles.
+ */
+ vehicleFilter?: string | null;
+ }
+ /**
+ * The event object passed to the event handler when the {@link google.maps.journeySharing.FleetEngineFleetLocationProvider.update} event is triggered.
+ */
+ export interface FleetEngineFleetLocationProviderUpdateEvent {
+ /**
+ * The list of vehicles returned by the query. Unmodifiable.
+ */
+ vehicles: google.maps.journeySharing.Vehicle[] | null;
+ }
+ /**
+ * The details for a vehicle returned by Fleet Engine.
+ */
+ export interface Vehicle {
+ /**
+ * Custom vehicle attributes.
+ */
+ attributes: { [key: string]: unknown };
+ /**
+ * The waypoint where current route segment ends.
+ */
+ currentRouteSegmentEndPoint: google.maps.journeySharing.TripWaypoint | null;
+ /**
+ * Time when the current route segment was set.
+ */
+ currentRouteSegmentVersion: Date | null;
+ /**
+ * List of trip IDs for trips currently assigned to this vehicle.
+ */
+ currentTrips: string[] | null;
+ /**
+ * The ETA to the first entry in the waypoints field.
+ */
+ etaToFirstWaypoint: Date | null;
+ /**
+ * The last reported location of the vehicle.
+ */
+ latestLocation: google.maps.journeySharing.VehicleLocationUpdate | null;
+ /**
+ * The total numbers of riders this vehicle can carry. The driver is not considered in this value.
+ */
+ maximumCapacity: number | null;
+ /**
+ * In the format "providers/{provider_id}/vehicles/{vehicle_id}". The vehicle_id must be a unique identifier.
+ */
+ name: string;
+ /**
+ * The current navigation status of the vehicle.
+ */
+ navigationStatus: google.maps.journeySharing.VehicleNavigationStatusString;
+ /**
+ * The remaining driving distance in the current route segment, in meters.
+ */
+ remainingDistanceMeters: number;
+ /**
+ * Trip types supported by this vehicle.
+ */
+ supportedTripTypes: google.maps.journeySharing.TripTypeString[] | null;
+ /**
+ * The vehicle state.
+ */
+ vehicleState: google.maps.journeySharing.VehicleStateString;
+ /**
+ * The type of this vehicle.
+ */
+ vehicleType: google.maps.journeySharing.VehicleTypeString;
+ /**
+ * The remaining waypoints assigned to this Vehicle.
+ */
+ waypoints: google.maps.journeySharing.TripWaypoint[] | null;
+ /**
+ * Last time the waypoints field was updated.
+ */
+ waypointsVersion: Date | null;
+ }
+ /**
+ * 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 interface MarkerCustomizationFunctionParams {
+ /**
+ * The default options used to create this marker.
+ */
+ defaultOptions: google.maps.MarkerOptions;
+ /**
+ * 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.
+ */
+ isNew: boolean;
+ /**
+ * The marker. Any customizations should be made to this object directly.
+ */
+ marker: google.maps.Marker;
+ }
+ /**
+ * 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 {
+ /**
+ * The delivery vehicle represented by this marker.
+ */
+ vehicle: google.maps.journeySharing.DeliveryVehicle;
+ }
+ /**
+ * Parameters specific to marker customization functions that apply options to markers representing planned stops. Used by {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.plannedStopMarkerCustomization}.
+ */
+ export interface PlannedStopMarkerCustomizationFunctionParams extends google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams {
+ /**
+ * The 0-based index of this stop in the list of remaining stops.
+ */
+ stopIndex: number;
+ }
+ /**
+ * 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 interface TaskMarkerCustomizationFunctionParams extends google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams {
+ /**
+ * The task location represented by this marker.
+ */
+ task: google.maps.journeySharing.Task;
+ }
+ /**
+ * 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 ShipmentMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams {
+ /**
+ * Information for the task associated with this marker.
+ */
+ taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo;
+ }
+ /**
+ * 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 interface TripMarkerCustomizationFunctionParams extends google.maps.journeySharing.MarkerCustomizationFunctionParams {
+ /**
+ * The trip associated with this marker. 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.
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;
+ }
+ /**
+ * 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 {
+ /**
+ * 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;
+ }
+ /**
+ * 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 {
+ /**
+ * The vehicle represented by this marker.
+ */
+ vehicle: google.maps.journeySharing.Vehicle;
+ }
+ /**
+ * 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 {
+ /**
+ * 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;
+ }
+ /**
+ * 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 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[];
+ }
+ /**
+ * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineShipmentLocationProvider}.
+ */
+ export interface ShipmentPolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams {
+ /**
+ * Information for the task associated with this polyline.
+ */
+ taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo;
+ }
+ /**
+ * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineTripLocationProvider}.
+ */
+ export interface TripPolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams {
+ /**
+ * The trip associated with this polyline.
+ */
+ trip: google.maps.journeySharing.Trip;
+ }
+ /**
+ * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineVehicleLocationProvider}.
+ */
+ export interface VehiclePolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams {
+ /**
+ * The vehicle traversing through this polyline.
+ */
+ vehicle: google.maps.journeySharing.Vehicle;
+ }
+ /**
+ * Parameters specific to polyline customization functions for {@link google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProvider}.
+ */
+ export interface DeliveryVehiclePolylineCustomizationFunctionParams extends google.maps.journeySharing.PolylineCustomizationFunctionParams {
+ /**
+ * The delivery vehicle traversing through this polyline.
+ */
+ deliveryVehicle: google.maps.journeySharing.DeliveryVehicle;
+ }
+}
+
+declare namespace google.maps.places {
+ /**
+ * The options that can be set on an Autocomplete object.
+ */
+ 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;
+ /**
+ * 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.
+ */
+ types?: string[];
+ /**
+ * 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'].
+ */
+ placeIdOnly?: boolean;
+ }
+ /**
+ * Represents a single autocomplete prediction.
+ */
+ 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;
+ /**
+ * 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.
+ */
+ matched_substrings: google.maps.places.PredictionSubstring[];
+ /**
+ * 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}).
+ */
+ place_id: string;
+ /**
+ * 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.
+ */
+ structured_formatting: google.maps.places.StructuredFormatting;
+ /**
+ * Information about individual terms in the above description, from most to least specific. For example, "Taco Bell", "Willitis", and "CA".
+ */
+ terms: google.maps.places.PredictionTerm[];
+ /**
+ * An array of types that the prediction belongs to, for example 'establishment' or 'geocode'.
+ */
+ types: string[];
+ }
+ /**
+ * Represents a prediction term.
+ */
+ export interface PredictionTerm {
+ /**
+ * The offset, in unicode characters, of the start of this term in the description of the place.
+ */
+ offset: number;
+ /**
+ * The value of this term, for example, "Taco Bell".
+ */
+ value: string;
+ }
+ /**
+ * Represents a prediction substring.
+ */
+ export interface PredictionSubstring {
+ /**
+ * The length of the substring.
+ */
+ length: number;
+ /**
+ * The offset to the substring's start within the description string.
+ */
+ offset: 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 {
+ /**
+ * This is the main text part of the unformatted description of the place suggested by the Places service. Usually the name of the place.
+ */
+ main_text: string;
+ /**
+ * 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.
+ */
+ main_text_matched_substrings: google.maps.places.PredictionSubstring[];
+ /**
+ * This is the secondary text part of the unformatted description of the place suggested by the Places service. Usually the location of the place.
+ */
+ secondary_text: string;
+ }
+ /**
+ * 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.
+ */
+ input: string;
+ /**
+ * 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.
+ */
+ language?: string | null;
+ /**
+ * A soft boundary or hint to use when searching for places.
+ */
+ locationBias?: google.maps.places.LocationBias | null;
+ /**
+ * Bounds to constrain search results.
+ */
+ locationRestriction?: google.maps.places.LocationRestriction | null;
+ /**
+ * The character position in the input term at which the service uses text for predictions (the position of the cursor in the input field).
+ */
+ offset?: number;
+ /**
+ * The location where {@link google.maps.places.AutocompletePrediction.distance_meters} is calculated from.
+ */
+ origin?: google.maps.LatLng | google.maps.LatLngLiteral;
+ /**
+ * 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").
+ */
+ region?: string | null;
+ /**
+ * Unique reference used to bundle individual requests into sessions.
+ */
+ sessionToken?: google.maps.places.AutocompleteSessionToken;
+ /**
+ * 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.
+ */
+ types?: string[];
+ /**
+ * 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.
+ */
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
+ /**
+ * 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.
+ */
+ location?: google.maps.LatLng;
+ /**
+ * 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.
+ */
+ radius?: number;
+ }
+ /**
+ * 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).
+ *
+ * Access by calling `const {BusinessStatus} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export enum BusinessStatus {
+ /**
+ * The business is closed permanently.
+ */
+ CLOSED_PERMANENTLY = 'CLOSED_PERMANENTLY',
+ /**
+ * The business is closed temporarily.
+ */
+ CLOSED_TEMPORARILY = 'CLOSED_TEMPORARILY',
+ /**
+ * The business is operating normally.
+ */
+ OPERATIONAL = 'OPERATIONAL',
+ }
+ export type BusinessStatusString = `${google.maps.places.BusinessStatus}`;
+ /**
+ * Defines the component restrictions that can be used with the autocomplete service.
+ */
+ export interface ComponentRestrictions {
+ /**
+ * 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.
+ */
+ country: string | string[] | null;
+ }
+ /**
+ * A Place details query to be sent to the PlacesService.
+ */
+ 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[];
+ /**
+ * A language identifier for the language in which details should be returned. See the list of supported languages.
+ */
+ language?: string | null;
+ /**
+ * The Place ID of the Place for which details are being requested.
+ */
+ placeId: string;
+ /**
+ * 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").
+ */
+ region?: string | null;
+ /**
+ * Unique reference used to bundle the details request with an autocomplete session.
+ */
+ sessionToken?: google.maps.places.AutocompleteSessionToken;
+ }
+ /**
+ * Represents a photo element of a Place.
+ */
+ export interface PlacePhoto {
+ /**
+ * The height of the photo in pixels.
+ */
+ height: number;
+ /**
+ * Attribution text to be displayed for this photo.
+ */
+ html_attributions: string[];
+ /**
+ * The width of the photo in pixels.
+ */
+ width: number;
+ /**
+ * Returns the image URL corresponding to the specified options.
+ */
+ getUrl(opts?: google.maps.places.PhotoOptions): string;
+ }
+ /**
+ * Defines photo-requesting options.
+ */
+ export interface PhotoOptions {
+ /**
+ * The maximum height in pixels of the returned image.
+ */
+ maxHeight?: number | null;
+ /**
+ * The maximum width in pixels of the returned image.
+ */
+ maxWidth?: number | null;
+ }
+ /**
+ * Represents a single review of a place.
+ */
+ 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;
+ /**
+ * The rating of this review, a number between 1.0 and 5.0 (inclusive).
+ */
+ rating?: number;
+ /**
+ * 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".
+ */
+ relative_time_description: string;
+ /**
+ * The text of a review.
+ */
+ text: string;
+ /**
+ * Timestamp for the review, expressed in seconds since epoch.
+ */
+ time: number;
+ /**
+ * The aspects rated by the review. The ratings on a scale of 0 to 3.
+ * @deprecated This field is no longer available.
+ */
+ 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 {
+ /**
+ * 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.
+ */
+ rating: number;
+ /**
+ * The aspect type. For example, "food", "decor", "service", or "overall".
+ */
+ type: string;
+ }
+ /**
+ * Defines information about a Place.
+ */
+ export interface PlaceResult {
+ /**
+ * The collection of address components for this Place’s location. Only available with {@link google.maps.places.PlacesService.getDetails}.
+ */
+ address_components?: google.maps.GeocoderAddressComponent[];
+ /**
+ * The representation of the Place’s address in the adr microformat. Only available with {@link google.maps.places.PlacesService.getDetails}.
+ */
+ adr_address?: string;
+ /**
+ * The rated aspects of this Place, based on Google and Zagat user reviews. The ratings are on a scale of 0 to 30.
+ */
+ aspects?: google.maps.places.PlaceAspectRating[];
+ /**
+ * 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.
+ */
+ business_status?: google.maps.places.BusinessStatusString;
+ /**
+ * The Place’s full address.
+ */
+ formatted_address?: string;
+ /**
+ * The Place’s phone number, formatted according to the number's regional convention. Only available with {@link google.maps.places.PlacesService.getDetails}.
+ */
+ formatted_phone_number?: string;
+ /**
+ * The Place’s geometry-related information.
+ */
+ geometry?: google.maps.places.PlaceGeometry;
+ /**
+ * 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.
+ */
+ html_attributions?: string[];
+ /**
+ * URL to an image resource that can be used to represent this Place’s category.
+ */
+ icon?: string;
+ /**
+ * Background color for use with a Place's icon. See also {@link google.maps.places.PlaceResult.icon_mask_base_uri}.
+ */
+ icon_background_color?: string;
+ /**
+ * A truncated URL to an icon mask. Access different icon types by appending a file extension to the end (i.e. .svg or .png).
+ */
+ icon_mask_base_uri?: string;
+ /**
+ * 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}.
+ */
+ international_phone_number?: string;
+ /**
+ * 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).
+ */
+ name?: string;
+ /**
+ * Defines when the Place opens or closes.
+ */
+ opening_hours?: google.maps.places.PlaceOpeningHours;
+ /**
+ * Photos of this Place. The collection will contain up to ten {@link google.maps.places.PlacePhoto} objects.
+ */
+ photos?: google.maps.places.PlacePhoto[];
+ /**
+ * A unique identifier for the Place.
+ */
+ place_id?: string;
+ /**
+ * Defines Open Location Codes or "plus codes" for the Place.
+ */
+ plus_code?: google.maps.places.PlacePlusCode;
+ /**
+ * The price level of the Place, on a scale of 0 to 4. Price levels are interpreted as follows:
+ */
+ price_level?: number;
+ /**
+ * A rating, between 1.0 to 5.0, based on user reviews of this Place.
+ */
+ rating?: number;
+ /**
+ * A list of reviews of this Place. Only available with {@link google.maps.places.PlacesService.getDetails}.
+ */
+ reviews?: google.maps.places.PlaceReview[];
+ /**
+ * An array of types for this Place (for example, 0: Free 1: Inexpensive 2: Moderate 3: Expensive 4: Very Expensive ["political", "locality"] or ["restaurant", "establishment"]).
+ */
+ types?: string[];
+ /**
+ * 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}.
+ */
+ url?: string;
+ /**
+ * The number of user ratings which contributed to this Place’s {@link google.maps.places.PlaceResult.rating}.
*/
- results: google.maps.ElevationResult[];
+ user_ratings_total?: number;
+ /**
+ * 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}.
+ */
+ utc_offset_minutes?: number;
+ /**
+ * 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}.
+ */
+ vicinity?: string;
+ /**
+ * The authoritative website for this Place, such as a business' homepage. Only available with {@link google.maps.places.PlacesService.getDetails}.
+ */
+ website?: string;
+ /**
+ * 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
+ */
+ utc_offset?: number;
+ /**
+ * 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.
+ */
+ permanently_closed?: boolean;
}
/**
- * 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}.
+ * Defines information about the geometry of a Place.
*/
- export interface Place {
+ export interface PlaceGeometry {
/**
- * The LatLng of the entity described by this place.
+ * The Place’s position.
*/
- location?: google.maps.LatLng | null | google.maps.LatLngLiteral;
+ 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 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}.
*/
- placeId?: string;
+ viewport?: google.maps.LatLngBounds;
+ }
+ /**
+ * Defines information about the opening hours of a Place.
+ */
+ export interface PlaceOpeningHours {
/**
- * 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.
+ * 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}.
*/
- query?: string;
+ periods?: google.maps.places.PlaceOpeningHoursPeriod[];
+ /**
+ * 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.
+ */
+ weekday_text?: string[];
+ /**
+ * 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
+ */
+ open_now?: boolean;
+ /**
+ * 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.
+ */
+ isOpen(date?: Date): boolean | undefined;
}
/**
- * 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}.
+ * 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 PlaceFeature extends google.maps.Feature {
+ export interface PlaceOpeningHoursPeriod {
/**
- * 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.
+ * The closing time for the Place.
*/
- fetchPlace(): Promise0, 6], starting on Sunday. For example, 2 means Tuesday.
+ */
+ day: number;
+ /**
+ * 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.
+ */
+ hours: number;
+ /**
+ * 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.
+ */
+ minutes: number;
+ /**
+ * 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.
+ */
+ nextDate?: number;
+ /**
+ * 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.
+ */
+ time: string;
}
/**
- * Access by calling `const {Point} = await
- * google.maps.importLibrary("core")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 class Point {
+ export interface PlacePlusCode {
/**
- * Access by calling `const {Point} = await
- * google.maps.importLibrary("core")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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.
*/
- constructor(x: number, y: number);
+ compound_code?: string;
/**
- * Compares two Points
+ * A plus code with a 1/8000th of a degree by 1/8000th of a degree area. For example, "8FVC9G8F+5W".
*/
- equals(other: google.maps.Point | null): boolean;
+ global_code: string;
+ }
+ /**
+ * An object used to fetch additional pages of Places results.
+ */
+ export interface PlaceSearchPagination {
/**
- * Returns a string representation of this Point.
+ * Indicates if further results are available. true when there is an additional results page.
*/
- toString(): string;
+ hasNextPage: boolean;
/**
- * The X coordinate
+ * Fetches the next page of results. Uses the same callback function that was provided to the first search request.
*/
- x: number;
+ nextPage(): void;
+ }
+ /**
+ * A Place search query to be sent to the PlacesService.
+ */
+ export interface PlaceSearchRequest {
/**
- * The Y coordinate
+ * The bounds within which to search for Places. Both location and radius will be ignored if bounds is set.
*/
- y: number;
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
+ /**
+ * 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.
+ */
+ keyword?: 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 location around which to search for Places.
+ */
+ location?: google.maps.LatLng | google.maps.LatLngLiteral;
+ /**
+ * 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.
+ */
+ maxPriceLevel?: number;
+ /**
+ * 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.
+ */
+ minPriceLevel?: number;
+ /**
+ * Restricts results to only those places that are open right now.
+ */
+ openNow?: boolean;
+ /**
+ * The distance from the given location within which to search for Places, in meters. The maximum allowed value is 50 000.
+ */
+ radius?: number;
+ /**
+ * 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}
+ */
+ rankBy?: google.maps.places.RankBy;
+ /**
+ * 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.
+ */
+ type?: string;
+ /**
+ * 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.
+ */
+ name?: string;
}
/**
- * This object is returned from mouse events on polylines and polygons.
+ * Represents a single Query Autocomplete prediction.
*/
- export interface PolyMouseEvent extends google.maps.MapMouseEvent {
+ export interface QueryAutocompletePrediction {
/**
- * 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.
+ * This is the unformatted version of the query suggested by the Places service.
*/
- edge?: number;
+ description: string;
/**
- * 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.
+ * 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.
*/
- path?: number;
+ matched_substrings: google.maps.places.PredictionSubstring[];
/**
- * 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.
+ * 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}).
*/
- vertex?: number;
+ 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[];
}
/**
- * 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.
+ * A QueryAutocompletion request to be sent to the QueryAutocompleteService.
*/
- export class Polygon extends google.maps.MVCObject {
+ export interface QueryAutocompletionRequest {
/**
- * 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.
+ * 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.
*/
- constructor(opts?: google.maps.PolygonOptions | null);
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
/**
- * Returns whether this shape can be dragged by the user.
+ * The user entered input string.
*/
- getDraggable(): boolean;
+ input: string;
/**
- * Returns whether this shape can be edited by the user.
+ * Location for prediction biasing. Predictions will be biased towards the given location and radius. Alternatively, bounds can be used.
*/
- getEditable(): boolean;
+ location?: google.maps.LatLng;
/**
- * Returns the map on which this shape is attached.
+ * The character position in the input term at which the service uses text for predictions (the position of the cursor in the input field).
*/
- getMap(): google.maps.Map | null;
+ offset?: number;
/**
- * Retrieves the first path.
+ * 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.
*/
- getPath(): google.maps.MVCArray['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").
*/
- getPaths(): google.maps.MVCArraytrue, the user can drag this shape over the map.
- * The geodesic property defines the mode of dragging.
+ * The bias used when searching for Place. The result will be biased towards, but not restricted to, the given {@link google.maps.places.LocationBias}.
*/
- setDraggable(draggable: boolean): void;
+ locationBias?: google.maps.places.LocationBias;
/**
- * If set to true, the user can edit this shape by dragging the
- * control points shown at the vertices and on each segment.
+ * The phone number of the place to look up. Format must be E.164.
*/
- setEditable(editable: boolean): void;
+ phoneNumber: string;
+ }
+ /**
+ * A find place from text search request to be sent to {@link google.maps.places.PlacesService.findPlaceFromQuery}.
+ */
+ export interface FindPlaceFromQueryRequest {
/**
- * Renders this shape on the specified map. If map is set to
- * null, the shape will be removed.
+ * 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").
*/
- setMap(map: google.maps.Map | null): void;
- setOptions(options: google.maps.PolygonOptions | null): void;
+ fields: string[];
/**
- * Sets the first path. See PolygonOptions for more details.
+ * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages.
*/
- setPath(
- path:
- | google.maps.MVCArrayfalse.
+ * The request's query. For example, the name or address of a place.
*/
- setVisible(visible: boolean): void;
+ query: string;
+ }
+ /**
+ * The options that can be set on a SearchBox object.
+ */
+ export interface SearchBoxOptions {
+ /**
+ * The area towards which to bias query predictions. Predictions are biased towards, but not restricted to, queries targeting these bounds.
+ */
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
}
/**
- * PolygonOptions object used to define the properties that can be set on a
- * Polygon.
+ * A text search request to be sent to the PlacesService.
*/
- export interface PolygonOptions {
+ export interface TextSearchRequest {
/**
- * Indicates whether this Polygon handles mouse events.
- * @defaultValue true
+ * 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.
*/
- clickable?: boolean | null;
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
/**
- * If set to true, the user can drag this shape over the map.
- * The geodesic property defines the mode of dragging.
- * @defaultValue false
+ * A language identifier for the language in which names and addresses should be returned, when possible. See the list of supported languages.
*/
- draggable?: boolean | null;
+ language?: string | 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 center of the area used to bias results when searching for Places.
*/
- editable?: boolean | null;
+ location?: google.maps.LatLng | google.maps.LatLngLiteral;
/**
- * The fill color. All CSS3 colors are supported except for extended named
- * colors.
+ * 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').
*/
- fillColor?: string | null;
+ query?: string;
+ /**
+ * The radius of the area used to bias results when searching for Places, in meters.
+ */
+ radius?: number;
+ /**
+ * 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").
+ */
+ region?: 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.
+ */
+ 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 {
/**
- * The fill opacity between 0.0 and 1.0
+ * Unstructured address lines describing the lower levels of an address.
*/
- fillOpacity?: number | null;
+ get addressLines(): 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
+ * The highest administrative subdivision which is used for postal addresses of a country or region.
*/
- geodesic?: boolean | null;
+ get administrativeArea(): string | null;
/**
- * Map on which to display Polygon.
+ * BCP-47 language code of the contents of this address. Examples: "zh-Hant", "ja", "ja-Latn", "en".
*/
- map?: google.maps.Map | null;
+ get languageCode(): string | 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.
+ * Generally refers to the city/town portion of the address.
*/
- paths?: google.maps.MVCArraytrue
+ * Sorting code of the address.
*/
- visible?: boolean | null;
+ get sortingCode(): string | null;
/**
- * The zIndex compared to other polys.
+ * Sublocality of the address such as neighborhoods, boroughs, or districts.
*/
- zIndex?: number | null;
+ get sublocality(): string | null;
+ toJSON(key?: string): unknown;
}
/**
- * 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.
+ * Data for hydrating a PostalAddress.
*/
- export class Polyline extends google.maps.MVCObject {
+ export interface PostalAddressLiteral {
/**
- * 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.
+ * See {@link google.maps.places.PostalAddress.addressLines}.
*/
- constructor(opts?: google.maps.PolylineOptions | null);
+ addressLines?: Iterabletrue, the user can drag this shape over the map.
- * The geodesic property defines the mode of dragging.
+ * See {@link google.maps.places.PostalAddress.recipients}.
*/
- setDraggable(draggable: boolean): void;
+ recipients?: Iterabletrue, the user can edit this shape by dragging the
- * control points shown at the vertices and on each segment.
+ * See {@link google.maps.places.PostalAddress.regionCode}.
*/
- setEditable(editable: boolean): void;
+ regionCode: string;
/**
- * Renders this shape on the specified map. If map is set to
- * null, the shape will be removed.
+ * See {@link google.maps.places.PostalAddress.sortingCode}.
*/
- setMap(map: google.maps.Map | null): void;
- setOptions(options: google.maps.PolylineOptions | null): void;
+ sortingCode?: string | null;
/**
- * Sets the path. See PolylineOptions for more details.
+ * See {@link google.maps.places.PostalAddress.sublocality}.
*/
- setPath(
- path:
- | google.maps.MVCArrayfalse.
+ * Creates a new instance of AutocompleteSessionToken.
*/
- setVisible(visible: boolean): void;
+ constructor();
}
/**
- * PolylineOptions object used to define the properties that can be set on a
- * Polyline.
+ * 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 interface PolylineOptions {
+ export class PlusCode {
/**
- * Indicates whether this Polyline handles mouse events.
- * @defaultValue true
+ * 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".
*/
- clickable?: boolean | null;
+ get compoundCode(): string | null;
/**
- * If set to true, the user can drag this shape over the map.
- * The geodesic property defines the mode of dragging.
- * @defaultValue false
+ * A plus code with a 1/8000th of a degree by 1/8000th of a degree area. For example, "8FVC9G8F+5W".
*/
- draggable?: boolean | null;
+ get globalCode(): string | null;
+ 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 {
/**
- * 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
+ * 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.
*/
- editable?: boolean | null;
+ constructor(inputField: HTMLInputElement, opts?: google.maps.places.AutocompleteOptions | 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
+ * Returns the bounds to which predictions are biased.
*/
- geodesic?: boolean | null;
+ getBounds(): google.maps.LatLngBounds | undefined;
/**
- * The icons to be rendered along the polyline.
+ * 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}.
*/
- icons?: google.maps.IconSequence[] | null;
+ getFields(): string[] | undefined;
/**
- * Map on which to display Polyline.
+ * 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.
*/
- map?: google.maps.Map | null;
+ getPlace(): google.maps.places.PlaceResult;
/**
- * 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.
+ * Sets the preferred area within which to return Place results. Results are biased towards, but not restricted to, this area.
*/
- path?:
- | google.maps.MVCArraytrue
+ * The list of {@link google.maps.places.AutocompletePrediction}s.
*/
- visible?: boolean | 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 {
/**
- * The zIndex compared to other polys.
+ * Creates a new instance of the AutocompleteService.
*/
- zIndex?: number | null;
- }
- export interface Projection {
+ constructor();
/**
- * 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.
+ * Retrieves place autocomplete predictions based on the supplied autocomplete request.
*/
- fromLatLngToPoint(
- latLng: google.maps.LatLng | google.maps.LatLngLiteral,
- point?: google.maps.Point,
- ): google.maps.Point | null;
+ getPlacePredictions(request: google.maps.places.AutocompletionRequest, callback?: ((arg0: google.maps.places.AutocompletePrediction[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void)): PromiseLatLng 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.
+ * Retrieves query autocomplete predictions based on the supplied query autocomplete request.
*/
- fromPointToLatLng(
- pixel: google.maps.Point,
- noClampNoWrap?: boolean,
- ): google.maps.LatLng | null;
+ getQueryPredictions(request: google.maps.places.QueryAutocompletionRequest, callback: (arg0: google.maps.places.QueryAutocompletePrediction[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void;
}
+
+ 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;
/**
- * A rectangle overlay.
+ * Ranking options for a PlaceSearchRequest.
*
- * Access by calling `const {Rectangle} = await
- * google.maps.importLibrary("maps")`. 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 class Rectangle extends google.maps.MVCObject {
- /**
- * A rectangle overlay.
- *
- * Access by calling `const {Rectangle} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- constructor(opts?: google.maps.RectangleOptions | null);
+ export enum RankBy {
/**
- * Returns the bounds of this rectangle.
+ * Ranks place results by distance from the location.
*/
- getBounds(): google.maps.LatLngBounds | null;
+ DISTANCE = 0,
/**
- * Returns whether this rectangle can be dragged by the user.
+ * Ranks place results by their prominence.
*/
- getDraggable(): boolean;
+ PROMINENCE = 0,
+ }
+ /**
+ * 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 {
/**
- * Returns whether this rectangle can be edited by the user.
+ * Creates a new instance of the PlacesService that renders attributions in the specified container.
+ * @param attrContainer
*/
- getEditable(): boolean;
+ constructor(attrContainer: HTMLDivElement | google.maps.Map);
/**
- * Returns the map on which this rectangle is displayed.
+ * 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.
*/
- getMap(): google.maps.Map | null;
+ findPlaceFromPhoneNumber(request: google.maps.places.FindPlaceFromPhoneNumberRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void;
/**
- * Returns whether this rectangle is visible on the map.
+ * 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.
*/
- getVisible(): boolean;
+ findPlaceFromQuery(request: google.maps.places.FindPlaceFromQueryRequest, callback: (arg0: google.maps.places.PlaceResult[] | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void;
/**
- * Sets the bounds of this rectangle.
+ * Retrieves details about the place identified by the given placeId.
*/
- setBounds(
- bounds: google.maps.LatLngBounds | null | google.maps.LatLngBoundsLiteral,
- ): void;
+ getDetails(request: google.maps.places.PlaceDetailsRequest, callback: (arg0: google.maps.places.PlaceResult | null, arg1: google.maps.places.PlacesServiceStatusString) => void): void;
/**
- * If set to true, the user can drag this rectangle over the
- * map.
+ * 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).
*/
- setDraggable(draggable: boolean): void;
+ 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;
/**
- * If set to true, the user can edit this rectangle by dragging
- * the control points shown at the corners and on each edge.
+ * 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).
*/
- setEditable(editable: boolean): void;
+ 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 {
/**
- * Renders the rectangle on the specified map. If map is set to
- * null, the rectangle will be removed.
+ * This request was invalid.
*/
- setMap(map: google.maps.Map | null): void;
- setOptions(options: google.maps.RectangleOptions | null): void;
+ INVALID_REQUEST = 'INVALID_REQUEST',
/**
- * Hides this rectangle if set to false.
+ * The place referenced was not found.
*/
- setVisible(visible: boolean): void;
- }
- /**
- * RectangleOptions object used to define the properties that can be set on a
- * Rectangle.
- */
- export interface RectangleOptions {
+ NOT_FOUND = 'NOT_FOUND',
/**
- * The bounds.
+ * The response contains a valid result.
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ OK = 'OK',
/**
- * Indicates whether this Rectangle handles mouse events.
- * @defaultValue true
+ * The application has gone over its request quota.
*/
- clickable?: boolean | null;
+ OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
/**
- * If set to true, the user can drag this rectangle over the
- * map.
- * @defaultValue false
+ * The application is not allowed to use the PlacesService.
*/
- draggable?: boolean | null;
+ REQUEST_DENIED = 'REQUEST_DENIED',
/**
- * 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 PlacesService request could not be processed due to a server error. The request may succeed if you try again.
*/
- editable?: boolean | null;
+ UNKNOWN_ERROR = 'UNKNOWN_ERROR',
/**
- * The fill color. All CSS3 colors are supported except for extended named
- * colors.
+ * No result was found for this request.
*/
- fillColor?: string | null;
+ ZERO_RESULTS = 'ZERO_RESULTS',
+ }
+ 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.
+ */
+ export class SearchBox extends google.maps.MVCObject {
/**
- * The fill opacity between 0.0 and 1.0
+ * Creates a new instance of SearchBox that attaches to the specified input text field with the given options.
+ * @param inputField
+ * @param opts
*/
- fillOpacity?: number | null;
+ constructor(inputField: HTMLInputElement, opts?: google.maps.places.SearchBoxOptions | null);
/**
- * Map on which to display Rectangle.
+ * Returns the bounds to which query predictions are biased.
*/
- map?: google.maps.Map | null;
+ getBounds(): google.maps.LatLngBounds | undefined;
/**
- * The stroke color. All CSS3 colors are supported except for extended named
- * colors.
+ * Returns the query selected by the user to be used with places_changed event.
*/
- strokeColor?: string | null;
+ getPlaces(): google.maps.places.PlaceResult[] | undefined;
/**
- * The stroke opacity between 0.0 and 1.0
+ * Sets the region to use for biasing query predictions. Results will only be biased towards this area and not be completely restricted to it.
*/
- strokeOpacity?: number | null;
+ setBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null): void;
+ }
+ /**
+ * Options for PlaceAllContentElement.
+ */
+ export interface PlaceAllContentElementOptions {
+ }
+ /**
+ * 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:
+ * Access by calling `const {PlaceAllContentElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class PlaceAllContentElement extends HTMLElement implements google.maps.places.PlaceAllContentElementOptions {
/**
- * The stroke position.
- * @defaultValue {@link google.maps.StrokePosition.CENTER}
+ *
+ * @param options
*/
- strokePosition?: google.maps.StrokePosition | null;
+ constructor(options?: google.maps.places.PlaceAllContentElementOptions);
+ addEventListener <gmp-place-details>
<gmp-place-all-content></gmp-place-all-content>
</gmp-place-details>
true
+ * Medium media size.
*/
- visible?: boolean | null;
+ MEDIUM = 'MEDIUM',
/**
- * The zIndex compared to other polys.
+ * Small media size.
*/
- zIndex?: number | null;
+ SMALL = 'SMALL',
}
+ export type MediaSizeString = `${google.maps.places.MediaSize}`;
/**
- * Access by calling `const {RenderingType} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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.
*/
- export enum RenderingType {
+ export enum AttributionColor {
/**
- * Indicates that the map is a raster map.
+ * Black attribution text.
*/
- RASTER = 'RASTER',
+ BLACK = 'BLACK',
/**
- * Indicates that it is unknown yet whether the map is vector or raster,
- * because the map has not finished initializing yet.
+ * Gray attribution text.
*/
- UNINITIALIZED = 'UNINITIALIZED',
+ GRAY = 'GRAY',
/**
- * Indicates that the map is a vector map.
+ * White attribution text.
*/
- VECTOR = 'VECTOR',
+ WHITE = 'WHITE',
}
+ export type AttributionColorString = `${google.maps.places.AttributionColor}`;
/**
- * Options for the rendering of the rotate control.
+ * Options for PlaceAccessibleEntranceIconElement.
*/
- export interface RotateControlOptions {
+ 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:
+ * 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 {
/**
- * Position id. Used to specify the position of the control on the map.
- * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
+ *
+ * @param options
*/
- position?: google.maps.ControlPosition | null;
+ constructor(options?: google.maps.places.PlaceAccessibleEntranceIconElementOptions);
+ addEventListener <gmp-place-content-config>
<gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>
</gmp-place-content-config>
PlaceAddressElement.
*/
- export interface ScaleControlOptions {
- /**
- * Style id. Used to select what style of scale control to display.
- */
- style?: google.maps.ScaleControlStyle | null;
+ export interface PlaceAddressElementOptions {
}
/**
- * Identifiers for scale control ids.
+ * 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:
+ * Access by calling `const {PlaceAddressElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export enum ScaleControlStyle {
+ export class PlaceAddressElement extends HTMLElement implements google.maps.places.PlaceAddressElementOptions {
/**
- * The standard scale control.
+ *
+ * @param options
*/
- DEFAULT = 0.0,
+ constructor(options?: google.maps.places.PlaceAddressElementOptions);
+ addEventListener <gmp-place-content-config>
<gmp-place-address></gmp-place-address>
</gmp-place-content-config>
PlaceFeatureListElement.
*/
- export class Settings {
+ 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:
+ * 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 <gmp-place-content-config>
<gmp-place-feature-list></gmp-place-feature-list>
</gmp-place-content-config>
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];).
- */
- experienceIds: Iterablegoogle.maps.Settings.
+ * Whether a place has wheelchair accessible parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
+ */
+ get hasWheelchairAccessibleParking(): boolean | 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.
+ */
+ get hasWheelchairAccessibleRestroom(): boolean | null;
+ /**
+ * Whether a place offers wheelchair accessible seating. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- static getInstance(this: any): google.maps.Settings;
+ get hasWheelchairAccessibleSeating(): boolean | null;
}
/**
- * Access by calling `const {Size} = await google.maps.importLibrary("core")`.
- * See https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 Size {
+ export class AddressComponent {
/**
- * Access by calling `const {Size} = await
- * google.maps.importLibrary("core")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * The full text of the address component.
*/
- constructor(
- width: number,
- height: number,
- widthUnit?: string,
- heightUnit?: string,
- );
+ get longText(): string | null;
/**
- * Compares two Sizes.
+ * The abbreviated, short text of the given address component.
*/
- equals(other: google.maps.Size | null): boolean;
+ get shortText(): string | null;
/**
- * The height along the y-axis, in pixels.
+ * An array of strings denoting the type of this address component. A list of valid types can be found here.
*/
- height: number;
+ get types(): string[];
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * 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 class Attribution {
/**
- * Returns a string representation of this Size.
+ * Name of the Place's data provider.
*/
- toString(): string;
+ get provider(): string | null;
/**
- * The width along the x-axis, in pixels.
+ * URI to the Place's data provider.
*/
- width: number;
+ get providerURI(): string | null;
+ toJSON(key?: string): unknown;
}
/**
- * 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.
+ * 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 enum SpatialRelationship {
+ export class ConsumerAlert {
/**
- * The target is directly opposite the landmark on the other side of the
- * road.
+ * The details of the consumer alert message.
*/
- ACROSS_THE_ROAD = 'ACROSS_THE_ROAD',
+ get details(): google.maps.places.ConsumerAlertDetails | null;
/**
- * Not on the same route as the landmark but a single turn away.
+ * The language code of the consumer alert message.
*/
- AROUND_THE_CORNER = 'AROUND_THE_CORNER',
+ get languageCode(): string | null;
/**
- * Close to the landmark's structure but further away from its access
- * point.
+ * The overview of the consumer alert message.
*/
- BEHIND = 'BEHIND',
+ get overview(): string | null;
+ 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 {
/**
- * The target is directly adjacent to the landmark.
+ * The title to show for a link to provide more information.
*/
- BESIDE = 'BESIDE',
+ get aboutLinkTitle(): string | null;
/**
- * On the same route as the landmark but not besides or across.
+ * The URI for a link to provide more information.
*/
- DOWN_THE_ROAD = 'DOWN_THE_ROAD',
+ get aboutLinkURI(): string | null;
/**
- * This is the default relationship when nothing more specific below
- * applies.
+ * The description of the consumer alert message.
*/
- NEAR = 'NEAR',
+ get description(): string | null;
/**
- * The landmark has a spatial geometry and the target is within its bounds.
+ * The title to show together with the detailed description.
*/
- WITHIN = 'WITHIN',
+ get title(): string | null;
}
/**
- * Options for the rendering of the Street View address control.
+ * 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 interface StreetViewAddressControlOptions {
+ export class ContentBlock {
/**
- * Position id. This id is used to specify the position of the control on
- * the map. The default position is TOP_LEFT.
+ * Content related to the topic.
*/
- position?: google.maps.ControlPosition | null;
- }
- /**
- * Options for the rendering of the Street View pegman control on the map.
- */
- export interface StreetViewControlOptions {
+ get content(): string | null;
/**
- * 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.
+ * Language code of the content.
*/
- position?: google.maps.ControlPosition | null;
+ get contentLanguageCode(): string | null;
/**
- * 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}]
+ * A list of {@link google.maps.places.Place}s referenced. When first retrieved, each Place only contains a place ID in the id field.
*/
- sources?: Iterableelectric_vehicle_charging_station.
+ * Access by calling `const {EVChargeAmenitySummary} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class StreetViewCoverageLayer extends google.maps.MVCObject {
+ export class EVChargeAmenitySummary {
/**
- * Returns the map on which this layer is displayed.
+ * A summary of the nearby coffee options.
*/
- getMap(): google.maps.Map | null;
+ get coffee(): google.maps.places.ContentBlock | null;
/**
- * Renders the layer on the specified map. If the map is set to null, the
- * layer will be removed.
+ * The text for the disclosure relating to this summary.
*/
- setMap(map: google.maps.Map | null): void;
- }
- 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;
+ 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;
+ /**
+ * An overview of the available amenities.
+ */
+ get overview(): google.maps.places.ContentBlock | null;
+ /**
+ * A summary of the nearby restaurants.
+ */
+ get restaurant(): google.maps.places.ContentBlock | null;
+ /**
+ * A summary of nearby stores.
+ */
+ get store(): google.maps.places.ContentBlock | null;
+ toJSON(key?: string): unknown;
}
/**
- * A collection of references to adjacent Street View panos.
+ * 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 interface StreetViewLink {
- /**
- * A localized string describing the link.
- */
- description: string | null;
+ export class EVChargeOptions {
/**
- * The heading of the link.
+ * A list of EV charging connector aggregations that contain connectors of the same type and same charge rate.
*/
- heading: number | null;
+ get connectorAggregations(): google.maps.places.ConnectorAggregation[];
/**
- * A unique identifier for the panorama. This id is stable within a session
- * but unstable across sessions.
+ * 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.
*/
- pano: string | null;
+ get connectorCount(): number;
+ toJSON(key?: string): unknown;
}
/**
- * A representation of a location in the Street View panorama.
+ * 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 interface StreetViewLocation {
+ export class ConnectorAggregation {
/**
- * A localized string describing the location.
+ * The time when the connector availability information in this aggregation was last updated.
*/
- description?: string | null;
+ get availabilityLastUpdateTime(): Date | null;
/**
- * The latlng of the panorama.
+ * Number of connectors in this aggregation that are currently available.
*/
- latLng?: google.maps.LatLng | null;
+ get availableCount(): number | null;
/**
- * A unique identifier for the panorama. This is stable within a session but
- * unstable across sessions.
+ * Number of connectors in this aggregation.
*/
- pano: string;
+ get count(): number;
/**
- * Short description of the location.
+ * The static max charging rate in kw of each connector of the aggregation.
*/
- shortDescription?: string | null;
+ get maxChargeRateKw(): number;
+ /**
+ * Number of connectors in this aggregation that are currently out of service.
+ */
+ get outOfServiceCount(): number | null;
+ /**
+ * The connector type of this aggregation.
+ */
+ get type(): google.maps.places.EVConnectorTypeString | null;
}
/**
- * A Street View request to be sent with getPanorama.
- * StreetViewLocationRequest lets you search for a Street View
- * panoroma at a specified location.
+ * 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 interface StreetViewLocationRequest {
+ export class Money {
/**
- * Specifies the location where to search for a Street View panorama.
+ * The three-letter currency code, defined in ISO 4217.
*/
- location?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ get currencyCode(): 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.
+ * Number of nano (10^-9) units of the amount.
*/
- preference?: google.maps.StreetViewPreference | null;
+ get nanos(): number;
/**
- * Sets a radius in meters in which to search for a panorama.
- * @defaultValue 50
+ * The whole units of the amount. For example, if {@link google.maps.places.Money.currencyCode} is "USD", then 1 unit is 1 US dollar.
*/
- radius?: number | null;
+ get units(): number;
/**
- * 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.
+ * Returns a human-readable representation of the amount of money with its currency symbol.
*/
- source?: google.maps.StreetViewSource | null;
+ toString(): string;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * 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 FuelOptions {
/**
- * 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}]
+ * A list of fuel prices for each type of fuel this station has, one entry per fuel type.
*/
- sources?: IterableStreetViewPanoRequest is used with the
- * getPanorama to find a panorama with a specified ID.
+ * 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 interface StreetViewPanoRequest {
+ export class FuelPrice {
/**
- * Specifies the pano ID to search for.
+ * The price of the fuel.
*/
- pano?: string | null;
+ get price(): google.maps.places.Money | null;
+ /**
+ * The type of fuel.
+ */
+ get type(): google.maps.places.FuelTypeString | null;
+ /**
+ * The time the fuel price was last updated.
+ */
+ get updateTime(): Date | 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.
+ * Types of fuel.
*
- * Access by calling `const {StreetViewPanorama} = await
- * google.maps.importLibrary("streetView")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {FuelType} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class StreetViewPanorama extends google.maps.MVCObject {
- /**
- * 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.
- */
- constructor(
- container: HTMLElement,
- opts?: google.maps.StreetViewPanoramaOptions | 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.
- */
- controls: google.maps.MVCArrayStreetViewPanorama. 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.
+ * Bio-diesel.
*/
- focus(): void;
+ BIO_DIESEL = 'BIO_DIESEL',
/**
- * Returns the set of navigation links for the Street View panorama.
+ * Diesel fuel.
*/
- getLinks(): (google.maps.StreetViewLink | null)[] | null;
+ DIESEL = 'DIESEL',
/**
- * Returns the StreetViewLocation of the current panorama.
+ * Diesel plus fuel.
*/
- getLocation(): google.maps.StreetViewLocation;
+ DIESEL_PLUS = 'DIESEL_PLUS',
/**
- * 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.
+ * E 100.
*/
- getMotionTracking(): boolean;
+ E100 = 'E100',
/**
- * Returns the current panorama ID for the Street View panorama. This id is
- * stable within the browser's current session only.
+ * E 80.
*/
- getPano(): string;
+ E80 = 'E80',
/**
- * 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.
+ * E 85.
*/
- getPhotographerPov(): google.maps.StreetViewPov;
+ E85 = 'E85',
/**
- * Returns the current LatLng position for the Street View
- * panorama.
+ * LPG.
*/
- getPosition(): google.maps.LatLng | null;
+ LPG = 'LPG',
/**
- * Returns the current point of view for the Street View panorama.
+ * Methane.
*/
- getPov(): google.maps.StreetViewPov;
+ METHANE = 'METHANE',
/**
- * Returns the status of the panorama on completion of the
- * setPosition() or setPano() request.
+ * Midgrade.
*/
- getStatus(): google.maps.StreetViewStatus;
+ MIDGRADE = 'MIDGRADE',
/**
- * Returns true if the panorama is visible. It does not specify
- * whether Street View imagery is available at the specified position.
+ * Premium.
*/
- getVisible(): boolean;
+ PREMIUM = 'PREMIUM',
/**
- * 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.
+ * Regular unleaded.
*/
- getZoom(): number;
+ REGULAR_UNLEADED = 'REGULAR_UNLEADED',
/**
- * Set the custom panorama provider called on pano change to load custom
- * panoramas.
+ * SP 100.
*/
- registerPanoProvider(
- provider: (a: string) => google.maps.StreetViewPanoramaData | null,
- opt_options?: google.maps.PanoProviderOptions,
- ): void;
+ SP100 = 'SP100',
/**
- * Sets the set of navigation links for the Street View panorama.
+ * SP 91.
*/
- setLinks(links: (google.maps.StreetViewLink | null)[] | null): void;
+ SP91 = 'SP91',
/**
- * 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.
+ * SP 91 E10.
*/
- setMotionTracking(motionTracking: boolean): void;
+ SP91_E10 = 'SP91_E10',
/**
- * Sets a collection of key-value pairs.
+ * SP 92.
*/
- setOptions(options: google.maps.StreetViewPanoramaOptions | null): void;
+ SP92 = 'SP92',
/**
- * Sets the current panorama ID for the Street View panorama.
+ * SP 95.
*/
- setPano(pano: string): void;
+ SP95 = 'SP95',
/**
- * Sets the current LatLng position for the Street View
- * panorama.
+ * SP95 E10.
*/
- setPosition(
- latLng: google.maps.LatLng | null | google.maps.LatLngLiteral,
- ): void;
+ SP95_E10 = 'SP95_E10',
/**
- * Sets the point of view for the Street View panorama.
+ * SP 98.
*/
- setPov(pov: google.maps.StreetViewPov): void;
+ SP98 = 'SP98',
/**
- * 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>.
+ * SP 99.
*/
- setVisible(flag: boolean): void;
+ SP99 = 'SP99',
/**
- * 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.
+ * Truck diesel.
*/
- setZoom(zoom: number): void;
+ TRUCK_DIESEL = 'TRUCK_DIESEL',
}
+ export type FuelTypeString = `${google.maps.places.FuelType}`;
/**
- * The representation of a panorama returned from the provider defined using
- * registerPanoProvider.
+ * 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 interface StreetViewPanoramaData {
+ export class GenerativeSummary {
/**
- * Specifies the copyright text for this panorama.
+ * The text for the disclosure relating to this summary.
*/
- copyright?: string;
+ get disclosureText(): string | null;
/**
- * Specifies the year and month in which the imagery in this panorama was
- * acquired. The date string is in the form YYYY-MM.
+ * The language code of the disclosure text.
*/
- imageDate?: string;
+ get disclosureTextLanguageCode(): string | null;
/**
- * Specifies the navigational links to adjacent panoramas.
+ * A URI to report a problem with the summary.
*/
- links?: google.maps.StreetViewLink[];
+ get flagContentURI(): string | null;
/**
- * Specifies the location meta-data for this panorama.
+ * The overview of the place.
*/
- location?: google.maps.StreetViewLocation;
+ get overview(): string | null;
/**
- * Specifies the custom tiles for this panorama.
+ * The language code of the overview.
*/
- tiles: google.maps.StreetViewTileData;
+ get overviewLanguageCode(): string | null;
+ toJSON(key?: string): unknown;
}
/**
- * Options defining the properties of a StreetViewPanorama
- * object.
+ * 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 StreetViewPanoramaOptions {
+ export class GoogleMapsLinks {
/**
- * The enabled/disabled state of the address control.
+ * 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.
*/
- addressControl?: boolean | null;
+ get directionsURI(): string | null;
/**
- * The display options for the address control.
+ * A link to show the photos for the place on Google Maps.
*/
- addressControlOptions?: google.maps.StreetViewAddressControlOptions | null;
+ get photosURI(): string | null;
/**
- * The enabled/disabled state of click-to-go. Not applicable to custom
- * panoramas.
- * @defaultValue true
+ * A link to show the place on Google Maps.
*/
- clickToGo?: boolean | null;
+ get placeURI(): string | 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.
+ * A link to show the reviews for the place on Google Maps.
*/
- controlSize?: number | null;
+ get reviewsURI(): string | null;
/**
- * Enables/disables all default UI. May be overridden individually.
+ * A link to write a review for the place on Google Maps.
*/
- disableDefaultUI?: boolean | null;
+ get writeAReviewURI(): string | null;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * 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 class NeighborhoodSummary {
/**
- * Enables/disables zoom on double click.
- * @defaultValue true
+ * A detailed description of the neighborhood.
*/
- disableDoubleClickZoom?: boolean | null;
+ get description(): google.maps.places.ContentBlock | null;
/**
- * If true, the close button is displayed.
- * @defaultValue false
+ * The text for the disclosure relating to this summary.
*/
- enableCloseButton?: boolean | null;
+ get disclosureText(): string | null;
/**
- * The enabled/disabled state of the fullscreen control.
+ * The language code of the disclosure text.
*/
- fullscreenControl?: boolean | null;
+ get disclosureTextLanguageCode(): string | null;
/**
- * The display options for the fullscreen control.
+ * A URI to report a problem with the summary.
*/
- fullscreenControlOptions?: google.maps.FullscreenControlOptions | null;
+ get flagContentURI(): string | null;
/**
- * The enabled/disabled state of the imagery acquisition date control.
- * Disabled by default.
+ * An overview of the neighborhood.
*/
- imageDateControl?: boolean | null;
+ get overview(): google.maps.places.ContentBlock | null;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * 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 OpeningHoursPoint {
/**
- * The enabled/disabled state of the links control.
+ * The day of the week, as a number in the range [0, 6], starting on Sunday. For example, 2 means Tuesday.
*/
- linksControl?: boolean | null;
+ get day(): number;
/**
- * 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 hour of the OpeningHoursPoint.time as a number, in the range [0, 23]. This will be reported in the Place’s time zone.
*/
- motionTracking?: boolean | null;
+ get hour(): number;
/**
- * 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 minute of the OpeningHoursPoint.time as a number, in the range [0, 59]. This will be reported in the Place’s time zone.
*/
- motionTrackingControl?: boolean | null;
+ get minute(): number;
+ 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 display options for the motion tracking control.
+ * The closing time for the Place.
*/
- motionTrackingControlOptions?: google.maps.MotionTrackingControlOptions | null;
+ get close(): google.maps.places.OpeningHoursPoint | null;
/**
- * The enabled/disabled state of the pan control.
+ * The opening time for the Place.
*/
- panControl?: boolean | null;
+ get open(): google.maps.places.OpeningHoursPoint;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * 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 OpeningHours {
/**
- * The display options for the pan control.
+ * Opening periods covering each day of the week, starting from Sunday, in chronological order. Does not include days where the Place is not open.
*/
- panControlOptions?: google.maps.PanControlOptions | null;
+ get periods(): google.maps.places.OpeningHoursPeriod[];
/**
- * The panorama ID, which should be set when specifying a custom panorama.
+ * 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.
*/
- pano?: string | null;
+ get specialDays(): Date[];
/**
- * The LatLng position of the Street View panorama.
+ * 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.
*/
- position?: google.maps.LatLng | null | google.maps.LatLngLiteral;
+ get weekdayDescriptions(): string[];
+ 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 camera orientation, specified as heading and pitch, for the panorama.
+ * Whether a place offers free garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- pov?: google.maps.StreetViewPov | null;
+ get hasFreeGarageParking(): boolean | null;
/**
- * If false, disables scrollwheel zooming in Street View.
- * @defaultValue true
+ * Whether a place offers free parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- scrollwheel?: boolean | null;
+ get hasFreeParkingLot(): boolean | null;
/**
- * 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
+ * Whether a place offers free street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- showRoadLabels?: boolean | null;
+ get hasFreeStreetParking(): boolean | null;
/**
- * If true, the Street View panorama is visible on load.
+ * Whether a place offers paid garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- visible?: boolean | null;
+ get hasPaidGarageParking(): boolean | null;
/**
- * The zoom of the panorama, specified as a number. A zoom of 0 gives a 180
- * degrees Field of View.
+ * Whether a place offers paid parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- zoom?: number | null;
+ get hasPaidParkingLot(): boolean | null;
/**
- * The enabled/disabled state of the zoom control.
+ * Whether a place offers paid street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- zoomControl?: boolean | null;
+ get hasPaidStreetParking(): boolean | null;
/**
- * The display options for the zoom control.
+ * Whether a place offers valet parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- zoomControlOptions?: google.maps.ZoomControlOptions | null;
+ get hasValetParking(): boolean | 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.
+ * Access by calling `const {PaymentOptions} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface StreetViewPov {
+ export class PaymentOptions {
/**
- * The camera heading in degrees relative to true north. True
- * north is 0°, east is 90°, south is 180°, west is 270°.
+ * Whether a place only accepts payment via cash. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- heading: number;
+ get acceptsCashOnly(): boolean | null;
/**
- * The camera pitch in degrees, relative to the street view vehicle. Ranges
- * from 90° (directly upwards) to -90° (directly downwards).
+ * Whether a place accepts payment via credit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- 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 {
+ get acceptsCreditCards(): boolean | null;
/**
- * 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.
+ * Whether a place accepts payment via debit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- BEST = 'best',
+ get acceptsDebitCards(): boolean | null;
/**
- * 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.
+ * Whether a place accepts payment via NFC. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown.
*/
- NEAREST = 'nearest',
+ get acceptsNFC(): boolean | null;
}
/**
- * The response resolved for a Promise from {@link
- * google.maps.StreetViewService.getPanorama}.
+ * 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 StreetViewResponse {
+ export class AuthorAttribution {
/**
- * The representation of a panorama.
+ * Author's name for this result.
*/
- 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 {
+ get displayName(): string;
/**
- * Retrieves the StreetViewPanoramaData for a panorama that
- * matches the supplied Street View query request. The
- * StreetViewPanoramaData is passed to the provided callback.
+ * Author's photo URI for this result. This may not always be available.
+ */
+ get photoURI(): string | null;
+ /**
+ * Author's profile URI for this result.
*/
- getPanorama(
- request:
- | google.maps.StreetViewLocationRequest
- | google.maps.StreetViewPanoRequest,
- callback?: (
- a: google.maps.StreetViewPanoramaData | null,
- b: google.maps.StreetViewStatus,
- ) => void,
- ): Promise'outdoor'.
- *
- * Access by calling `const {StreetViewSource} = await
- * google.maps.importLibrary("streetView")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 enum StreetViewSource {
+ export class Photo {
/**
- * Uses the default sources of Street View, searches will not be limited to
- * specific sources.
+ * Attribution text to be displayed for this photo.
*/
- DEFAULT = 'default',
+ get authorAttributions(): google.maps.places.AuthorAttribution[];
/**
- * Limits Street View searches to official Google collections.
+ * A link where user can flag a problem with the photo.
*/
- GOOGLE = 'google',
+ get flagContentURI(): string | null;
/**
- * 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.
+ * A link to show the photo on Google Maps.
*/
- OUTDOOR = 'outdoor',
- }
- /**
- * 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 {
+ get googleMapsURI(): string | null;
/**
- * The request was successful.
+ * The height of the photo in pixels.
*/
- OK = 'OK',
+ get heightPx(): number;
/**
- * The request could not be successfully processed, yet the exact reason for
- * failure is unknown.
+ * The width of the photo in pixels.
*/
- UNKNOWN_ERROR = 'UNKNOWN_ERROR',
+ get widthPx(): number;
/**
- * There are no panoramas found that match the search criteria.
+ * Returns the image URL corresponding to the specified options.
*/
- ZERO_RESULTS = 'ZERO_RESULTS',
+ getURI(options?: google.maps.places.PhotoOptions): string;
+ toJSON(key?: string): unknown;
}
/**
- * The properties of the tile set used in a Street View panorama.
+ * 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 interface StreetViewTileData {
- /**
- * The heading (in degrees) at the center of the panoramic tiles.
- */
- centerHeading: number;
+ export class PriceRange {
/**
- * 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.
- */
- getTileUrl(
- pano: string,
- tileZoom: number,
- tileX: number,
- tileY: number,
- ): string;
- /**
- * The size (in pixels) at which tiles will be rendered.
+ * The upper end of the price range (inclusive). Price should be lower than this amount.
*/
- tileSize: google.maps.Size;
+ get endPrice(): google.maps.places.Money | null;
/**
- * The size (in pixels) of the whole panorama's "world".
+ * The low end of the price range (inclusive). Price should be at or above this amount.
*/
- worldSize: google.maps.Size;
+ get startPrice(): google.maps.places.Money;
+ toJSON(key?: string): unknown;
}
/**
- * 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.
+ * 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 StrokePosition {
+ export class Review {
/**
- * The stroke is centered on the polygon's path, with half the stroke
- * inside the polygon and half the stroke outside the polygon.
+ * The reviewer.
*/
- CENTER = 0.0,
+ get authorAttribution(): google.maps.places.AuthorAttribution | null;
/**
- * The stroke lies inside the polygon.
+ * A link where user can flag a problem with the review.
*/
- INSIDE = 1.0,
+ get flagContentURI(): string | null;
/**
- * The stroke lies outside the polygon.
+ * A link to show the review on Google Maps.
*/
- OUTSIDE = 2.0,
- }
- /**
- * 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 MapType with a custom style.
- *
- * Access by calling `const {StyledMapType} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- constructor(
- styles: (google.maps.MapTypeStyle | null)[] | null,
- options?: google.maps.StyledMapTypeOptions | null,
- );
- alt: string;
+ get googleMapsURI(): string | null;
/**
- * @param tileCoord Tile coordinates.
- * @param zoom Tile zoom.
- * @param ownerDocument The document which owns this tile.
+ * The review text in its original language.
*/
- getTile(
- tileCoord: google.maps.Point | null,
- zoom: number,
- ownerDocument: Document | null,
- ): Element | null;
- maxZoom: number;
- minZoom: number;
- name: string;
- projection: google.maps.Projection | null;
- radius: number;
+ get originalText(): string | null;
/**
- * @param tile Tile to release.
+ * An IETF language code indicating the original language of the review.
*/
- releaseTile(tile: Element | null): void;
- tileSize: google.maps.Size | null;
- }
- /**
- * This class is used to specify options when creating a
- * StyledMapType. These options cannot be changed after the
- * StyledMapType is instantiated.
- */
- export interface StyledMapTypeOptions {
+ get originalTextLanguageCode(): string | null;
+
+ get publishTime(): Date | null;
/**
- * Text to display when this MapType's button is hovered
- * over in the map type control.
+ * The rating of this review, a number between 1.0 and 5.0 (inclusive).
*/
- alt?: string | null;
+ get rating(): number | null;
/**
- * The maximum zoom level for the map when displaying this
- * MapType. Optional.
+ * 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"'.
*/
- maxZoom?: number | null;
+ get relativePublishTimeDescription(): string | null;
/**
- * The minimum zoom level for the map when displaying this
- * MapType. Optional.
+ * The localized text of the review.
*/
- minZoom?: number | null;
+ get text(): string | null;
/**
- * The name to display in the map type control.
+ * An IETF language code indicating the localized language of the review.
*/
- name?: string | null;
+ get textLanguageCode(): string | null;
+ /**
+ * The month of the date when the review author visited the place. This field is 0-based; 0 is January, and 11 is December.
+ */
+ get visitDateMonth(): number | null;
+ /**
+ * The year of the date when the review author visited the place.
+ */
+ get visitDateYear(): number | null;
+ toJSON(key?: string): unknown;
}
/**
- * 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.
+ * 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 interface Symbol {
+ export class ReviewSummary {
/**
- * 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)
- */
- anchor?: google.maps.Point | null;
- /**
- * 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.
+ * The text for the disclosure relating to this summary.
*/
- fillColor?: string | null;
+ get disclosureText(): string | null;
/**
- * The symbol's fill opacity.
- * @defaultValue 0
+ * The language code of the disclosure text.
*/
- fillOpacity?: number | null;
+ get disclosureTextLanguageCode(): string | null;
/**
- * 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)
+ * A URI to report a problem with the summary.
*/
- labelOrigin?: google.maps.Point | null;
+ get flagContentURI(): string | null;
/**
- * The symbol's path, which is a built-in symbol path, or a custom path
- * expressed using SVG path
- * notation. Required.
+ * A URI to show reviews of this place on Google Maps.
*/
- path: google.maps.SymbolPath | string;
+ get reviewsURI(): string | null;
/**
- * 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
+ * The summary of user reviews.
*/
- rotation?: number | null;
+ get text(): string | null;
/**
- * 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.
+ * The language code of the summary of user reviews.
*/
- scale?: number | null;
+ get textLanguageCode(): string | null;
+ 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 {
/**
- * 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.
+ * 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.
*/
- strokeColor?: string | null;
+ get type(): string | null;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * Options for PlaceMediaElement.
+ */
+ export interface PlaceMediaElementOptions {
/**
- * 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.
+ * See {@link google.maps.places.PlaceMediaElement.lightboxPreferred}.
*/
- strokeOpacity?: number | null;
+ lightboxPreferred?: boolean | null;
/**
- * The symbol's stroke weight.
- * @defaultValue The {@link google.maps.Symbol.scale} of the symbol.
+ * See {@link google.maps.places.PlaceMediaElement.preferredSize}.
*/
- strokeWeight?: number | null;
+ preferredSize?: google.maps.places.MediaSizeString | null;
}
/**
- * Built-in symbol paths.
- *
- * Access by calling `const {SymbolPath} = await
- * google.maps.importLibrary("core")`. 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 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:
+ * Access by calling `const {PlaceMediaElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export enum SymbolPath {
+ export class PlaceMediaElement extends HTMLElement implements google.maps.places.PlaceMediaElementOptions {
/**
- * A backward-pointing closed arrow.
+ *
+ * @param options
*/
- BACKWARD_CLOSED_ARROW = 0.0,
+ constructor(options?: google.maps.places.PlaceMediaElementOptions);
/**
- * A backward-pointing open arrow.
+ * Whether to enable or disable the media lightbox, in cases where both options are supported.
+ * @defaultValue <gmp-place-content-config>
<gmp-place-media lightbox-preferred></gmp-place-media>
</gmp-place-content-config>
false
*/
- BACKWARD_OPEN_ARROW = 1.0,
+ get lightboxPreferred(): boolean;
/**
- * A circle.
+ * Whether to enable or disable the media lightbox, in cases where both options are supported.
+ * @defaultValue false
*/
- CIRCLE = 2.0,
+ set lightboxPreferred(value: boolean | null | undefined);
/**
- * A forward-pointing closed arrow.
+ * 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
*/
- FORWARD_CLOSED_ARROW = 3.0,
+ get preferredSize(): google.maps.places.MediaSizeString | null;
/**
- * A forward-pointing open arrow.
+ * 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
*/
- FORWARD_OPEN_ARROW = 4.0,
+ set preferredSize(value: google.maps.places.MediaSizeString | null | undefined);
+ addEventListenerPlaceOpenNowStatusElement.
*/
- export interface Time {
+ export interface PlaceOpenNowStatusElementOptions {
+ }
+ /**
+ * 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:
+ * Access by calling `const {PlaceOpenNowStatusElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class PlaceOpenNowStatusElement extends HTMLElement implements google.maps.places.PlaceOpenNowStatusElementOptions {
/**
- * A string representing the time's value. The time is displayed in the
- * time zone of the transit stop.
+ *
+ * @param options
*/
- text: string;
+ constructor(options?: google.maps.places.PlaceOpenNowStatusElementOptions);
+ addEventListener <gmp-place-content-config>
<gmp-place-open-now-status></gmp-place-open-now-status>
</gmp-place-content-config>
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:
+ * 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 <gmp-place-content-config>
<gmp-place-opening-hours></gmp-place-opening-hours>
</gmp-place-content-config>
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:
+ * 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 <gmp-place-content-config>
<gmp-place-phone-number></gmp-place-phone-number>
</gmp-place-content-config>
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:
+ * 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 <gmp-place-content-config>
<gmp-place-plus-code></gmp-place-plus-code>
</gmp-place-content-config>
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:
+ * 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 {
+ /**
+ *
+ * @param options
+ */
+ constructor(options?: google.maps.places.PlacePriceElementOptions);
+ addEventListener <gmp-place-content-config>
<gmp-place-price></gmp-place-price>
</gmp-place-content-config>
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:
+ * 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 {
+ /**
+ *
+ * @param options
+ */
+ constructor(options?: google.maps.places.PlaceRatingElementOptions);
+ addEventListener <gmp-place-content-config>
<gmp-place-rating></gmp-place-rating>
</gmp-place-content-config>
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:
+ * 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 <gmp-place-content-config>
<gmp-place-review-summary></gmp-place-review-summary>
</gmp-place-content-config>
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:
+ * 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 <gmp-place-content-config>
<gmp-place-reviews></gmp-place-reviews>
</gmp-place-content-config>
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:
+ * 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 <gmp-place-content-config>
<gmp-place-summary></gmp-place-summary>
</gmp-place-content-config>
PlaceTypeElement.
+ */
+ export interface PlaceTypeElementOptions {
+ }
+ /**
+ * 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:
+ * 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 {
+ /**
+ *
+ * @param options
+ */
+ constructor(options?: google.maps.places.PlaceTypeElementOptions);
+ addEventListener <gmp-place-content-config>
<gmp-place-type></gmp-place-type>
</gmp-place-content-config>
PlaceTypeSpecificHighlightsElement.
+ */
+ export interface PlaceTypeSpecificHighlightsElementOptions {
+ }
+ /**
+ * 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:
+ * 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 <gmp-place-content-config>
<gmp-place-type-specific-highlights></gmp-place-type-specific-highlights>
</gmp-place-content-config>
PlaceWebsiteElement.
+ */
+ export interface PlaceWebsiteElementOptions {
+ }
+ /**
+ * 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:
+ * 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 <gmp-place-content-config>
<gmp-place-website></gmp-place-website>
</gmp-place-content-config>
PlaceAttributionElement.
+ */
+ export interface PlaceAttributionElementOptions {
/**
- * 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".
+ * See {@link google.maps.places.PlaceAttributionElement.darkSchemeColor}.
*/
- time_zone: string;
+ darkSchemeColor?: google.maps.places.AttributionColorString | null;
/**
- * The time of this departure or arrival, specified as a JavaScript Date
- * object.
+ * See {@link google.maps.places.PlaceAttributionElement.lightSchemeColor}.
*/
- value: Date;
+ lightSchemeColor?: google.maps.places.AttributionColorString | null;
}
/**
- * A traffic layer.
- *
- * Access by calling `const {TrafficLayer} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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:
+ * Access by calling `const {PlaceAttributionElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class TrafficLayer extends google.maps.MVCObject {
+ export class PlaceAttributionElement extends HTMLElement implements google.maps.places.PlaceAttributionElementOptions {
/**
- * A traffic layer.
- *
- * Access by calling `const {TrafficLayer} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ *
+ * @param options
*/
- constructor(opts?: google.maps.TrafficLayerOptions | null);
+ constructor(options?: google.maps.places.PlaceAttributionElementOptions);
/**
- * Returns the map on which this layer is displayed.
+ * The color of the Google Maps attribution in dark mode.
+ * @defaultValue <gmp-place-content-config>
<gmp-place-attribution
light-scheme-color="black"
dark-scheme-color="white"
></gmp-place-attribution>
</gmp-place-content-config>
AttributionColor.WHITE
*/
- getMap(): google.maps.Map | null;
+ get darkSchemeColor(): google.maps.places.AttributionColorString;
/**
- * Renders the layer on the specified map. If map is set to
- * null, the layer will be removed.
+ * The color of the Google Maps attribution in dark mode.
+ * @defaultValue AttributionColor.WHITE
*/
- setMap(map: google.maps.Map | null): void;
- setOptions(options: google.maps.TrafficLayerOptions | null): void;
+ set darkSchemeColor(value: google.maps.places.AttributionColorString | null | undefined);
+ /**
+ * The color of the Google Maps attribution in light mode.
+ * @defaultValue AttributionColor.GRAY
+ */
+ get lightSchemeColor(): google.maps.places.AttributionColorString;
+ /**
+ * The color of the Google Maps attribution in light mode.
+ * @defaultValue AttributionColor.GRAY
+ */
+ set lightSchemeColor(value: google.maps.places.AttributionColorString | null | undefined);
+ addEventListenerPlaceContentConfigElement.
*/
- export interface TrafficLayerOptions {
+ export interface PlaceContentConfigElementOptions {
+ }
+ /**
+ * 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:
+ * Access by calling `const {PlaceContentConfigElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class PlaceContentConfigElement extends HTMLElement implements google.maps.places.PlaceContentConfigElementOptions {
/**
- * Whether the traffic layer refreshes with updated information
- * automatically.
- * @defaultValue <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> true
+ *
+ * @param options
*/
- autoRefresh?: boolean | null;
+ constructor(options?: google.maps.places.PlaceContentConfigElementOptions);
+ addEventListenerPlaceStandardContentElement.
+ */
+ export interface PlaceStandardContentElementOptions {
+ }
+ /**
+ * 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:
For {@link google.maps.places.PlaceDetailsCompactElement}, standard content consists of:
For {@link google.maps.places.PlaceSearchElement}, standard content consists of:
For example:
+ * 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 {
/**
- * Map on which to display the traffic layer.
+ *
+ * @param options
*/
- map?: google.maps.Map | null;
+ constructor(options?: google.maps.places.PlaceStandardContentElementOptions);
+ addEventListener <gmp-place-details>
<gmp-place-standard-content></gmp-place-standard-content>
</gmp-place-details>
DirectionsRequest
- * or DistanceMatrixRequest.
- * Specify these by value, or by using the constant's name. For example,
- * 'bestguess' or
- * google.maps.TrafficModel.BEST_GUESS.
+ * Orientation variants for {@link google.maps.places.PlaceDetailsCompactElement}.
*
- * Access by calling `const {TrafficModel} = await
- * google.maps.importLibrary("routes")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {PlaceDetailsOrientation} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export enum TrafficModel {
+ export enum PlaceDetailsOrientation {
/**
- * Use historical traffic data to best estimate the time spent in traffic.
+ * Horizontal orientation.
*/
- BEST_GUESS = 'bestguess',
+ HORIZONTAL = 'HORIZONTAL',
/**
- * Use historical traffic data to make an optimistic estimate of what the
- * duration in traffic will be.
+ * Vertical orientation.
*/
- OPTIMISTIC = 'optimistic',
+ VERTICAL = 'VERTICAL',
+ }
+ export type PlaceDetailsOrientationString = `${google.maps.places.PlaceDetailsOrientation}`;
+ /**
+ * Options for PlaceDetailsLocationRequestElement.
+ */
+ export interface PlaceDetailsLocationRequestElementOptions {
/**
- * Use historical traffic data to make a pessimistic estimate of what the
- * duration in traffic will be.
+ * The location to render the place for.
*/
- PESSIMISTIC = 'pessimistic',
+ location?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null;
}
/**
- * Information about an agency that operates a transit line.
+ * 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:
+ * Access by calling `const {PlaceDetailsLocationRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface TransitAgency {
+ export class PlaceDetailsLocationRequestElement extends HTMLElement implements google.maps.places.PlaceDetailsLocationRequestElementOptions {
/**
- * The name of this transit agency.
+ *
+ * @param options
*/
- name: string;
+ constructor(options?: google.maps.places.PlaceDetailsLocationRequestElementOptions);
/**
- * The transit agency's phone number.
+ * The location to render details for in the Place Details element. Normalizes to a <gmp-place-details>
<gmp-place-details-location-request
location="37.6207665,-122.4284806"
></gmp-place-details-location-request>
</gmp-place-details> LatLngAltitude.
+ * @defaultValue null
*/
- phone: string;
+ get location(): google.maps.LatLngAltitude | null;
/**
- * The transit agency's URL.
+ * The location to render details for in the Place Details element. Normalizes to a LatLngAltitude.
+ * @defaultValue null
*/
- url: string;
+ set location(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined);
+ addEventListenerDirectionsRoute
- * consisting of value and currency.
- */
- export interface TransitFare {
+ TYPE_2 = 'TYPE_2',
/**
- * An ISO 4217 currency
- * code indicating the currency in which the fare is expressed.
+ * GB/T type corresponds to the GB/T standard in China. This type covers all GB_T types.
*/
- currency: string;
+ UNSPECIFIED_GB_T = 'UNSPECIFIED_GB_T',
/**
- * The numerical value of the fare, expressed in the given
- * currency.
+ * Unspecified wall outlet.
*/
- value: number;
+ UNSPECIFIED_WALL_OUTLET = 'UNSPECIFIED_WALL_OUTLET',
}
+ export type EVConnectorTypeString = `${google.maps.places.EVConnectorType}`;
/**
- * A transit layer.
- *
- * Access by calling `const {TransitLayer} = await
- * google.maps.importLibrary("maps")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Options for fetching Place fields.
*/
- export class TransitLayer extends google.maps.MVCObject {
- /**
- * Returns the map on which this layer is displayed.
- */
- getMap(): google.maps.Map | null;
+ export interface FetchFieldsRequest {
/**
- * Renders the layer on the specified map. If map is set to
- * null, the layer will be removed.
+ * List of fields to be fetched.
*/
- setMap(map: google.maps.Map | null): void;
+ fields: string[];
}
/**
- * Information about the transit line that operates this transit step.
+ * Options for constructing a Place.
*/
- export interface TransitLine {
- /**
- * The transit agency that operates this transit line.
- */
- agencies: (google.maps.TransitAgency | null)[] | null;
- /**
- * The color commonly used in signage for this transit line, represented as
- * a hex string.
- */
- color: string;
+ export interface PlaceOptions {
/**
- * The URL for an icon associated with this line.
+ * The unique place id.
*/
- icon: string;
+ id?: string;
/**
- * The full name of this transit line, e.g. "8 Avenue Local".
+ * A language identifier for the language in which details should be returned. See the list of supported languages.
*/
- name: string;
+ requestedLanguage?: string | null;
/**
- * The short name of this transit line, e.g. "E".
+ * 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").
*/
- short_name: string;
+ requestedRegion?: string | null;
/**
- * The text color commonly used in signage for this transit line,
- * represented as a hex string.
+ * The unique place resource name.
*/
- text_color: string;
+ 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 {
/**
- * The agency's URL which is specific to this transit line.
+ * Ranks results by distance.
*/
- url: string;
+ DISTANCE = 'DISTANCE',
/**
- * The type of vehicle used, e.g. train or bus.
+ * Ranks results by relevance.
*/
- vehicle: google.maps.TransitVehicle;
+ RELEVANCE = 'RELEVANCE',
}
+ export type SearchByTextRankPreferenceString = `${google.maps.places.SearchByTextRankPreference}`;
/**
- * 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.
+ * Request interface for {@link google.maps.places.Place.searchByText}.
*/
- export enum TransitMode {
- /**
- * Specifies bus as a preferred mode of transit.
- */
- BUS = 'BUS',
+ export interface SearchByTextRequest {
/**
- * Specifies rail as a preferred mode of transit.
+ * EV-related options that can be specified for a place search request.
*/
- RAIL = 'RAIL',
+ evSearchOptions?: google.maps.places.EVSearchOptions;
/**
- * Specifies subway as a preferred mode of transit.
+ * 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.
*/
- SUBWAY = 'SUBWAY',
+ fields: string[];
/**
- * Specifies train as a preferred mode of transit.
+ * 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}
*/
- TRAIN = 'TRAIN',
+ includedType?: string;
/**
- * Specifies tram as a preferred mode of transit.
+ * Used to restrict the search to places that are currently open.
+ * @defaultValue false
*/
- TRAM = 'TRAM',
- }
- /**
- * The TransitOptions object to be included in a DirectionsRequest when the travel mode
- * is set to TRANSIT.
- */
- export interface TransitOptions {
+ isOpenNow?: boolean;
/**
- * 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.
+ * 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.
*/
- arrivalTime?: Date | null;
+ language?: string;
/**
- * 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".
+ * 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.
*/
- departureTime?: Date | null;
+ locationBias?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | google.maps.CircleLiteral | google.maps.Circle;
/**
- * One or more preferred modes of transit, such as bus or train. If no
- * preference is given, the API returns the default best route.
+ * 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.
*/
- modes?: google.maps.TransitMode[] | null;
+ locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
/**
- * 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.
+ * Maximum number of results to return. It must be between 1 and 20, inclusively.
*/
- routingPreference?: google.maps.TransitRoutePreference | null;
- }
- /**
- * 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 {
+ maxResultCount?: number;
/**
- * Specifies that the calculated route should prefer a limited number of
- * transfers.
+ * 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.
*/
- FEWER_TRANSFERS = 'FEWER_TRANSFERS',
+ minRating?: number;
/**
- * Specifies that the calculated route should prefer limited amounts of
- * walking.
+ * 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.
*/
- LESS_WALKING = 'LESS_WALKING',
- }
- /**
- * Details about a transit stop or station.
- */
- export interface TransitStop {
+ priceLevels?: google.maps.places.PriceLevelString[];
/**
- * The location of this stop.
+ * How results will be ranked in the response.
+ * @defaultValue SearchByTextRankPreference.RELEVANCE
*/
- location: google.maps.LatLng;
+ rankPreference?: google.maps.places.SearchByTextRankPreferenceString;
/**
- * The name of this transit stop.
+ * 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.
*/
- name: string;
- }
- /**
- * Information about the vehicle that operates on a transit line.
- */
- export interface TransitVehicle {
+ region?: string;
/**
- * A URL for an icon that corresponds to the type of vehicle used on this
- * line.
+ * Required when you do not use {@link google.maps.places.SearchByTextRequest.query}. The text query for textual search.
*/
- icon: string;
+ textQuery?: string;
/**
- * A URL for an icon that corresponds to the type of vehicle used in this
- * region instead of the more general icon.
+ * 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
*/
- local_icon: string;
+ useStrictTypeFiltering?: boolean;
/**
- * A name for this type of TransitVehicle, e.g. "Train" or
- * "Bus".
+ * @deprecated Please use textQuery instead
*/
- name: string;
+ query?: string;
/**
- * The type of vehicle used, e.g. train, bus, or ferry.
+ * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * @deprecated Please use rankPreference instead.
*/
- type: google.maps.VehicleType;
+ rankBy?: google.maps.places.SearchByTextRankPreferenceString;
}
/**
- * 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.
+ * EV-related options that can be specified for a place search request.
*/
- export enum TravelMode {
- /**
- * Specifies a bicycling directions request.
- */
- BICYCLING = 'BICYCLING',
- /**
- * Specifies a driving directions request.
- */
- DRIVING = 'DRIVING',
+ export interface EVSearchOptions {
/**
- * Specifies a transit directions request.
+ * The list of preferred EV connector types. A place that does not support any of the listed connector types is filtered out.
*/
- TRANSIT = 'TRANSIT',
+ connectorTypes?: google.maps.places.EVConnectorTypeString[];
/**
- * Specifies a walking directions request.
+ * Minimum required charging rate in kilowatts. A place with a charging rate less than the specified rate is filtered out.
*/
- WALKING = 'WALKING',
+ minimumChargingRateKw?: number;
}
/**
- * The valid unit systems that can be specified in a DirectionsRequest.
+ * RankPreference enum for SearchNearbyRequest.
*
- * Access by calling `const {UnitSystem} = await
- * google.maps.importLibrary("core")`. 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 UnitSystem {
+ export enum SearchNearbyRankPreference {
/**
- * Specifies that distances in the DirectionsResult should be
- * expressed in imperial units.
+ * Ranks results by distance.
*/
- IMPERIAL = 0.0,
+ DISTANCE = 'DISTANCE',
/**
- * Specifies that distances in the DirectionsResult should be
- * expressed in metric units.
+ * Ranks results by popularity.
*/
- METRIC = 1.0,
+ POPULARITY = 'POPULARITY',
}
+ export type SearchNearbyRankPreferenceString = `${google.maps.places.SearchNearbyRankPreference}`;
/**
- * Possible values for vehicle types.
- *
- * Access by calling `const {VehicleType} = await
- * google.maps.importLibrary("routes")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Request interface for {@link google.maps.places.Place.searchNearby}. For more information on the request, see Places API reference.
*/
- export enum VehicleType {
- /**
- * Bus.
- */
- BUS = 'BUS',
+ export interface SearchNearbyRequest {
/**
- * A vehicle that operates on a cable, usually on the ground. Aerial cable
- * cars may be of the type GONDOLA_LIFT.
+ * 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.
*/
- CABLE_CAR = 'CABLE_CAR',
+ excludedPrimaryTypes?: string[];
/**
- * Commuter rail.
+ * 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.
*/
- COMMUTER_TRAIN = 'COMMUTER_TRAIN',
+ excludedTypes?: string[];
/**
- * Ferry.
+ * 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.
*/
- FERRY = 'FERRY',
+ fields: string[];
/**
- * A vehicle that is pulled up a steep incline by a cable.
+ * 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.
*/
- FUNICULAR = 'FUNICULAR',
+ includedPrimaryTypes?: string[];
/**
- * An aerial cable car.
+ * 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.
*/
- GONDOLA_LIFT = 'GONDOLA_LIFT',
+ includedTypes?: string[];
/**
- * Heavy rail.
+ * 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.
*/
- HEAVY_RAIL = 'HEAVY_RAIL',
+ language?: string;
/**
- * High speed train.
+ * The region to search, specified as a circle with center and radius. Results outside given location are not returned.
*/
- HIGH_SPEED_TRAIN = 'HIGH_SPEED_TRAIN',
+ locationRestriction: google.maps.Circle | google.maps.CircleLiteral;
/**
- * Intercity bus.
+ * Maximum number of results to return. For acceptable values and default, see Places API reference.
*/
- INTERCITY_BUS = 'INTERCITY_BUS',
+ maxResultCount?: number;
/**
- * Light rail.
+ * How results will be ranked in the response.
+ * @defaultValue SearchNearbyRankPreference.POPULARITY
*/
- METRO_RAIL = 'METRO_RAIL',
+ rankPreference?: google.maps.places.SearchNearbyRankPreferenceString;
/**
- * Monorail.
+ * 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.
*/
- MONORAIL = 'MONORAIL',
+ 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 {
/**
- * Other vehicles.
+ *
+ * @param options
*/
- OTHER = 'OTHER',
+ constructor(options: google.maps.places.PlaceOptions);
/**
- * Rail.
+ * Accessibility options of this Place. undefined if the accessibility options data have not been called for from the server.
*/
- RAIL = 'RAIL',
+ get accessibilityOptions(): google.maps.places.AccessibilityOptions | null | undefined;
/**
- * 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.
+ * 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.
*/
- SHARE_TAXI = 'SHARE_TAXI',
+ get addressComponents(): google.maps.places.AddressComponent[] | undefined;
/**
- * Underground light rail.
+ * The representation of the Place’s address in the adr microformat.
*/
- SUBWAY = 'SUBWAY',
+ get adrFormatAddress(): string | null | undefined;
+
+ get allowsDogs(): boolean | null | undefined;
/**
- * Above ground light rail.
+ * Data providers that must be shown for the Place.
*/
- TRAM = 'TRAM',
+ get attributions(): google.maps.places.Attribution[] | undefined;
/**
- * Trolleybus.
+ * The location's operational status. null if there is no known status. undefined if the status data has not been loaded from the server.
*/
- TROLLEYBUS = 'TROLLEYBUS',
- }
- /**
- * 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 VisibleRegion {
- farLeft: google.maps.LatLng;
- farRight: google.maps.LatLng;
+ get businessStatus(): google.maps.places.BusinessStatusString | null | undefined;
/**
- * The smallest bounding box that includes the visible region.
+ * The consumer alert for this place.
*/
- latLngBounds: google.maps.LatLngBounds;
- nearLeft: google.maps.LatLng;
- nearRight: google.maps.LatLng;
- }
- export interface VisualizationLibrary {
- HeatmapLayer: typeof google.maps.visualization.HeatmapLayer;
- }
- /**
- * Drawing options.
- */
- export interface WebGLDrawOptions {
+ get consumerAlert(): google.maps.places.ConsumerAlert | null | undefined;
/**
- * The WebGLRenderingContext on which to render this WebGLOverlayView.
+ * The hours of operation for the next seven days (including today). This includes exceptional hours like holidays and irregular closures.
*/
- gl: WebGLRenderingContext;
+ get currentOpeningHours(): google.maps.places.OpeningHours | null | undefined;
/**
- * The matrix transformation from camera space to latitude/longitude
- * coordinates.
+ * 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.
*/
- transformer: google.maps.CoordinateTransformer;
- }
- /**
- * 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 class WebGLOverlayView extends google.maps.MVCObject {
- getMap(): google.maps.Map | null | undefined;
+ get currentSecondaryOpeningHours(): google.maps.places.SecondaryOpeningHours[] | undefined;
/**
- * 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 location's display name. null if there is no name. undefined if the name data has not been loaded from the server.
*/
- onAdd(): void;
+ get displayName(): string | null | undefined;
/**
- * 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.
+ * 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.
*/
- onContextLost(): void;
+ get displayNameLanguageCode(): string | null | undefined;
/**
- * 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.
- * @param options that allow developers to restore the GL context.
+ * The editorial summary for this place. null if there is no editorial summary. undefined if this field has not yet been requested.
*/
- onContextRestored(options: google.maps.WebGLStateOptions): void;
+ get editorialSummary(): string | null | undefined;
/**
- * 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}.
- * @param options that allow developers to render content to an associated
- * Google basemap.
+ * 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.
*/
- onDraw(options: google.maps.WebGLDrawOptions): void;
+ get editorialSummaryLanguageCode(): string | null | undefined;
/**
- * 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 EVChargeAmenitySummary for this place.
*/
- onRemove(): void;
+ get evChargeAmenitySummary(): google.maps.places.EVChargeAmenitySummary | null | undefined;
/**
- * Implement this method to handle any GL state updates outside of the
- * render animation frame.
- * @param options that allow developerse to restore the GL context.
+ * EV Charge options provided by the place. undefined if the EV charge options have not been called for from the server.
*/
- onStateUpdate(options: google.maps.WebGLStateOptions): void;
+ get evChargeOptions(): google.maps.places.EVChargeOptions | null | undefined;
/**
- * Triggers the map to redraw a frame.
+ * The location’s full address.
*/
- requestRedraw(): void;
+ get formattedAddress(): string | null | undefined;
/**
- * Triggers the map to update GL state.
+ * Fuel options provided by the place. undefined if the fuel options have not been called for from the server.
*/
- requestStateUpdate(): void;
+ get fuelOptions(): google.maps.places.FuelOptions | null | undefined;
/**
- * Adds the overlay to the map.
- * @param map The map to access the div, model and view state.
+ * The GenerativeSummary for this place.
*/
- setMap(map?: google.maps.Map | null): void;
- }
- /**
- * GL state options.
- */
- export interface WebGLStateOptions {
+ get generativeSummary(): google.maps.places.GenerativeSummary | null | undefined;
/**
- * The WebGLRenderingContext on which to render this WebGLOverlayView.
+ * Links to trigger different Google Maps actions.
*/
- gl: WebGLRenderingContext;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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 {
+ get googleMapsLinks(): google.maps.places.GoogleMapsLinks | null | undefined;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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.
+ * URL of the official Google page for this place. This is the Google-owned page that contains the best available information about the Place.
*/
- constructor();
- }
- /**
- * Options for the rendering of the zoom control.
- */
- export interface ZoomControlOptions {
+ get googleMapsURI(): string | null | undefined;
/**
- * Position id. Used to specify the position of the control on the map.
- * @defaultValue {@link google.maps.ControlPosition.INLINE_END_BLOCK_END}
+ * 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.
*/
- position?: google.maps.ControlPosition | null;
- }
- /**
- * Namespace for all public event functions
- *
- * Access by calling `const {event} = await
- * google.maps.importLibrary("core")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class event {
- /**
- * 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.
- */
- static addDomListener(
- this: any,
- 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.
- */
- static addDomListenerOnce(
- this: any,
- instance: object,
- eventName: string,
- handler: Function,
- capture?: boolean,
- ): google.maps.MapsEventListener;
- /**
- * 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().
- */
- static addListener(
- this: any,
- instance: object,
- eventName: string,
- handler: Function,
- ): google.maps.MapsEventListener;
- /**
- * Like addListener, but the handler removes itself after handling the first
- * event.
- */
- static addListenerOnce(
- this: any,
- instance: object,
- eventName: string,
- handler: Function,
- ): google.maps.MapsEventListener;
- /**
- * Removes all listeners for all events for the given instance.
- */
- static clearInstanceListeners(this: any, instance: object): void;
- /**
- * Removes all listeners for the given event for the given instance.
- */
- static clearListeners(this: any, 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.
- */
- static hasListeners(
- this: any,
- instance: object,
- eventName: string,
- ): boolean;
- /**
- * Removes the given listener, which should have been returned by
- * addListener above. Equivalent to calling listener.remove().
- */
- static removeListener(
- this: any,
- listener: google.maps.MapsEventListener,
- ): void;
- /**
- * Triggers the given event. All arguments after eventName are passed as
- * arguments to the listeners.
- */
- static trigger(
- this: any,
- instance: object,
- eventName: string,
- ...eventArgs: any[]
- ): void;
- }
- /**
- * 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: string,
- ): Promise<
- | google.maps.CoreLibrary
- | google.maps.MapsLibrary
- | google.maps.Maps3DLibrary
- | google.maps.PlacesLibrary
- | google.maps.GeocodingLibrary
- | google.maps.RoutesLibrary
- | google.maps.MarkerLibrary
- | google.maps.GeometryLibrary
- | google.maps.ElevationLibrary
- | google.maps.StreetViewLibrary
- | google.maps.JourneySharingLibrary
- | google.maps.DrawingLibrary
- | google.maps.VisualizationLibrary
- >;
- /**
- * Google Maps JavaScript API version loaded by the browser. See https://developers.google.com/maps/documentation/javascript/versions
- */
- export let version: string;
-}
-declare namespace google.maps.Data {
- /**
- * The properties of a addfeature event.
- */
- export interface AddFeatureEvent {
+ get hasCurbsidePickup(): boolean | null | undefined;
/**
- * The feature that was added to the FeatureCollection.
+ * 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.
*/
- feature: google.maps.Data.Feature;
- }
- /**
- * DataOptions object used to define the properties that a developer can set
- * on a Data object.
- */
- export interface DataOptions {
+ get hasDelivery(): boolean | null | undefined;
/**
- * The position of the drawing controls on the map.
- * @defaultValue {@link google.maps.ControlPosition.TOP_LEFT}
+ * 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.
*/
- controlPosition?: google.maps.ControlPosition;
+ 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;
/**
- * 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
+ * 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.
*/
- controls?: string[] | null;
+ get hasTakeout(): boolean | 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
+ * The default HEX color code for the place's category.
*/
- drawingMode?: string | null;
+ get iconBackgroundColor(): 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 unique place id.
*/
- featureFactory?:
- | ((a: google.maps.Data.Geometry) => google.maps.Data.Feature)
- | null;
+ id: string;
/**
- * Map on which to display the features in the collection.
+ * The Place’s phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign.
*/
- map: google.maps.Map;
+ get internationalPhoneNumber(): string | null | undefined;
+
+ get isGoodForChildren(): boolean | null | undefined;
+
+ get isGoodForGroups(): boolean | null | undefined;
+
+ get isGoodForWatchingSports(): boolean | null | undefined;
/**
- * Style for all features in the collection. For more details, see the
- * setStyle() method above.
+ * 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.
*/
- 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 {
+ get isReservable(): boolean | null | undefined;
/**
- * 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.
+ * The Place’s position.
*/
- constructor(options?: google.maps.Data.FeatureOptions | null);
+ get location(): google.maps.LatLng | null | undefined;
/**
- * Repeatedly invokes the given function, passing a property value and name
- * on each invocation. The order of iteration through the properties is
- * undefined.
+ * The Place’s phone number, formatted according to the number's regional convention.
*/
- forEachProperty(callback: (a: unknown, b: string) => void): void;
+ get nationalPhoneNumber(): string | null | undefined;
/**
- * Returns the feature's geometry.
+ * The NeighborhoodSummary for this place.
*/
- getGeometry(): google.maps.Data.Geometry | null;
+ get neighborhoodSummary(): google.maps.places.NeighborhoodSummary | null | undefined;
/**
- * Returns the feature ID.
+ * Options of parking provided by the place. undefined if the parking options data have not been called for from the server.
*/
- getId(): number | string | undefined;
+ get parkingOptions(): google.maps.places.ParkingOptions | null | undefined;
/**
- * Returns the value of the requested property, or undefined if
- * the property does not exist.
+ * Payment options provided by the place. undefined if the payment options data have not been called for from the server.
*/
- getProperty(name: string): unknown;
+ get paymentOptions(): google.maps.places.PaymentOptions | null | undefined;
/**
- * Removes the property with the given name.
+ * Photos of this Place. The collection will contain up to ten {@link google.maps.places.Photo} objects.
*/
- removeProperty(name: string): void;
+ get photos(): google.maps.places.Photo[] | undefined;
+
+ get plusCode(): google.maps.places.PlusCode | null | undefined;
+
+ get postalAddress(): google.maps.places.PostalAddress | null | undefined;
/**
- * Sets the feature's geometry.
+ * The price level of the Place. This property can return any of the following values
*/
- setGeometry(
- newGeometry:
- | google.maps.Data.Geometry
- | null
- | google.maps.LatLng
- | google.maps.LatLngLiteral,
- ): void;
+ get priceLevel(): google.maps.places.PriceLevelString | null | undefined;
/**
- * Sets the value of the specified property. If FreeInexpensiveModerateExpensiveVery ExpensivenewValue is
- * undefined this is equivalent to calling
- * removeProperty.
+ * The price range for this Place. endPrice could be unset, which indicates a range without upper bound (e.g. "More than $100").
*/
- setProperty(name: string, newValue: unknown): void;
+ get priceRange(): google.maps.places.PriceRange | null | undefined;
/**
- * Exports the feature to a GeoJSON object.
+ * The location's primary type. null if there is no type. undefined if the type data has not been loaded from the server.
*/
- toGeoJson(callback: (a: object) => void): void;
- }
- /**
- * Optional parameters for creating Data.Feature objects.
- */
- export interface FeatureOptions {
+ get primaryType(): string | null | undefined;
/**
- * 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.
+ * 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.
*/
- geometry?:
- | google.maps.Data.Geometry
- | null
- | google.maps.LatLng
- | google.maps.LatLngLiteral;
+ get primaryTypeDisplayName(): string | null | undefined;
/**
- * 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.
+ * 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.
*/
- id?: number | string;
+ get primaryTypeDisplayNameLanguageCode(): string | null | undefined;
/**
- * The feature properties. This is an arbitrary mapping of property names to
- * values.
+ * A rating, between 1.0 to 5.0, based on user reviews of this Place.
*/
- properties?: object | null;
- }
- /**
- * Optional parameters for importing GeoJSON.
- */
- export interface GeoJsonOptions {
+ get rating(): number | null | undefined;
/**
- * The name of the Feature property to use as the feature ID. If not
- * specified, the GeoJSON Feature id will be used.
+ * The regular hours of operation for this place. This does not include exceptional hours like holidays.
*/
- idPropertyName?: string | null;
- }
- /**
- * A superclass for the various geometry objects.
- */
- export interface Geometry {
+ get regularOpeningHours(): google.maps.places.OpeningHours | null | undefined;
/**
- * Repeatedly invokes the given function, passing a point from the geometry
- * to the function on each invocation.
+ * 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.
*/
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
+ get regularSecondaryOpeningHours(): google.maps.places.SecondaryOpeningHours[] | undefined;
/**
- * Returns the type of the geometry object. Possibilities are
- * "Point", "MultiPoint",
- * "LineString", "MultiLineString",
- * "LinearRing", "Polygon",
- * "MultiPolygon", or "GeometryCollection".
+ * The requested language for this place.
*/
- getType(): string;
- }
- /**
- * 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 {
+ requestedLanguage?: string | null;
/**
- * 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.
- */
- constructor(
- elements: (
- | google.maps.Data.Geometry
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- )[],
- );
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
- /**
- * Returns an array of the contained geometry objects. A new array is
- * returned each time getArray() is called.
+ * The requested region for this place.
*/
- getArray(): google.maps.Data.Geometry[];
+ requestedRegion?: string | null;
/**
- * Returns the n-th contained geometry object.
+ * The unique place resource name.
*/
- getAt(n: number): google.maps.Data.Geometry;
+ resourceName: string;
/**
- * Returns the number of contained geometry objects.
+ * A list of reviews for this Place.
*/
- getLength(): number;
+ get reviews(): google.maps.places.Review[] | undefined;
/**
- * Returns the string "GeometryCollection".
+ * The ReviewSummary for this place.
*/
- getType(): string;
- }
- /**
- * 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 LineString implements google.maps.Data.Geometry {
+ get reviewSummary(): google.maps.places.ReviewSummary | null | undefined;
/**
- * 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.
+ * 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.
*/
- constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]);
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
+ get servesBeer(): boolean | null | undefined;
/**
- * Returns an array of the contained LatLngs. A new array is
- * returned each time getArray() is called.
+ * 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.
*/
- getArray(): google.maps.LatLng[];
+ get servesBreakfast(): boolean | null | undefined;
/**
- * Returns the n-th contained LatLng.
+ * 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.
*/
- getAt(n: number): google.maps.LatLng;
+ get servesBrunch(): boolean | null | undefined;
+
+ get servesCocktails(): boolean | null | undefined;
+
+ get servesCoffee(): boolean | null | undefined;
+
+ get servesDessert(): boolean | null | undefined;
/**
- * Returns the number of contained LatLngs.
+ * 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.
*/
- getLength(): number;
+ get servesDinner(): boolean | null | undefined;
/**
- * Returns the string "LineString".
+ * 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.
*/
- 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 servesLunch(): boolean | null | undefined;
/**
- * 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.
+ * 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.
*/
- constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]);
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
+ get servesVegetarianFood(): boolean | null | undefined;
/**
- * Returns an array of the contained LatLngs. A new array is
- * returned each time getArray() is called.
+ * 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.
*/
- getArray(): google.maps.LatLng[];
+ get servesWine(): boolean | null | undefined;
/**
- * Returns the n-th contained LatLng.
+ * The location’s short address.
*/
- getAt(n: number): google.maps.LatLng;
+ get shortFormattedAddress(): string | null | undefined;
/**
- * Returns the number of contained LatLngs.
+ * 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.
*/
- getLength(): number;
+ get subDestinations(): google.maps.places.Place[] | undefined;
/**
- * Returns the string "LinearRing".
+ * URI to the svg image mask resource that can be used to represent a place’s category.
*/
- getType(): string;
- }
- /**
- * This object is passed to mouse event handlers on a Data
- * object.
- */
- export interface MouseEvent extends google.maps.MapMouseEvent {
+ get svgIconMaskURI(): string | null | undefined;
/**
- * The feature which generated the mouse event.
+ * An array of types for this Place (for example, ["political", "locality"] or ["restaurant", "establishment"]).
*/
- feature: google.maps.Data.Feature;
- }
- /**
- * 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 class MultiLineString implements google.maps.Data.Geometry {
+ get types(): string[] | undefined;
/**
- * 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.
+ * The number of user ratings which contributed to this Place’s {@link google.maps.places.Place.rating}.
*/
- constructor(
- elements: (
- | google.maps.Data.LineString
- | (google.maps.LatLng | google.maps.LatLngLiteral)[]
- )[],
- );
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
+ get userRatingCount(): number | null | undefined;
/**
- * Returns an array of the contained Data.LineStrings. A new
- * array is returned each time getArray() is called.
+ * 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.
*/
- getArray(): google.maps.Data.LineString[];
+ get utcOffsetMinutes(): number | null | undefined;
/**
- * Returns the n-th contained Data.LineString.
+ * The preferred viewport when displaying this Place on a map.
*/
- getAt(n: number): google.maps.Data.LineString;
+ get viewport(): google.maps.LatLngBounds | null | undefined;
/**
- * Returns the number of contained Data.LineStrings.
+ * The authoritative website for this Place, such as a business' homepage.
*/
- getLength(): number;
+ get websiteURI(): string | null | undefined;
/**
- * Returns the string "MultiLineString".
+ * @deprecated Use {@link google.maps.places.Place.regularOpeningHours} instead.
*/
- getType(): string;
- }
- /**
- * 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 class MultiPoint implements google.maps.Data.Geometry {
+ get openingHours(): google.maps.places.OpeningHours | null | undefined;
/**
- * 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.
+ * @deprecated This field was accidentally documented, but has never actually been populated.
*/
- constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]);
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
+ get hasWiFi(): boolean | null | undefined;
/**
- * Returns an array of the contained LatLngs. A new array is
- * returned each time getArray() is called.
+ * Text query based place search.
*/
- getArray(): google.maps.LatLng[];
+ static searchByText(request: google.maps.places.SearchByTextRequest): Promise<{places: google.maps.places.Place[]}>;
/**
- * Returns the n-th contained LatLng.
+ * Search for nearby places.
*/
- getAt(n: number): google.maps.LatLng;
+ 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}>;
/**
- * Returns the number of contained LatLngs.
+ * 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.
*/
- getLength(): number;
+ getNextOpeningTime(date?: Date): Promise"MultiPoint".
+ * 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.
*/
- getType(): string;
+ isOpen(date?: Date): PromiseData.Polygons.
- *
- * Access by calling `const {Data} = await google.maps.importLibrary("maps")`.
- * See https://developers.google.com/maps/documentation/javascript/libraries.
+ * Options for PlaceDetailsPlaceRequestElement.
*/
- export class MultiPolygon implements google.maps.Data.Geometry {
+ export interface PlaceDetailsPlaceRequestElementOptions {
/**
- * 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.
- */
- constructor(
- elements: (
- | google.maps.Data.Polygon
- | (
- | google.maps.Data.LinearRing
- | (google.maps.LatLng | google.maps.LatLngLiteral)[]
- )[]
- )[],
- );
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
- /**
- * Returns an array of the contained Data.Polygons. A new array
- * is returned each time getArray() is called.
+ * See {@link google.maps.places.PlaceDetailsPlaceRequestElement.place}
*/
- getArray(): google.maps.Data.Polygon[];
+ 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:
+ * 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 {
/**
- * Returns the <gmp-place-details>
<gmp-place-details-place-request
place="PLACE_ID"
></gmp-place-details-place-request>
</gmp-place-details> n-th contained Data.Polygon.
+ *
+ * @param options
*/
- getAt(n: number): google.maps.Data.Polygon;
+ constructor(options?: google.maps.places.PlaceDetailsPlaceRequestElementOptions);
/**
- * Returns the number of contained Data.Polygons.
+ * 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
*/
- getLength(): number;
+ get place(): google.maps.places.Place | null;
/**
- * Returns the string "MultiPolygon".
+ * 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
*/
- getType(): string;
+ set place(value: google.maps.places.Place | string | null | undefined);
+ addEventListenerLatLng.
- *
- * Access by calling `const {Data} = await google.maps.importLibrary("maps")`.
- * See https://developers.google.com/maps/documentation/javascript/libraries.
+ * Options for PlaceDetailsCompactElement.
*/
- export class Point implements google.maps.Data.Geometry {
+ export interface PlaceDetailsCompactElementOptions {
/**
- * 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.
+ * See {@link google.maps.places.PlaceDetailsCompactElement.orientation}.
*/
- constructor(latLng: google.maps.LatLng | google.maps.LatLngLiteral);
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
- /**
- * Returns the contained LatLng.
- */
- get(): google.maps.LatLng;
+ orientation?: google.maps.places.PlaceDetailsOrientationString | null;
/**
- * Returns the string "Point".
+ * See {@link google.maps.places.PlaceDetailsCompactElement.truncationPreferred}.
*/
- getType(): string;
+ truncationPreferred?: boolean | null;
}
/**
- * 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.
+ * 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 Polygon implements google.maps.Data.Geometry {
+ export class PlaceDetailsCompactElement extends HTMLElement implements google.maps.places.PlaceDetailsCompactElementOptions {
/**
- * 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.
- */
- constructor(
- elements: (
- | google.maps.Data.LinearRing
- | (google.maps.LatLng | google.maps.LatLngLiteral)[]
- )[],
- );
- forEachLatLng(callback: (a: google.maps.LatLng) => void): void;
- /**
- * Returns an array of the contained Data.LinearRings. A new
- * array is returned each time getArray() is called.
+ *
+ * @param options
*/
- getArray(): google.maps.Data.LinearRing[];
+ constructor(options?: google.maps.places.PlaceDetailsCompactElementOptions);
/**
- * Returns the n-th contained Data.LinearRing.
+ * The orientation variant (vertical or horizontal) of the element.
+ * @defaultValue PlaceDetailsOrientation.VERTICAL
*/
- getAt(n: number): google.maps.Data.LinearRing;
+ orientation?: google.maps.places.PlaceDetailsOrientationString | null;
/**
- * Returns the number of contained Data.LinearRings.
+ * Read only. Place object containing the ID, location, and viewport of the currently rendered place.
*/
- getLength(): number;
+ get place(): google.maps.places.Place | undefined;
/**
- * Returns the string "Polygon".
+ * If true, truncates the place name and address to fit on one line instead of wrapping.
+ * @defaultValue false
*/
- getType(): string;
+ get truncationPreferred(): boolean;
+ /**
+ * If true, truncates the place name and address to fit on one line instead of wrapping.
+ * @defaultValue false
+ */
+ set truncationPreferred(value: boolean | null | undefined);
+ addEventListenerremovefeature event.
+ * Options for PlaceDetailsElement.
*/
- export interface RemoveFeatureEvent {
+ export interface PlaceDetailsElementOptions {
+ }
+ /**
+ * 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 feature that was removed from the FeatureCollection.
+ *
+ * @param options
*/
- feature: google.maps.Data.Feature;
+ constructor(options?: google.maps.places.PlaceDetailsElementOptions);
+ /**
+ * Read only. Place object containing the ID, location, and viewport of the currently rendered place.
+ */
+ get place(): google.maps.places.Place | undefined;
+ addEventListenerremoveproperty event.
+ * 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.
*/
- export interface RemovePropertyEvent {
+ export enum PlaceSearchOrientation {
/**
- * The feature whose property was removed.
+ * Horizontal orientation.
*/
- feature: google.maps.Data.Feature;
+ HORIZONTAL = 'HORIZONTAL',
/**
- * The property name.
+ * Vertical orientation.
*/
- name: string;
+ VERTICAL = 'VERTICAL',
+ }
+ export type PlaceSearchOrientationString = `${google.maps.places.PlaceSearchOrientation}`;
+ /**
+ * 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 previous value.
+ * Attribution at the bottom of the PlaceSearchElement
*/
- oldValue: unknown;
+ BOTTOM = 'BOTTOM',
+ /**
+ * Attribution at the top of the PlaceSearchElement
+ */
+ TOP = 'TOP',
}
+ export type PlaceSearchAttributionPositionString = `${google.maps.places.PlaceSearchAttributionPosition}`;
/**
- * The properties of a setgeometry event.
+ * Options for PlaceSearchElement.
*/
- export interface SetGeometryEvent {
+ export interface PlaceSearchElementOptions {
/**
- * The feature whose geometry was set.
+ * See {@link google.maps.places.PlaceSearchElement.attributionPosition}.
*/
- feature: google.maps.Data.Feature;
+ attributionPosition?: google.maps.places.PlaceSearchAttributionPositionString | null;
/**
- * The new feature geometry.
+ * See {@link google.maps.places.PlaceSearchElement.orientation}.
*/
- newGeometry?: google.maps.Data.Geometry;
+ orientation?: google.maps.places.PlaceSearchOrientationString | null;
/**
- * The previous feature geometry.
+ * See {@link google.maps.places.PlaceSearchElement.selectable}
*/
- oldGeometry?: google.maps.Data.Geometry;
+ selectable?: boolean | null;
+ /**
+ * See {@link google.maps.places.PlaceSearchElement.truncationPreferred}.
+ */
+ truncationPreferred?: boolean | null;
}
/**
- * The properties of a setproperty event.
+ * Options for PlaceNearbySearchRequestElement.
*/
- export interface SetPropertyEvent {
+ export interface PlaceNearbySearchRequestElementOptions {
/**
- * The feature whose property was set.
+ * Excluded primary place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.excludedPrimaryTypes} and {@link google.maps.places.SearchNearbyRequest.excludedPrimaryTypes} for more details.
*/
- feature: google.maps.Data.Feature;
+ excludedPrimaryTypes?: string[] | null;
/**
- * The property name.
+ * Excluded place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.excludedTypes} and {@link google.maps.places.SearchNearbyRequest.excludedTypes} for more details.
*/
- name: string;
+ excludedTypes?: string[] | null;
/**
- * The new value.
+ * Included primary place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.includedPrimaryTypes} and {@link google.maps.places.SearchNearbyRequest.includedPrimaryTypes} for more details.
*/
- newValue: unknown;
+ includedPrimaryTypes?: string[] | null;
/**
- * The previous value. Will be undefined if the property was
- * added.
+ * Included place types. See {@link google.maps.places.PlaceNearbySearchRequestElement.includedTypes} and {@link google.maps.places.SearchNearbyRequest.includedTypes} for more details.
*/
- oldValue: unknown;
- }
- /**
- * These options specify the way a Feature should appear when displayed on a
- * map.
- */
- export interface StyleOptions {
+ includedTypes?: string[] | null;
/**
- * The animation to play when marker is added to a map. Only applies to
- * point geometries.
+ * The region to search. See {@link google.maps.places.PlaceNearbySearchRequestElement.locationRestriction} and {@link google.maps.places.SearchNearbyRequest.locationRestriction} for more details.
*/
- animation?: google.maps.Animation;
+ locationRestriction?: google.maps.Circle | google.maps.CircleLiteral | null;
/**
- * If true, the marker receives mouse and touch events.
- * @defaultValue true
+ * Maximum number of results to return. See {@link google.maps.places.PlaceNearbySearchRequestElement.maxResultCount} and {@link google.maps.places.SearchNearbyRequest.maxResultCount} for more details.
*/
- clickable?: boolean;
+ maxResultCount?: number | null;
/**
- * Mouse cursor to show on hover. Only applies to point geometries.
+ * How results will be ranked in the response. See {@link google.maps.places.PlaceNearbySearchRequestElement.rankPreference} and {@link google.maps.places.SearchNearbyRankPreference} for more details.
*/
- cursor?: string;
+ rankPreference?: google.maps.places.SearchNearbyRankPreferenceString | null;
+ }
+ /**
+ * 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:
+ * Access by calling `const {PlaceNearbySearchRequestElement} = await google.maps.importLibrary("places");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class PlaceNearbySearchRequestElement extends HTMLElement implements google.maps.places.PlaceNearbySearchRequestElementOptions {
/**
- * If <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> true, the object can be dragged across the map and the
- * underlying feature will have its geometry updated.
- * @defaultValue false
+ *
+ * @param options
*/
- draggable?: boolean;
+ constructor(options?: google.maps.places.PlaceNearbySearchRequestElementOptions);
/**
- * 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
+ * Excluded primary place types.
+ * @defaultValue null
*/
- editable?: boolean;
+ get excludedPrimaryTypes(): string[] | null;
/**
- * The fill color. All CSS3 colors are supported except for extended named
- * colors. Only applies to polygon geometries.
+ * Excluded primary place types.
+ * @defaultValue null
*/
- fillColor?: string;
+ set excludedPrimaryTypes(value: string[] | null | undefined);
/**
- * The fill opacity between 0.0 and 1.0. Only applies to polygon geometries.
+ * Excluded place types.
+ * @defaultValue null
*/
- fillOpacity?: number;
+ get excludedTypes(): string[] | null;
/**
- * 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.
+ * Excluded place types.
+ * @defaultValue null
*/
- icon?: string | google.maps.Icon | google.maps.Symbol;
+ set excludedTypes(value: string[] | null | undefined);
/**
- * The icons to be rendered along a polyline. Only applies to line
- * geometries.
+ * Included primary place type.
+ * @defaultValue null
*/
- icons?: google.maps.IconSequence[];
+ get includedPrimaryTypes(): string[] | null;
/**
- * Adds a label to the marker. The label can either be a string, or a
- * MarkerLabel object. Only applies to point geometries.
+ * Included primary place type.
+ * @defaultValue null
*/
- label?: string | google.maps.MarkerLabel;
+ set includedPrimaryTypes(value: string[] | null | undefined);
/**
- * The marker's opacity between 0.0 and 1.0. Only applies to point
- * geometries.
+ * Included place type.
+ * @defaultValue null
*/
- opacity?: number;
+ get includedTypes(): string[] | null;
/**
- * Defines the image map used for hit detection. Only applies to point
- * geometries.
+ * Included place type.
+ * @defaultValue null
*/
- shape?: google.maps.MarkerShape;
+ set includedTypes(value: string[] | null | undefined);
/**
- * The stroke color. All CSS3 colors are supported except for extended named
- * colors. Only applies to line and polygon geometries.
+ * The region to search. Normalizes to a Circle.
+ * @defaultValue null
*/
- strokeColor?: string;
+ get locationRestriction(): google.maps.Circle | null;
/**
- * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon
- * geometries.
+ * The region to search. Normalizes to a Circle.
+ * @defaultValue null
*/
- strokeOpacity?: number;
+ set locationRestriction(value: google.maps.Circle | google.maps.CircleLiteral | null | undefined);
/**
- * The stroke width in pixels. Only applies to line and polygon geometries.
+ * Maximum number of results to return.
+ * @defaultValue null
*/
- strokeWeight?: number;
+ get maxResultCount(): number | null;
/**
- * Rollover text. Only applies to point geometries.
+ * Maximum number of results to return.
+ * @defaultValue null
*/
- title?: string;
+ set maxResultCount(value: number | null | undefined);
/**
- * Whether the feature is visible.
- * @defaultValue true
+ * How results will be ranked in the response.
+ * @defaultValue null
*/
- visible?: boolean;
+ get rankPreference(): google.maps.places.SearchNearbyRankPreferenceString | 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.
+ * How results will be ranked in the response.
+ * @defaultValue null
*/
- zIndex?: number;
+ set rankPreference(value: google.maps.places.SearchNearbyRankPreferenceString | null | undefined);
+ addEventListenerPlaceTextSearchRequestElement.
*/
- export interface DrawingControlOptions {
+ export interface PlaceTextSearchRequestElementOptions {
/**
- * The drawing modes to display in the drawing control, in the order in
- * which they are to be displayed. The hand icon (which corresponds to the
- * null drawing mode) is always available and is not to be
- * specified in this array.
- * @defaultValue [{@link
- * google.maps.drawing.OverlayType.MARKER}, {@link
- * google.maps.drawing.OverlayType.POLYLINE}, {@link
- * google.maps.drawing.OverlayType.RECTANGLE}, {@link
- * google.maps.drawing.OverlayType.CIRCLE}, {@link
- * google.maps.drawing.OverlayType.POLYGON}]
+ * The list of preferred EV connector types. See {@link google.maps.places.SearchByTextRequest.evSearchOptions} and {@link google.maps.places.PlaceTextSearchRequestElement.evConnectorTypes} for more details.
*/
- drawingModes?: google.maps.drawing.OverlayType[] | null;
+ evConnectorTypes?: google.maps.places.EVConnectorTypeString[] | null;
/**
- * Position id. Used to specify the position of the control on the map.
- * @defaultValue {@link google.maps.ControlPosition.TOP_LEFT}
+ * Minimum required charging rate in kilowatts. See {@link google.maps.places.SearchByTextRequest.evSearchOptions} and {@link google.maps.places.PlaceTextSearchRequestElement.evMinimumChargingRateKw} for more details.
*/
- position?: google.maps.ControlPosition | null;
- }
- /**
- * 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.
- */
- export class DrawingManager extends google.maps.MVCObject {
+ evMinimumChargingRateKw?: number | null;
/**
- * 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.
+ * The requested place type. See {@link google.maps.places.SearchByTextRequest.includedType} and {@link google.maps.places.PlaceTextSearchRequestElement.includedType} for more details.
*/
- constructor(options?: google.maps.drawing.DrawingManagerOptions | null);
+ includedType?: string | null;
/**
- * Returns the DrawingManager's drawing mode.
+ * 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.
*/
- getDrawingMode(): google.maps.drawing.OverlayType | null;
+ isOpenNow?: boolean | null;
/**
- * Returns the Map to which the DrawingManager is
- * attached, which is the Map on which the overlays created
- * will be placed.
+ * Location bias for the search. See {@link google.maps.places.SearchByTextRequest.locationBias} and {@link google.maps.places.PlaceTextSearchRequestElement.locationBias} for more details.
*/
- getMap(): google.maps.Map | null;
+ locationBias?: google.maps.places.LocationBias | null;
/**
- * Changes the DrawingManager's drawing mode, which defines
- * the type of overlay to be added on the map. Accepted values are
- * 'marker', 'polygon', 'polyline',
- * 'rectangle', 'circle', or null. A
- * drawing mode of null means that the user can interact with
- * the map as normal, and clicks do not draw anything.
+ * Location restriction for the search. See {@link google.maps.places.SearchByTextRequest.locationRestriction} and {@link google.maps.places.PlaceTextSearchRequestElement.locationRestriction} for more details.
*/
- setDrawingMode(drawingMode: google.maps.drawing.OverlayType | null): void;
+ locationRestriction?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
/**
- * Attaches the DrawingManager object to the specified
- * Map.
+ * Maximum number of results to return. See {@link google.maps.places.SearchByTextRequest.maxResultCount} and {@link google.maps.places.PlaceTextSearchRequestElement.maxResultCount} for more details.
*/
- setMap(map: google.maps.Map | null): void;
+ maxResultCount?: number | null;
/**
- * Sets the DrawingManager's options.
+ * 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.
*/
- setOptions(options: google.maps.drawing.DrawingManagerOptions | null): void;
- }
- /**
- * Options for the drawing manager.
- */
- export interface DrawingManagerOptions {
+ minRating?: number | null;
/**
- * Options to apply to any new circles created with this
- * DrawingManager. The center and
- * radius properties are ignored, and the map
- * property of a new circle is always set to the
- * DrawingManager's map.
+ * 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.
*/
- circleOptions?: google.maps.CircleOptions | null;
+ priceLevels?: google.maps.places.PriceLevelString[] | null;
/**
- * The enabled/disabled state of the drawing control.
- * @defaultValue true
+ * 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.
*/
- drawingControl?: boolean | null;
+ rankPreference?: google.maps.places.SearchByTextRankPreferenceString | null;
/**
- * The display options for the drawing control.
+ * The text query for textual search. See {@link google.maps.places.SearchByTextRequest.textQuery} and {@link google.maps.places.PlaceTextSearchRequestElement.textQuery} for more details.
*/
- drawingControlOptions?: google.maps.drawing.DrawingControlOptions | null;
+ textQuery?: string | null;
/**
- * The DrawingManager's drawing mode, which defines the
- * type of overlay to be added on the map. Accepted values are
- * 'marker', 'polygon', 'polyline',
- * 'rectangle', 'circle', or null. A
- * drawing mode of null means that the user can interact with
- * the map as normal, and clicks do not draw anything.
+ * 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.
*/
- drawingMode?: google.maps.drawing.OverlayType | null;
+ useStrictTypeFiltering?: boolean | null;
+ }
+ /**
+ * 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:
+ * 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 {
/**
- * The <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> Map to which the DrawingManager is
- * attached, which is the Map on which the overlays created
- * will be placed.
+ *
+ * @param options
*/
- map?: google.maps.Map | null;
+ constructor(options?: google.maps.places.PlaceTextSearchRequestElementOptions);
/**
- * Options to apply to any new markers created with this
- * DrawingManager. The position property is
- * ignored, and the map property of a new marker is always set
- * to the DrawingManager's map.
+ * The list of preferred EV connector types.
+ * @defaultValue null
*/
- markerOptions?: google.maps.MarkerOptions | null;
+ get evConnectorTypes(): google.maps.places.EVConnectorTypeString[] | null;
/**
- * Options to apply to any new polygons created with this
- * DrawingManager. The paths property is ignored,
- * and the map property of a new polygon is always set to the
- * DrawingManager's map.
+ * The list of preferred EV connector types.
+ * @defaultValue null
*/
- polygonOptions?: google.maps.PolygonOptions | null;
+ set evConnectorTypes(value: google.maps.places.EVConnectorTypeString[] | null | undefined);
/**
- * Options to apply to any new polylines created with this
- * DrawingManager. The path property is ignored,
- * and the map property of a new polyline is always set to the
- * DrawingManager's map.
+ * Minimum required charging rate in kilowatts.
+ * @defaultValue null
*/
- polylineOptions?: google.maps.PolylineOptions | null;
+ get evMinimumChargingRateKw(): number | null;
/**
- * Options to apply to any new rectangles created with this
- * DrawingManager. The bounds property is ignored,
- * and the map property of a new rectangle is always set to the
- * DrawingManager's map.
+ * Minimum required charging rate in kilowatts.
+ * @defaultValue null
*/
- rectangleOptions?: google.maps.RectangleOptions | null;
- }
- /**
- * The properties of an overlaycomplete event on a
- * DrawingManager.
- */
- export interface OverlayCompleteEvent {
+ set evMinimumChargingRateKw(value: number | null | undefined);
/**
- * The completed overlay.
+ * The requested place type.
+ * @defaultValue null
*/
- overlay:
- | google.maps.Marker
- | google.maps.Polygon
- | google.maps.Polyline
- | google.maps.Rectangle
- | google.maps.Circle;
+ get includedType(): string | null;
/**
- * The completed overlay's type.
+ * The requested place type.
+ * @defaultValue null
*/
- type: google.maps.drawing.OverlayType;
- }
- /**
- * 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 {
+ set includedType(value: string | null | undefined);
/**
- * Specifies that the DrawingManager creates circles, and that
- * the overlay given in the overlaycomplete event is a circle.
+ * Used to restrict the search to places that are currently open.
+ * @defaultValue null
*/
- CIRCLE = 'circle',
+ get isOpenNow(): boolean | null;
+ /**
+ * Used to restrict the search to places that are currently open.
+ * @defaultValue null
+ */
+ set isOpenNow(value: boolean | null | undefined);
/**
- * Specifies that the DrawingManager creates markers, and that
- * the overlay given in the overlaycomplete event is a marker.
+ * Location bias for the search.
+ * @defaultValue null
*/
- MARKER = 'marker',
+ get locationBias(): google.maps.LatLngAltitude | google.maps.LatLngBounds | google.maps.Circle | string | null;
/**
- * Specifies that the DrawingManager creates polygons, and that
- * the overlay given in the overlaycomplete event is a polygon.
+ * Location bias for the search.
+ * @defaultValue null
*/
- POLYGON = 'polygon',
+ set locationBias(value: google.maps.places.LocationBias | null | undefined);
/**
- * Specifies that the DrawingManager creates polylines, and
- * that the overlay given in the overlaycomplete event is a
- * polyline.
+ * Location restriction for the search. Normalizes to a LatLngBounds.
+ * @defaultValue null
*/
- POLYLINE = 'polyline',
+ get locationRestriction(): google.maps.LatLngBounds | null;
/**
- * Specifies that the DrawingManager creates rectangles, and
- * that the overlay given in the overlaycomplete event is a
- * rectangle.
+ * Location restriction for the search. Normalizes to a LatLngBounds.
+ * @defaultValue null
*/
- RECTANGLE = 'rectangle',
- }
-}
-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.MVCArraytrue 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.MVCArraynull 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.MVCArraynull
*/
- expiresInSeconds: number;
+ get maxResultCount(): number | null;
/**
- * The token.
+ * Maximum number of results to return.
+ * @defaultValue null
*/
- token: string;
- }
- /**
- * Contains additional information needed to mint JSON Web Tokens.
- */
- export interface AuthTokenContext {
+ set maxResultCount(value: number | null | undefined);
/**
- * When provided, the minted token should have a private
- * DeliveryVehicleId claim for the provided deliveryVehicleId.
+ * Filter out results whose average user rating is strictly less than this limit.
+ * @defaultValue null
*/
- deliveryVehicleId?: string | null;
+ get minRating(): number | null;
/**
- * When provided, the minted token should have a private TaskId
- * claim for the provided taskId.
+ * Filter out results whose average user rating is strictly less than this limit.
+ * @defaultValue null
*/
- taskId?: string | null;
+ set minRating(value: number | null | undefined);
/**
- * When provided, the minted token should have a private
- * TrackingId claim for the provided trackingId.
+ * Used to restrict the search to places that are marked as certain price levels.
+ * @defaultValue null
*/
- trackingId?: string | null;
+ get priceLevels(): google.maps.places.PriceLevelString[] | null;
/**
- * When provided, the minted token should have a private TripId
- * claim for the provided tripId.
+ * Used to restrict the search to places that are marked as certain price levels.
+ * @defaultValue null
*/
- tripId?: string | null;
+ set priceLevels(value: google.maps.places.PriceLevelString[] | null | undefined);
/**
- * When provided, the minted token should have a private
- * VehicleId claim for the provided vehicleId.
+ * How results will be ranked in the response.
+ * @defaultValue null
*/
- vehicleId?: string | null;
- }
- export type AuthTokenFetcher = (
- a: google.maps.journeySharing.AuthTokenFetcherOptions,
- ) => Promisenull
+ */
+ set rankPreference(value: google.maps.places.SearchByTextRankPreferenceString | null | undefined);
/**
- * The auth token context. IDs specified in the context should be added to
- * the request sent to the JSON Web Token minting endpoint.
+ * The text query for textual search.
+ * @defaultValue null
*/
- context: google.maps.journeySharing.AuthTokenContext;
+ get textQuery(): string | null;
/**
- * The Fleet Engine service type.
+ * The text query for textual search.
+ * @defaultValue null
*/
- serviceType: google.maps.journeySharing.FleetEngineServiceType;
- }
- /**
- * 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 {
+ set textQuery(value: string | null | undefined);
/**
- * Automatically adjust the viewport to fit markers and any visible
- * anticipated route polylines. This is the default.
+ * Used to set strict type filtering for 'includedType'.
+ * @defaultValue null
*/
- FIT_ANTICIPATED_ROUTE = 'FIT_ANTICIPATED_ROUTE',
+ get useStrictTypeFiltering(): boolean | null;
/**
- * Do not automatically adjust the viewport.
+ * Used to set strict type filtering for 'includedType'.
+ * @defaultValue null
*/
- NONE = 'NONE',
+ set useStrictTypeFiltering(value: boolean | null | undefined);
+ addEventListenerMarkerCustomizationFunction methods for your location
- * provider instead.
+ * 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 interface DefaultMarkerSetupOptions {
+ export class PlaceSelectEvent extends Event {
/**
- * Default marker options.
+ * The selected place.
*/
- defaultMarkerOptions: google.maps.MarkerOptions;
+ get place(): google.maps.places.Place;
}
/**
- * PolylineSetup default options.
- * @deprecated Polyline setup is deprecated. Use the
- * PolylineCustomizationFunction methods for your location
- * provider instead.
+ * 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 interface DefaultPolylineSetupOptions {
+ export class PlaceSearchElement extends HTMLElement implements google.maps.places.PlaceSearchElementOptions {
/**
- * Default polyline options.
+ *
+ * @param options
*/
- defaultPolylineOptions: google.maps.PolylineOptions;
+ constructor(options?: google.maps.places.PlaceSearchElementOptions);
/**
- * Default polyline visibility.
+ * The position of the attribution logo and legal disclosure button.
+ * @defaultValue PlaceSearchAttributionPosition.TOP
*/
- defaultVisible: boolean;
- }
- /**
- * The details for a delivery vehicle returned by Fleet Engine.
- */
- export interface DeliveryVehicle {
+ get attributionPosition(): google.maps.places.PlaceSearchAttributionPositionString;
/**
- * Custom delivery vehicle attributes.
+ * The position of the attribution logo and legal disclosure button.
+ * @defaultValue PlaceSearchAttributionPosition.TOP
*/
- attributes: {[key: string]: string | null};
+ set attributionPosition(value: google.maps.places.PlaceSearchAttributionPositionString | null | undefined);
/**
- * The location where the current route segment ends.
+ * The orientation variant (vertical or horizontal) of the element.
+ * @defaultValue PlaceSearchOrientation.VERTICAL
*/
- currentRouteSegmentEndPoint: google.maps.LatLngLiteral | null;
+ get orientation(): google.maps.places.PlaceSearchOrientationString;
/**
- * The last reported location of the delivery vehicle.
+ * The orientation variant (vertical or horizontal) of the element.
+ * @defaultValue PlaceSearchOrientation.VERTICAL
*/
- latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null;
+ set orientation(value: google.maps.places.PlaceSearchOrientationString | null | undefined);
/**
- * In the format
- * "providers/{provider_id}/deliveryVehicles/{delivery_vehicle_id}".
- * The delivery_vehicle_id must be a unique identifier.
+ * Read only. Array of Place objects containing the IDs, locations, and viewports of the currently rendered places.
*/
- name: string;
+ get places(): google.maps.places.Place[];
/**
- * The current navigation status of the vehicle.
+ * 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
*/
- navigationStatus: string;
+ get selectable(): boolean;
/**
- * The remaining driving distance in the current route segment, in meters.
+ * 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
*/
- remainingDistanceMeters: number;
+ set selectable(value: boolean | null | undefined);
/**
- * The remaining driving duration in the current route segment, in
- * milliseconds.
+ * If true, truncates certain lines of content to fit on one line instead of wrapping.
+ * @defaultValue false
*/
- remainingDurationMillis: number | null;
+ get truncationPreferred(): boolean;
/**
- * 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}.
+ * If true, truncates certain lines of content to fit on one line instead of wrapping.
+ * @defaultValue false
*/
- remainingVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[];
+ set truncationPreferred(value: boolean | null | undefined);
+ addEventListener
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.
*/
- deliveryVehicle: google.maps.journeySharing.DeliveryVehicle;
- }
- /**
- * DeliveryVehicleStop type
- */
- export interface DeliveryVehicleStop {
+ includedPrimaryTypes?: string[];
/**
- * The location of the stop.
+ * 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.
*/
- plannedLocation: google.maps.LatLngLiteral | null;
+ includedRegionCodes?: string[];
/**
- * The state of the stop.
+ * The text string on which to search.
*/
- state: google.maps.journeySharing.DeliveryVehicleStopState | null;
+ input: string;
/**
- * The list of Tasks to be performed at this stop.
+ * A zero-based Unicode character offset of id:
- * the ID of the task. extraDurationMillis: the extra time
- * it takes to perform the task, in milliseconds. 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.
*/
- tasks: google.maps.journeySharing.TaskInfo[];
- }
- /**
- * 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.
- */
- export enum DeliveryVehicleStopState {
+ inputOffset?: number;
/**
- * Arrived at stop. Assumes that when the vehicle is routing to the next
- * stop, that all previous stops have been completed.
+ * 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.
*/
- ARRIVED = 'ARRIVED',
+ language?: string;
/**
- * Assigned and actively routing.
+ * 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.
*/
- ENROUTE = 'ENROUTE',
+ locationBias?: google.maps.places.LocationBias;
/**
- * Created, but not actively routing.
+ * 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.
*/
- NEW = 'NEW',
+ locationRestriction?: google.maps.places.LocationRestriction;
/**
- * Unknown.
+ * 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.
*/
- UNSPECIFIED = 'UNSPECIFIED',
- }
- /**
- * Delivery Fleet Location Provider.
- *
- * Access by calling `const {FleetEngineDeliveryFleetLocationProvider} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class FleetEngineDeliveryFleetLocationProvider extends google.maps
- .journeySharing.PollingLocationProvider {
- /**
- * Delivery Fleet Location Provider.
- *
- * Access by calling `const {FleetEngineDeliveryFleetLocationProvider} =
- * await google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param options Options to pass to the location provider.
+ origin?: google.maps.LatLng | google.maps.LatLngLiteral;
+ /**
+ * 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.
*/
- constructor(
- options: google.maps.journeySharing.FleetEngineDeliveryFleetLocationProviderOptions,
- );
+ region?: string;
/**
- * The filter applied when fetching the delivery vehicles.
+ * 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:
*/
- deliveryVehicleFilter?: string | null;
+ sessionToken?: google.maps.places.AutocompleteSessionToken;
+ }
+ /**
+ * 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 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.
+ * 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}.
*/
- locationRestriction?:
- | google.maps.LatLngBounds
- | null
- | google.maps.LatLngBoundsLiteral;
+ get placePrediction(): google.maps.places.PlacePrediction | null;
/**
- * 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.
+ * 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.
*/
- staleLocationThresholdMillis: number;
+ static fetchAutocompleteSuggestions(autocompleteRequest: google.maps.places.AutocompleteRequest): Promise<{suggestions: google.maps.places.AutocompleteSuggestion[]}>;
}
/**
- * Options for delivery fleet location provider.
+ * 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 interface FleetEngineDeliveryFleetLocationProviderOptions {
+ export class PlacePrediction {
/**
- * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ * The length of the geodesic in meters from origin if origin is specified.
*/
- authTokenFetcher(
- this: any,
- a: google.maps.journeySharing.AuthTokenFetcherOptions,
- ): Promise
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".
+ * Represents the name of the Place.
*/
- deliveryVehicleFilter: string | null;
+ get mainText(): google.maps.places.FormattableText | null;
/**
- * Customization applied to a delivery vehicle marker.
Use this
- * field to specify custom styling (such as marker icon) and interactivity
- * (such as click handling).
- */
- deliveryVehicleMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams,
- ) => void)
- | null;
- /**
- * 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.
- */
- locationRestriction:
- | google.maps.LatLngBounds
- | null
- | google.maps.LatLngBoundsLiteral;
- /**
- * The consumer's project ID from Google Cloud Console.
+ * The unique identifier of the suggested Place. This identifier can be used in other APIs that accept Place IDs.
*/
- projectId: string;
+ get placeId(): string;
/**
- * 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.
+ * Represents additional disambiguating features (such as a city or region) to further identify the Place.
*/
- staleLocationThresholdMillis: number | null;
- }
- /**
- * The event object passed to the event handler when the {@link
- * google.maps.journeySharing.FleetEngineDeliveryFleetLocationProvider.update}
- * event is triggered.
- */
- export interface FleetEngineDeliveryFleetLocationProviderUpdateEvent {
+ get secondaryText(): google.maps.places.FormattableText | null;
/**
- * The list of delivery vehicles returned by the query. Unmodifiable.
- */
- 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 {
- /**
- * Delivery Vehicle Location Provider.
- *
- * Access by calling `const {FleetEngineDeliveryVehicleLocationProvider} =
- * await google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param options Options to pass to the location provider.
+ * Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address. 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.
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.
*/
- constructor(
- options: google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions,
- );
+ get text(): google.maps.places.FormattableText;
/**
- * ID for the vehicle that this location provider observes. Set this field
- * to track a vehicle.
+ * 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.
*/
- deliveryVehicleId: string;
+ get types(): string[];
/**
- * Optionally allow users to display the task's outcome location.
+ * 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.
*/
- shouldShowOutcomeLocations: boolean | null;
+ fetchAddressValidation(request: google.maps.addressValidation.AddressValidationRequest): Promise
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.
*/
- shouldShowTasks: boolean | null;
+ 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 {
/**
- * 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.
+ * Zero-based offset of the last Unicode character of the substring (exclusive).
*/
- staleLocationThresholdMillis: number;
+ get endOffset(): number;
/**
- * Returns the filter options to apply when fetching tasks.
+ * Zero-based offset of the first Unicode character of the substring (inclusive).
*/
- taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions;
+ get startOffset(): number;
}
/**
- * Options for delivery vehicle location provider.
+ * 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 interface FleetEngineDeliveryVehicleLocationProviderOptions {
+ export class FormattableText {
/**
- * 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).
- */
- activePolylineCustomization?:
- | ((
- a: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
+ * 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 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.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.
+ */
+ get matches(): google.maps.places.StringRange[];
/**
- * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ * Text that may be used as is or formatted with {@link google.maps.places.FormattableText.matches}.
*/
- authTokenFetcher(
- this: any,
- a: google.maps.journeySharing.AuthTokenFetcherOptions,
- ): PromiseHTMLElement 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 {
/**
- * 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.
+ *
+ * @param options
*/
- deliveryVehicleId: string | null;
+ constructor(options: google.maps.places.BasicPlaceAutocompleteElementOptions);
/**
- * Customization applied to the delivery vehicle marker.
Use this
- * field to specify custom styling (such as marker icon) and interactivity
- * (such as click handling).
- */
- deliveryVehicleMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.DeliveryVehicleMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Customization applied to a planned stop marker. 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.
Use this field to
- * specify custom styling (such as marker icon) and interactivity (such as
- * click handling).
- */
- plannedStopMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.PlannedStopMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Minimum time between fetching location updates in milliseconds. If it
- * takes longer than 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.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.
+ * 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.
*/
- pollingIntervalMillis: number | null;
+ includedPrimaryTypes: string[] | null;
/**
- * The consumer's project ID from Google Cloud Console.
+ * 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.
*/
- projectId: string;
+ includedRegionCodes: string[] | 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).
- */
- remainingPolylineCustomization?:
- | ((
- a: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
+ * A soft boundary or hint to use when searching for places.
+ */
+ locationBias: google.maps.places.LocationBias | null;
/**
- * Boolean to show or hide outcome locations for the fetched tasks.
+ * Bounds to constrain search results.
*/
- shouldShowOutcomeLocations: boolean | null;
+ locationRestriction: google.maps.places.LocationRestriction | 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.
+ * 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.
*/
- shouldShowTasks: boolean | null;
+ name: string | null;
/**
- * 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.
+ * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation.
*/
- staleLocationThresholdMillis: number | null;
+ get origin(): google.maps.LatLngAltitude | null;
/**
- * Customization applied to the taken polyline. A taken polyline corresponds
- * to a portion of the route the vehicle has already traversed through.
- * 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.
Use this field to specify custom styling (such as polyline color)
- * and interactivity (such as click handling).
- */
- takenPolylineCustomization?:
- | ((
- a: google.maps.journeySharing.DeliveryVehiclePolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
- /**
- * Filter options to apply when fetching tasks. The options can include
- * specific vehicle, time, and task status.
+ * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation.
*/
- taskFilterOptions: google.maps.journeySharing.FleetEngineTaskFilterOptions | null;
+ set origin(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined);
/**
- * Customization applied to a task marker. A task marker is rendered at the
- * planned location of each task assigned to the delivery vehicle.
- * 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.
Use this field to specify custom styling (such as marker icon)
- * and interactivity (such as click handling).
- */
- taskMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.TaskMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * 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. 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.
Use this field to specify custom styling (such
- * as marker icon) and interactivity (such as click handling).
- */
- taskOutcomeMarkerCustomization?:
- | ((
- a: 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 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.
+ */
+ requestedLanguage: string | null;
/**
- * The journey segments that have been completed by this vehicle.
- * Unmodifiable.
+ * 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" (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..co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland").
*/
- completedVehicleJourneySegments:
- | google.maps.journeySharing.VehicleJourneySegment[]
- | null;
+ requestedRegion: string | null;
/**
- * The delivery vehicle data structure returned by the update. Unmodifiable.
+ * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion.
*/
- deliveryVehicle: google.maps.journeySharing.DeliveryVehicle | null;
+ get unitSystem(): google.maps.UnitSystem | null;
/**
- * The list of tasks served by this delivery vehicle. Unmodifiable.
+ * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion.
*/
- tasks: google.maps.journeySharing.Task[] | null;
+ set unitSystem(value: google.maps.UnitSystem | null | undefined);
+ addEventListenerfalse
*/
- vehicleFilter?: string | null;
+ mapHidden?: boolean | null;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Options for fleet location provider.
+ * 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 interface FleetEngineFleetLocationProviderOptions {
+ export class PlaceContextualListConfigElement extends HTMLElement implements google.maps.places.PlaceContextualListConfigElementOptions {
/**
- * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ *
+ * @param options
*/
- authTokenFetcher(
- this: any,
- a: google.maps.journeySharing.AuthTokenFetcherOptions,
- ): Promise
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".
+ * Whether the map is hidden.
*/
- vehicleFilter: string | null;
- /**
- * Customization applied to a vehicle marker.
Use this field to
- * specify custom styling (such as marker icon) and interactivity (such as
- * click handling).
- */
- vehicleMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams,
- ) => void)
- | null;
+ set mapHidden(value: boolean | null | undefined);
+ addEventListenerisNew 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.PlaceContextualElement.
*/
- export interface FleetEngineFleetLocationProviderUpdateEvent {
+ export interface PlaceContextualElementOptions {
/**
- * The list of vehicles returned by the query. Unmodifiable.
+ * The context token provided by the Grounding with Google Maps response.
*/
- vehicles: google.maps.journeySharing.Vehicle[] | null;
+ contextToken?: string | null;
}
/**
- * Types of Fleet Engine services.
- *
- * Access by calling `const {FleetEngineServiceType} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 enum FleetEngineServiceType {
+ export class PlaceContextualElement extends HTMLElement implements google.maps.places.PlaceContextualElementOptions {
/**
- * Fleet Engine service used to access delivery vehicles.
+ *
+ * @param options
*/
- DELIVERY_VEHICLE_SERVICE = 'DELIVERY_VEHICLE_SERVICE',
+ constructor(options?: google.maps.places.PlaceContextualElementOptions);
/**
- * Fleet Engine service used to access task information.
+ * The context token.
*/
- TASK_SERVICE = 'TASK_SERVICE',
+ get contextToken(): string | undefined;
/**
- * Fleet Engine service used to access trip information.
+ * The context token.
*/
- TRIP_SERVICE = 'TRIP_SERVICE',
+ set contextToken(value: string | null | undefined);
+ addEventListenerevent.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 {
/**
- * Unknown Fleet Engine service.
+ * Convert this to a {@link google.maps.places.Place} by calling {@link google.maps.places.PlacePrediction.toPlace}.
*/
- UNKNOWN_SERVICE = 'UNKNOWN_SERVICE',
+ get placePrediction(): google.maps.places.PlacePrediction;
}
/**
- * Shipment location provider.
- *
- * Access by calling `const {FleetEngineShipmentLocationProvider} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class FleetEngineShipmentLocationProvider extends google.maps
- .journeySharing.PollingLocationProvider {
- /**
- * Shipment location provider.
- *
- * Access by calling `const {FleetEngineShipmentLocationProvider} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param options Options for the location provider.
+ * 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 PlaceAutocompleteElement extends HTMLElement implements google.maps.places.PlaceAutocompleteElementOptions {
+ /**
+ *
+ * @param options
+ */
+ constructor(options: google.maps.places.PlaceAutocompleteElementOptions);
+ /**
+ * 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;
+ /**
+ * A soft boundary or hint to use when searching for places.
+ */
+ locationBias: google.maps.places.LocationBias | null;
+ /**
+ * Bounds to constrain search results.
+ */
+ locationRestriction: google.maps.places.LocationRestriction | 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.
+ */
+ name: string | null;
+ /**
+ * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation.
*/
- constructor(
- options: google.maps.journeySharing.FleetEngineShipmentLocationProviderOptions,
- );
+ get origin(): google.maps.LatLngAltitude | null;
/**
- * Explicitly refreshes the tracked location.
+ * The origin from which to calculate distance. If not specified, distance is not calculated. The altitude, if given, is not used in the calculation.
*/
- refresh(): void;
+ set origin(value: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined);
/**
- * The tracking ID for the task that this location provider observes. Set
- * this field to begin tracking.
+ * The placeholder text to display in the input element.
*/
- trackingId: string;
- }
- /**
- * Options for shipment location provider.
- */
- export interface FleetEngineShipmentLocationProviderOptions {
+ get placeholder(): 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).
- */
- activePolylineCustomization?:
- | ((
- a: google.maps.journeySharing.ShipmentPolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
+ * The placeholder text to display in the input element.
+ */
+ set placeholder(value: string | null);
/**
- * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ * 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.
*/
- authTokenFetcher(
- this: any,
- a: google.maps.journeySharing.AuthTokenFetcherOptions,
- ): PromiseisNew 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.
Use this
- * field to specify custom styling (such as marker icon) and interactivity
- * (such as click handling).
- */
- deliveryVehicleMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Customization applied to the destination marker. 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.
Use this field
- * to specify custom styling (such as marker icon) and interactivity (such
- * as click handling).
- */
- destinationMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.ShipmentMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Minimum time between fetching location updates in milliseconds. If it
- * takes longer than 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.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.
+ requestedLanguage: 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").
*/
- pollingIntervalMillis: number | null;
+ requestedRegion: string | null;
/**
- * The consumer's project ID from Google Cloud Console.
+ * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion.
*/
- projectId: string;
+ get unitSystem(): google.maps.UnitSystem | 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).
- */
- remainingPolylineCustomization?:
- | ((
- a: 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.
- * 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.
Use this field to specify custom styling (such as polyline color)
- * and interactivity (such as click handling).
- */
- takenPolylineCustomization?:
- | ((
- a: 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.
+ * The unit system used to display distances. If not specified, the unit system is determined by requestedRegion.
*/
- trackingId: string | null;
+ set unitSystem(value: google.maps.UnitSystem | null | undefined);
+ /**
+ * The value of the input element.
+ */
+ get value(): string;
+ /**
+ * The value of the input element.
+ */
+ set value(value: string | null);
+ addEventListenerisNew 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.
Use this field to specify custom styling (such as
- * polyline color) and interactivity (such as click handling).
- */
- activePolylineCustomization?:
- | ((
- a: google.maps.journeySharing.TripPolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
+ export enum ConfirmationLevel {
+
+ CONFIRMED = 'CONFIRMED',
+
+ UNCONFIRMED_AND_SUSPICIOUS = 'UNCONFIRMED_AND_SUSPICIOUS',
+
+ UNCONFIRMED_BUT_PLAUSIBLE = 'UNCONFIRMED_BUT_PLAUSIBLE',
+ }
+ export type ConfirmationLevelString = `${google.maps.addressValidation.ConfirmationLevel}`;
+ /**
+ * 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 {
/**
- * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
+ * 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.
*/
- authTokenFetcher(
- this: any,
- a: google.maps.journeySharing.AuthTokenFetcherOptions,
- ): PromiseisNew 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.
Use this field
- * to specify custom styling (such as marker icon) and interactivity (such
- * as click handling).
- */
- destinationMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.TripMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Customization applied to the origin marker. 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.
Use this field to
- * specify custom styling (such as marker icon) and interactivity (such as
- * click handling).
- */
- originMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.TripMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Minimum time between fetching location updates in milliseconds. If it
- * takes longer than 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.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.
+ get components(): google.maps.addressValidation.AddressComponent[];
+ /**
+ * The post-processed address, formatted as a single-line address following the address-formatting rules of the region where the address is located.
*/
- pollingIntervalMillis: number | null;
+ get formattedAddress(): string | null;
/**
- * The consumer's project ID from Google Cloud Console.
+ * 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.
*/
- projectId: string;
+ get missingComponentTypes(): 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).
- */
- remainingPolylineCustomization?:
- | ((
- a: google.maps.journeySharing.TripPolylineCustomizationFunctionParams,
- ) => 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.
- * 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.
Use this field to specify custom styling (such as polyline color)
- * and interactivity (such as click handling).
- */
- takenPolylineCustomization?:
- | ((
- a: google.maps.journeySharing.TripPolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | 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.
+ * The post-processed address represented as a postal address.
*/
- tripId: string | null;
+ get postalAddress(): google.maps.places.PostalAddress | null;
/**
- * Customization applied to the vehicle marker. 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.
Use this field to
- * specify custom styling (such as marker icon) and interactivity (such as
- * click handling).
- */
- vehicleMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.TripMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Customization applied to a waypoint marker. 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.
Use this field to
- * specify custom styling (such as marker icon) and interactivity (such as
- * click handling).
- */
- waypointMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.TripWaypointMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- }
- /**
- * The event object passed to the event handler when the {@link
- * google.maps.journeySharing.FleetEngineTripLocationProvider.update} event is
- * triggered.
- */
- export interface FleetEngineTripLocationProviderUpdateEvent {
+ * The types of the components that are present in 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.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.
+ */
+ get unconfirmedComponentTypes(): string[];
/**
- * The trip structure returned by the update. Unmodifiable.
+ * 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.
*/
- trip: google.maps.journeySharing.Trip | null;
+ get unresolvedTokens(): string[];
+ toJSON(key?: string): unknown;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Vehicle Location Provider.
- *
- * Access by calling `const {FleetEngineVehicleLocationProvider} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * Request interface for {@link google.maps.addressValidation.AddressValidation.fetchAddressValidation}.
*/
- export class FleetEngineVehicleLocationProvider extends google.maps
- .journeySharing.PollingLocationProvider {
+ export interface AddressValidationRequest {
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Vehicle Location Provider.
- *
- * Access by calling `const {FleetEngineVehicleLocationProvider} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param options Options to pass to the location provider.
+ * The address being validated. Unformatted addresses should be submitted via {@link google.maps.places.PostalAddress.addressLines}.
*/
- constructor(
- options: google.maps.journeySharing.FleetEngineVehicleLocationProviderOptions,
- );
+ address: google.maps.places.PostalAddressLiteral;
/**
- * 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.
+ * If using a PlaceAutocompleteElement, include it here to link the AddressValidation API calls with the autocomplete session token.
*/
- staleLocationThresholdMillis: number;
+ placeAutocompleteElement?: google.maps.places.PlaceAutocompleteElement;
/**
- * ID for the vehicle that this location provider observes. Set this field
- * to track a vehicle.
+ * 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.
*/
- vehicleId: string;
+ previousResponseId?: 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.
- * @param params The parameters provided to the polyline customization
- * function.
+ * A token which identifies an Autocomplete session for billing purposes.
*/
- static TRAFFIC_AWARE_ACTIVE_POLYLINE_CUSTOMIZATION_FUNCTION(
- this: any,
- params: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams,
- ): void;
+ sessionToken?: google.maps.places.AutocompleteSessionToken;
/**
- * 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.
- * @param params The parameters provided to the polyline customization
- * function.
+ * 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".
*/
- static TRAFFIC_AWARE_REMAINING_POLYLINE_CUSTOMIZATION_FUNCTION(
- this: any,
- params: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams,
- ): void;
+ uspsCASSEnabled?: boolean;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Options for vehicle location provider.
+ * 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 interface FleetEngineVehicleLocationProviderOptions {
- /**
- * 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).
- */
- activePolylineCustomization?:
- | ((
- a: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
+ export class Geocode {
/**
- * Provides JSON Web Tokens for authenticating the client to Fleet Engine.
- */
- authTokenFetcher(
- this: any,
- a: google.maps.journeySharing.AuthTokenFetcherOptions,
- ): PromiseisNew 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.
Use
- * this field to specify custom styling (such as marker icon) and
- * interactivity (such as click handling).
- */
- destinationMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Customization applied to the vehicle trip intermediate destination
- * markers. 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.
Use this field to specify custom styling (such as marker
- * icon) and interactivity (such as click handling).
- */
- intermediateDestinationMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Customization applied to the vehicle trip origin marker. 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.
Use this
- * field to specify custom styling (such as marker icon) and interactivity
- * (such as click handling).
- */
- originMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.VehicleWaypointMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- /**
- * Minimum time between fetching location updates in milliseconds. If it
- * takes longer than 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.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.
+ * The bounds of the geocoded place.
*/
- pollingIntervalMillis: number | null;
+ get bounds(): google.maps.LatLngBounds | null;
/**
- * The consumer's project ID from Google Cloud Console.
+ * 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.
*/
- projectId: string;
+ get featureSizeMeters(): number | 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).
- */
- remainingPolylineCustomization?:
- | ((
- a: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
- /**
- * 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.
+ * The geocoded location of the input.
*/
- staleLocationThresholdMillis: number | null;
+ get location(): google.maps.LatLngAltitude | null;
/**
- * Customization applied to the taken polyline. A taken polyline corresponds
- * to a portion of the route the vehicle has already traversed through.
- * 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.
Use this field to specify custom styling (such as polyline color)
- * and interactivity (such as click handling).
- */
- takenPolylineCustomization?:
- | ((
- a: google.maps.journeySharing.VehiclePolylineCustomizationFunctionParams,
- ) => void)
- | google.maps.PolylineOptions
- | null;
- /**
- * 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.
+ * 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.
*/
- vehicleId: string | null;
+ get placeId(): string | null;
/**
- * Customization applied to the vehicle marker. 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.
Use this field to
- * specify custom styling (such as marker icon) and interactivity (such as
- * click handling).
- */
- vehicleMarkerCustomization?:
- | ((
- a: google.maps.journeySharing.VehicleMarkerCustomizationFunctionParams,
- ) => void)
- | google.maps.MarkerOptions
- | null;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * The event object passed to the event handler when the {@link
- * google.maps.journeySharing.FleetEngineVehicleLocationProvider.update} event
- * is triggered.
- */
- export interface FleetEngineVehicleLocationProviderUpdateEvent {
+ * The type(s) of place that the input geocoded to. For example, 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.['locality', 'political']. The full list of types can be found in the Geocoding API documentation.
+ */
+ get placeTypes(): string[];
/**
- * The list of trips completed by this vehicle. Unmodifiable.
+ * The plus code corresponding to the location.
*/
- trips: google.maps.journeySharing.Trip[] | null;
+ get plusCode(): google.maps.places.PlusCode | null;
/**
- * The vehicle data structure returned by the update. Unmodifiable.
+ * Returns a Place representation of this Geocode. To get full place details, a call to place.fetchFields() should be made.
*/
- vehicle: google.maps.journeySharing.Vehicle | null;
+ fetchPlace(): void;
+ toJSON(key?: string): unknown;
}
/**
- * The map view.
- *
- * Access by calling `const {JourneySharingMapView} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 class JourneySharingMapView {
+ export class USPSAddress {
/**
- * The map view.
- *
- * Access by calling `const {JourneySharingMapView} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @param options Options for the map view.
+ * The city name.
*/
- constructor(
- options: google.maps.journeySharing.JourneySharingMapViewOptions,
- );
- /**
- * Adds a location provider to the map view. If the location provider is
- * already added, no action is performed.
- * @param locationProvider the location provider to add.
- */
- addLocationProvider(
- locationProvider: google.maps.journeySharing.LocationProvider,
- ): void;
- /**
- * 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.PolylineSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultPolylineSetupOptions,
- ) => google.maps.journeySharing.PolylineSetupOptions);
+ get city(): string | null;
/**
- * 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.
+ * The address line containing the city, state, and zip code.
*/
- anticipatedRoutePolylines: google.maps.Polyline[];
+ get cityStateZipAddressLine(): string | null;
/**
- * This Field is read-only. Automatic viewport mode.
+ * The name of the firm.
*/
- automaticViewportMode: google.maps.journeySharing.AutomaticViewportMode;
- /**
- * 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
+ get firm(): string | null;
/**
- * 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.
+ * The first line of the address.
*/
- destinationMarkers: google.maps.Marker[];
+ get firstAddressLine(): string | null;
/**
- * This Field is read-only. The DOM element backing the view.
+ * The second line of the address.
*/
- element: Element;
+ get secondAddressLine(): string | null;
/**
- * Enables or disables the traffic layer.
+ * The 2-letter state code.
*/
- enableTraffic: boolean;
+ get state(): string | null;
/**
- * 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.
+ * The Puerto Rican urbanization name.
*/
- locationProvider: google.maps.journeySharing.LocationProvider | null;
+ get urbanization(): string | null;
/**
- * 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.
+ * The Postal code, e.g. "10009".
*/
- locationProviders: google.maps.journeySharing.LocationProvider[] | null;
+ get zipCode(): string | null;
/**
- * This Field is read-only. The map object contained in the map view.
+ * The 4-digit postal code extension, e.g. "5023".
*/
- map: google.maps.Map;
+ get zipCodeExtension(): string | 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 {
/**
- * This Field is read-only. The map options passed into the map via the map
- * view.
+ * Abbreviated city.
*/
- mapOptions: google.maps.MapOptions;
- /**
- * 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
+ get abbreviatedCity(): string | null;
/**
- * 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.
+ * Type of the address record that matches the input address.
*/
- originMarkers: google.maps.Marker[];
+ get addressRecordType(): string | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
- /**
- * Removes a location provider from the map view. If the location provider
- * is not already added to the map view, no action is performed.
- * @param locationProvider the location provider to remove.
- */
- removeLocationProvider(
- locationProvider: google.maps.journeySharing.LocationProvider,
- ): void;
- /**
- * 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
- /**
- * 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.
+ * The carrier route code. A four character code consisting of a one letter prefix and a three digit route designator.
*/
- successfulTaskMarkers: google.maps.Marker[];
- /**
- * 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.PolylineSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultPolylineSetupOptions,
- ) => google.maps.journeySharing.PolylineSetupOptions);
+ get carrierRoute(): string | null;
/**
- * 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.
+ * Carrier route rate sort indicator.
*/
- takenRoutePolylines: google.maps.Polyline[];
+ get carrierRouteIndicator(): string | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
- /**
- * 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.
+ * Indicator that the request has been CASS processed.
*/
- taskOutcomeMarkers: google.maps.Marker[];
- /**
- * 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
+ get cassProcessed(): boolean;
/**
- * 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.
+ * County name.
*/
- unsuccessfulTaskMarkers: google.maps.Marker[];
+ get county(): string | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
- /**
- * 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.
+ * 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.
*/
- vehicleMarkers: google.maps.Marker[];
+ get deliveryPointCheckDigit(): string | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions);
+ * The 2-digit delivery point code.
+ */
+ get deliveryPointCode(): string | null;
/**
- * 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.
+ * Indicates if the address is a CMRA (Commercial Mail Receiving Agency)--a private business receiving mail for clients. Returns a single character.
*/
- waypointMarkers: google.maps.Marker[];
- }
- /**
- * Options for the map view.
- */
- export interface JourneySharingMapViewOptions {
+ get dpvCMRA(): string | 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.PolylineSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultPolylineSetupOptions,
- ) => google.maps.journeySharing.PolylineSetupOptions)
- | null;
- /**
- * 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.AutomaticViewportMode | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | null;
+ * The possible values for DPV confirmation. Returns a single character or returns no value.
+ */
+ get dpvConfirmation(): string | null;
/**
- * The DOM element backing the view. Required.
+ * Flag indicates addresses where USPS cannot knock on a door to deliver mail. Returns a single character.
*/
- element: Element;
+ get dpvDoorNotAccessible(): string | null;
/**
- * A source of tracked locations to be shown in the tracking map view.
- * Optional.
- * @deprecated Use {@link
- * google.maps.journeySharing.JourneySharingMapViewOptions.locationProviders}
- * instead.
+ * Flag indicates mail is delivered to a single receptable at a site. Returns a single character.
*/
- locationProvider: google.maps.journeySharing.LocationProvider | null;
+ get dpvDrop(): string | null;
/**
- * Sources of tracked locations to be shown in the tracking map view.
- * Optional.
+ * Indicates that more than one DPV return code is valid for the address. Returns a single character.
*/
- locationProviders: google.maps.journeySharing.LocationProvider[] | null;
+ get dpvEnhancedDeliveryCode(): string | null;
/**
- * Map options passed into the google.maps.Map constructor.
+ * The footnotes from delivery point validation. Multiple footnotes may be strung together in the same string.
*/
- mapOptions?: google.maps.MapOptions | null;
+ get dpvFootnote(): string | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | 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.PolylineSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultPolylineSetupOptions,
- ) => google.maps.journeySharing.PolylineSetupOptions)
- | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | 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.MarkerSetupOptions
- | ((
- a: google.maps.journeySharing.DefaultMarkerSetupOptions,
- ) => google.maps.journeySharing.MarkerSetupOptions)
- | null;
- }
- /**
- * Parent class of all location providers.
- */
- export abstract class LocationProvider {
+ * Flag indicates mail delivery is not performed every day of the week. Returns a single character.
+ */
+ get dpvNonDeliveryDays(): string | null;
/**
- * 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}.
- * @param eventName The name of the event to listen for.
- * @param handler The event handler.
+ * 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
*/
- addListener(
- eventName: string,
- handler: Function,
- ): google.maps.MapsEventListener;
- }
- /**
- * 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 interface MarkerCustomizationFunctionParams {
+ get dpvNonDeliveryDaysValues(): number | null;
/**
- * The default options used to create this marker.
+ * Flag indicates door is accessible, but package will not be left due to security concerns. Returns a single character.
*/
- defaultOptions: google.maps.MarkerOptions;
+ get dpvNoSecureLocation(): string | null;
/**
- * 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.
+ * 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.
*/
- isNew: boolean;
+ get dpvNoStat(): string | null;
/**
- * The marker. Any customizations should be made to this object directly.
+ * Indicates the NoStat type. Returns a reason code as int.
*/
- 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
- | ((
- a: 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 {
+ get dpvNoStatReasonCode(): number | null;
/**
- * Marker options.
+ * Indicates the address was matched to PBSA record. Returns a single character.
*/
- markerOptions?: google.maps.MarkerOptions | null;
- }
- /**
- * Parameters specific to marker customization functions that apply options to
- * markers representing planned stops. Used by {@link
- * google.maps.journeySharing.FleetEngineDeliveryVehicleLocationProviderOptions.plannedStopMarkerCustomization}.
- */
- export interface PlannedStopMarkerCustomizationFunctionParams
- extends google.maps.journeySharing
- .DeliveryVehicleMarkerCustomizationFunctionParams {
+ get dpvPBSA(): string | null;
/**
- * The 0-based index of this stop in the list of remaining stops.
+ * Indicates that mail is not delivered to the street address. Returns a single character.
*/
- stopIndex: number;
- }
- /**
- * Parent class of polling location providers.
- */
- export abstract class PollingLocationProvider extends google.maps
- .journeySharing.LocationProvider {
+ get dpvThrowback(): string | null;
/**
- * True if this location provider is polling. Read only.
+ * Indicates whether the address is vacant. Returns a single character.
*/
- isPolling: boolean;
+ get dpvVacant(): 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, 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.
+ * eLOT Ascending/Descending Flag (A/D).
*/
- pollingIntervalMillis: number;
- }
- /**
- * The event object passed to the event handler when the {@link
- * google.maps.journeySharing.PollingLocationProvider.ispollingchange} event
- * is triggered.
- */
- export interface PollingLocationProviderIsPollingChangeEvent {
+ get elotFlag(): string | null;
/**
- * 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.
+ * Enhanced Line of Travel (eLOT) number.
*/
- 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 {
+ get elotNumber(): string | null;
/**
- * The default options used to create this set of polylines.
+ * Error message for USPS data retrieval. This is populated when USPS processing is suspended because of the detection of artificially created addresses.
*/
- defaultOptions: google.maps.PolylineOptions;
+ get errorMessage(): string | null;
/**
- * If true, the list of polylines was newly created, and the polyline
- * customization function is being called for the first time. False
- * otherwise.
+ * FIPS county code.
*/
- isNew: boolean;
+ get fipsCountyCode(): string | null;
/**
- * The list of polylines created. They are arranged sequentially to form the
- * rendered route.
+ * Indicator that a default address was found, but more specific addresses exist.
*/
- polylines: google.maps.Polyline[];
- }
- /**
- * @deprecated Polyline setup is deprecated. Use the
- * PolylineCustomizationFunction methods for your location
- * provider instead.
- */
- export type PolylineSetup =
- | google.maps.journeySharing.PolylineSetupOptions
- | ((
- a: 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 {
+ get hasDefaultAddress(): boolean;
/**
- * Polyline options.
+ * The delivery address is matchable, but the EWS file indicates that an exact match will be available soon.
*/
- polylineOptions?: google.maps.PolylineOptions | null;
+ get hasNoEWSMatch(): boolean;
/**
- * Polyline visibility.
+ * LACSLink indicator.
*/
- visible?: boolean | null;
- }
- /**
- * 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 ShipmentMarkerCustomizationFunctionParams
- extends google.maps.journeySharing.MarkerCustomizationFunctionParams {
+ get lacsLinkIndicator(): string | null;
/**
- * Information for the task associated with this marker.
+ * LACSLink return code.
*/
- taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo;
- }
- /**
- * Parameters specific to polyline customization functions for {@link
- * google.maps.journeySharing.FleetEngineShipmentLocationProvider}.
- */
- export interface ShipmentPolylineCustomizationFunctionParams
- extends google.maps.journeySharing.PolylineCustomizationFunctionParams {
+ get lacsLinkReturnCode(): string | null;
/**
- * Information for the task associated with this polyline.
+ * PMB (Private Mail Box) unit designator.
*/
- taskTrackingInfo: google.maps.journeySharing.TaskTrackingInfo;
- }
- /**
- * The classification of polyline speed based on traffic data.
- *
- * Access by calling `const {Speed} = await
- * google.maps.importLibrary("journeySharing")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export enum Speed {
+ get pmbDesignator(): string | null;
/**
- * Normal speed, no slowdown is detected.
+ * PMB (Private Mail Box) number.
*/
- NORMAL = 'NORMAL',
+ get pmbNumber(): string | null;
/**
- * Slowdown detected, but no traffic jam formed.
+ * PO Box only postal code.
*/
- SLOW = 'SLOW',
+ get poBoxOnlyPostalCode(): boolean;
/**
- * Traffic jam detected.
+ * Main post office city.
*/
- TRAFFIC_JAM = 'TRAFFIC_JAM',
- }
- /**
- * 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 postOfficeCity(): string | null;
/**
- * The zero-based index of the ending point of the interval in the path.
+ * Main post office state.
*/
- endPolylinePointIndex: number;
+ get postOfficeState(): string | null;
/**
- * Traffic speed in this interval.
+ * USPS standardized address.
*/
- speed: google.maps.journeySharing.Speed;
+ get standardizedAddress(): google.maps.addressValidation.USPSAddress | null;
/**
- * The zero-based index of the starting point of the interval in the path.
+ * Footnotes from matching a street or highrise record to suite information. If business name match is found, the secondary number is returned.
*/
- startPolylinePointIndex: number;
+ get suiteLinkFootnote(): string | null;
+ toJSON(key?: string): unknown;
}
/**
- * The details for a task 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 Task {
- /**
- * Attributes assigned to the task.
- */
- attributes: {[key: string]: unknown};
+ export class Verdict {
/**
- * The timestamp of the estimated completion time of the task.
+ * 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.
*/
- estimatedCompletionTime: Date | null;
+ get addressComplete(): boolean;
/**
- * Information specific to the last location update.
+ * 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.
*/
- latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null;
+ get geocodeGranularity(): google.maps.addressValidation.GranularityString | 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.
+ * At least one address component was inferred (i.e. added) that wasn't in the input, see {@link google.maps.addressValidation.AddressComponent} for details.
*/
- name: string;
+ get hasInferredComponents(): boolean;
/**
- * The outcome of the task.
+ * At least one address component was replaced - see {@link google.maps.addressValidation.AddressComponent} for details.
*/
- outcome: string | null;
+ get hasReplacedComponents(): boolean | null;
/**
- * The location where the task was completed (from provider).
+ * At least one address component cannot be categorized or validated, see {@link google.maps.addressValidation.AddressComponent} for details.
*/
- outcomeLocation: google.maps.LatLngLiteral | null;
+ get hasUnconfirmedComponents(): boolean;
/**
- * The setter of the task outcome location ('PROVIDER' or
- * 'LAST_VEHICLE_LOCATION').
+ * 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.
*/
- outcomeLocationSource: string | null;
+ get inputGranularity(): google.maps.addressValidation.GranularityString | null;
/**
- * The timestamp of when the task's outcome was set (from provider).
+ * 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.
*/
- outcomeTime: Date | null;
+ get possibleNextAction(): google.maps.addressValidation.PossibleNextActionString | null;
/**
- * The location where the task is to be completed.
+ * 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.
*/
- plannedLocation: google.maps.LatLngLiteral | null;
+ 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 {
/**
- * Information about the segments left to be completed for this task.
+ * The address or geocode indicates a block. Only used in regions which have block-level addressing, such as Japan.
*/
- remainingVehicleJourneySegments: google.maps.journeySharing.VehicleJourneySegment[];
+ BLOCK = 'BLOCK',
/**
- * The current execution state of the task.
+ * All other granularities, which are bucketed together since they are not deliverable.
*/
- status: string;
+ OTHER = 'OTHER',
/**
- * The time window during which the task should be completed.
+ * Building-level result.
*/
- targetTimeWindow: google.maps.journeySharing.TimeWindow | null;
+ PREMISE = 'PREMISE',
/**
- * The tracking ID of the shipment.
+ * A geocode that approximates the building-level location of the address.
*/
- trackingId: string | null;
+ PREMISE_PROXIMITY = 'PREMISE_PROXIMITY',
/**
- * The task type; for example, a break or shipment.
+ * The geocode or address is granular to route, such as a street, road, or highway.
*/
- type: string;
+ ROUTE = 'ROUTE',
/**
- * The ID of the vehicle performing this task.
+ * Below-building level result, such as an apartment.
*/
- vehicleId: string | null;
+ SUB_PREMISE = 'SUB_PREMISE',
}
+ export type GranularityString = `${google.maps.addressValidation.Granularity}`;
/**
- * TaskInfo type, used by {@link
- * google.maps.journeySharing.DeliveryVehicleStop}.
+ * 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 interface TaskInfo {
+ export enum PossibleNextAction {
/**
- * The extra time it takes to perform the task, in milliseconds.
+ * 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.
*/
- extraDurationMillis: number | null;
+ ACCEPT = 'ACCEPT',
/**
- * The ID of the task.
+ * 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.
*/
- id: string | null;
+ CONFIRM = 'CONFIRM',
/**
- * The time window during which the task should be completed.
+ * 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.
*/
- targetTimeWindow: google.maps.journeySharing.TimeWindow | null;
- }
- /**
- * 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 interface TaskMarkerCustomizationFunctionParams
- extends google.maps.journeySharing
- .DeliveryVehicleMarkerCustomizationFunctionParams {
+ CONFIRM_ADD_SUBPREMISES = 'CONFIRM_ADD_SUBPREMISES',
/**
- * The task location represented by this marker.
+ * 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.
*/
- task: google.maps.journeySharing.Task;
+ FIX = 'FIX',
}
+ export type PossibleNextActionString = `${google.maps.addressValidation.PossibleNextAction}`;
/**
- * The details for a task tracking info object returned by Fleet Engine.
+ * 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 interface TaskTrackingInfo {
- /**
- * Attributes assigned to the task.
- */
- attributes: {[key: string]: unknown};
+ export class AddressValidation {
/**
- * The estimated arrival time to the stop location.
+ * Information about the address itself as opposed to the geocode.
*/
- estimatedArrivalTime: Date | null;
+ get address(): google.maps.addressValidation.Address | null;
/**
- * The estimated completion time of a Task.
+ * Information about the location and place that the address geocoded to.
*/
- estimatedTaskCompletionTime: Date | null;
+ get geocode(): google.maps.addressValidation.Geocode | null;
/**
- * Information specific to the last location update.
+ * Other information relevant to deliverability. metadata is not guaranteed to be fully populated for every address sent to the Address Validation API.
*/
- latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null;
+ get metadata(): google.maps.addressValidation.AddressMetadata | null;
/**
- * The name in the format
- * "providers/{provider_id}/taskTrackingInfo/{tracking_id}", where
- * tracking_id represents the tracking ID.
+ * The UUID that identifies this response. If the address needs to be re-validated, this UUID must accompany the new request.
*/
- name: string;
+ get responseId(): string | null;
/**
- * The location where the Task will be completed.
+ * Extra deliverability flags provided by USPS. Only provided in region US and PR.
*/
- plannedLocation: google.maps.LatLng | null;
+ get uspsData(): google.maps.addressValidation.USPSData | null;
/**
- * The total remaining distance in meters to the VehicleStop of
- * interest.
+ * Overall verdict flags
*/
- remainingDrivingDistanceMeters: number | null;
+ get verdict(): google.maps.addressValidation.Verdict | 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.
+ * Validates an address. See https://developers.google.com/maps/documentation/javascript/address-validation/validate-address.
*/
- remainingStopCount: number | null;
+ static fetchAddressValidation(request: google.maps.addressValidation.AddressValidationRequest): PromiseLatLngAltitude.
+ * @defaultValue null
*/
- taskOutcome: string | null;
+ get location(): google.maps.LatLngAltitude | null;
/**
- * The time when the Task's outcome was set by the provider.
+ * The location to render the air quality meter for. Normalizes to a LatLngAltitude.
+ * @defaultValue null
*/
- taskOutcomeTime: Date | null;
+ set location(value: google.maps.LatLngLiteral | google.maps.LatLng | google.maps.LatLngAltitudeLiteral | google.maps.LatLngAltitude | null | undefined);
/**
- * The tracking ID of a Task.
+ * An override for the language to request from the Air Quality API. See the list of supported languages.
+ * @defaultValue null
*/
- trackingId: string;
+ requestedLanguage: string | null;
+ addEventListener1
*/
- latestVehicleLocationUpdate: google.maps.journeySharing.VehicleLocationUpdate | null;
+ scale?: number | null;
/**
- * In the format "providers/{provider_id}/trips/{trip_id}". The
- * trip_id must be a unique identifier.
+ * The DOM element displayed in the pin.
+ * @deprecated Use {@link google.maps.marker.PinElementOptions.glyphText} or {@link google.maps.marker.PinElementOptions.glyphSrc} instead.
*/
- name: string;
+ 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 {
/**
- * Number of passengers on this trip; does not include the driver.
+ *
+ * @param options
*/
- passengerCount: number;
+ constructor(options?: google.maps.marker.PinElementOptions);
/**
- * The estimated future time when the passengers will be picked up, or the
- * actual time when they were picked up.
+ * The background color of the pin shape. See {@link google.maps.marker.PinElementOptions.background}.
*/
- pickupTime: Date | null;
+ background?: string | null;
/**
- * Location where the customer indicates they will be dropped off.
+ * The border color of the pin shape. See {@link google.maps.marker.PinElementOptions.borderColor}.
*/
- plannedDropOffLocation: google.maps.LatLngLiteral | null;
+ borderColor?: string | null;
/**
- * Location where customer indicates they will be picked up.
+ * The color of the pin glyph. See {@link google.maps.marker.PinElementOptions.glyphColor}.
*/
- plannedPickupLocation: google.maps.LatLngLiteral | null;
+ glyphColor?: string | null;
/**
- * An array of waypoints indicating the path from the current location to
- * the drop-off point.
+ * The source of the glyph image to be displayed in the pin. See {@link google.maps.marker.PinElementOptions.glyphSrc}.
*/
- remainingWaypoints: google.maps.journeySharing.VehicleWaypoint[];
+ glyphSrc?: URL | string | null;
/**
- * 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 text displayed in the pin. See {@link google.maps.marker.PinElementOptions.glyphText}.
*/
- status: string;
+ glyphText?: string | null;
/**
- * The type of the trip. Possible values are UNKNOWN_TRIP_TYPE, SHARED or
- * EXCLUSIVE.
+ * See {@link google.maps.marker.PinElementOptions.scale}.
*/
- type: string;
+ scale?: number | null;
/**
- * ID of the vehicle making this trip.
+ * This field is read-only. The DOM Element backing the view.
+ * @deprecated Use the PinElement directly.
*/
- vehicleId: string;
- }
- /**
- * 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 interface TripMarkerCustomizationFunctionParams
- extends google.maps.journeySharing.MarkerCustomizationFunctionParams {
+ get element(): HTMLElement;
/**
- * 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}.
+ * See {@link google.maps.marker.PinElementOptions.glyph}.
+ * @deprecated Use {@link google.maps.marker.PinElementOptions.glyphText} or {@link google.maps.marker.PinElementOptions.glyphSrc} instead.
*/
- trip: google.maps.journeySharing.Trip;
+ glyph?: string | Element | URL | null;
}
/**
- * Parameters specific to polyline customization functions for {@link
- * google.maps.journeySharing.FleetEngineTripLocationProvider}.
+ * 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 interface TripPolylineCustomizationFunctionParams
- extends google.maps.journeySharing.PolylineCustomizationFunctionParams {
- /**
- * The trip associated with this polyline.
- */
- trip: google.maps.journeySharing.Trip;
+ export class AdvancedMarkerClickEvent extends Event {
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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.
+ * Options for constructing an {@link google.maps.marker.AdvancedMarkerElement}.
*/
- export enum TripType {
+ export interface AdvancedMarkerElementOptions {
/**
- * The trip is exclusive to a vehicle.
+ * 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%"
*/
- EXCLUSIVE = 'EXCLUSIVE',
+ anchorLeft?: string | null;
/**
- * The trip may share a vehicle with other trips.
+ * 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%"
*/
- SHARED = 'SHARED',
+ anchorTop?: string | null;
/**
- * Unknown trip type.
+ * An enumeration specifying how an AdvancedMarkerElement should behave when it collides with another AdvancedMarkerElement or with the basemap labels on a vector map. AdvancedMarkerElement to AdvancedMarkerElement collision works on both raster and vector maps, however, AdvancedMarkerElement to base map's label collision only works on vector maps.
*/
- UNKNOWN_TRIP_TYPE = 'UNKNOWN_TRIP_TYPE',
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * TripWaypoint type.
- */
- export interface TripWaypoint {
+ collisionBehavior?: google.maps.CollisionBehaviorString | 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 DOM Element backing the visual of an AdvancedMarkerElement. 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}
*/
- distanceMeters: number | null;
+ content?: Node | 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.
+ * 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
*/
- durationMillis: number | null;
+ gmpClickable?: boolean | null;
/**
- * The location of the waypoint.
+ * If true, the AdvancedMarkerElement can be dragged. AdvancedMarkerElement with altitude is not draggable.
+ * @defaultValue false
*/
- location: google.maps.LatLng | null;
+ gmpDraggable?: boolean | null;
/**
- * 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.
+ * 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.
*/
- path: google.maps.LatLng[] | null;
+ map?: google.maps.Map | null;
/**
- * 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.
+ * 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. AdvancedMarkerElement with altitude is only supported on vector maps.
*/
- speedReadingIntervals:
- | google.maps.journeySharing.SpeedReadingInterval[]
- | null;
+ position?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null;
/**
- * The trip associated with this waypoint.
+ * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the AdvancedMarkerElement with the provided value.
*/
- tripId: string | null;
+ title?: string | null;
/**
- * The role this waypoint plays in this trip, such as pickup or dropoff.
+ * 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.
*/
- waypointType: google.maps.journeySharing.WaypointType | null;
+ zIndex?: number | null;
}
/**
- * Parameters specific to marker customization functions that apply options to
- * markers representing trip waypoint locations. Used by {@link
- * google.maps.journeySharing.FleetEngineTripLocationProviderOptions.waypointMarkerCustomization}.
+ * 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 interface TripWaypointMarkerCustomizationFunctionParams
- extends google.maps.journeySharing.TripMarkerCustomizationFunctionParams {
+ export class AdvancedMarkerElement extends HTMLElement implements google.maps.marker.AdvancedMarkerElementOptions {
/**
- * 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.
+ * Creates an AdvancedMarkerElement with the options specified. If a map is specified, the AdvancedMarkerElement is added to the map upon construction.
+ * @param options
*/
- waypointIndex: number;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * The details for a vehicle returned by Fleet Engine.
- */
- export interface Vehicle {
+ constructor(options?: google.maps.marker.AdvancedMarkerElementOptions);
/**
- * Custom vehicle attributes.
+ * 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%"
*/
- attributes: {[key: string]: unknown};
+ anchorLeft?: string | null;
/**
- * The waypoint where current route segment ends.
+ * 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%"
*/
- currentRouteSegmentEndPoint: google.maps.journeySharing.TripWaypoint | null;
+ anchorTop?: string | null;
/**
- * Time when the current route segment was set.
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.collisionBehavior}.
*/
- currentRouteSegmentVersion: Date | null;
+ collisionBehavior?: google.maps.CollisionBehaviorString | null;
/**
- * List of trip IDs for trips currently assigned to this vehicle.
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.gmpClickable}.
*/
- currentTrips: string[] | null;
+ gmpClickable?: boolean | null;
/**
- * The ETA to the first entry in the waypoints field.
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.gmpDraggable}.
*/
- etaToFirstWaypoint: Date | null;
+ gmpDraggable?: boolean | null;
/**
- * The last reported location of the vehicle.
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.map}.
+ */
+ map?: google.maps.Map | null;
+ /**
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.position}.
+ */
+ position?: google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null;
+ /**
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.title}.
+ */
+ title: string;
+ /**
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.zIndex}.
+ */
+ zIndex?: number | null;
+ /**
+ * This field is read-only. The DOM Element backing the view.
+ * @deprecated Use the AdvancedMarkerElement directly.
+ */
+ get element(): HTMLElement;
+ /**
+ * See {@link google.maps.marker.AdvancedMarkerElementOptions.content}.
+ * @deprecated Use .children instead.
+ */
+ content?: Node | null;
+ /**
+ * Adds the given listener function to the given event name in the Maps Eventing system.
+ */
+ addListener(eventName: string, handler: Function): google.maps.MapsEventListener;
+ addEventListenerCirclePathElement with the options specified.
+ * @param options
*/
- supportedTripTypes: google.maps.journeySharing.TripType[] | null;
+ constructor(options?: google.maps.maps3d.CirclePathElementOptions);
/**
- * The vehicle state.
+ * The center of the circle.
*/
- vehicleState: google.maps.journeySharing.VehicleState;
+ get center(): google.maps.LatLngAltitude | null;
/**
- * The type of this vehicle.
+ * The center of the circle.
*/
- vehicleType: google.maps.journeySharing.VehicleType;
+ set center(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined);
/**
- * The remaining waypoints assigned to this Vehicle.
+ * The radius of the circle in meters.
*/
- waypoints: google.maps.journeySharing.TripWaypoint[] | null;
+ get radius(): number | null;
/**
- * Last time the waypoints field was updated.
+ * The radius of the circle in meters.
*/
- waypointsVersion: Date | null;
+ set radius(value: number | null | undefined);
+ addEventListenerposition 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 enum VehicleType {
+ export class Marker3DElement extends HTMLElement implements google.maps.maps3d.Marker3DElementOptions {
/**
- * An automobile.
+ * Creates an Marker3DElement with the options specified.
+ * @param options
*/
- AUTO = 'AUTO',
+ constructor(options?: google.maps.maps3d.Marker3DElementOptions);
/**
- * Any vehicle that acts as a taxi (typically licensed or regulated).
+ * Specifies how the altitude component of the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- TAXI = 'TAXI',
+ get altitudeMode(): google.maps.maps3d.AltitudeModeString;
/**
- * A vehicle with a large storage capacity.
+ * Specifies how the altitude component of the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- TRUCK = 'TRUCK',
+ set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined);
/**
- * A motorcycle, moped, or other two-wheeled vehicle.
+ * 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
*/
- TWO_WHEELER = 'TWO_WHEELER',
+ get autofitsCamera(): boolean;
/**
- * Unknown vehicle type.
+ * 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
*/
- UNKNOWN = 'UNKNOWN',
- }
- /**
- * VehicleWaypoint type.
- */
- export interface VehicleWaypoint {
+ set autofitsCamera(value: boolean | null | undefined);
/**
- * 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.
+ * 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}
*/
- distanceMeters: number | null;
+ get collisionBehavior(): google.maps.CollisionBehaviorString;
/**
- * 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.
+ * 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}
*/
- durationMillis: number | null;
+ set collisionBehavior(value: google.maps.CollisionBehaviorString | null | undefined);
/**
- * The location of the waypoint.
+ * The collision priority used for collision detection.
*/
- location: google.maps.LatLngLiteral | null;
+ get collisionPriority(): number | 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.
+ * The collision priority used for collision detection.
*/
- path: google.maps.LatLngLiteral[] | null;
+ set collisionPriority(value: number | null | undefined);
/**
- * 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.
+ * 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
*/
- speedReadingIntervals:
- | google.maps.journeySharing.SpeedReadingInterval[]
- | null;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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 {
+ get drawsWhenOccluded(): boolean;
/**
- * 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.
+ * 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
*/
- waypointIndex: number;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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 {
+ set drawsWhenOccluded(value: boolean | null | undefined);
/**
- * Waypoints for dropping off riders.
+ * 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
*/
- DROP_OFF_WAYPOINT_TYPE = 'DROP_OFF_WAYPOINT_TYPE',
+ get extruded(): boolean;
/**
- * Waypoints for intermediate destinations in a multi-destination trip.
+ * 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
*/
- INTERMEDIATE_DESTINATION_WAYPOINT_TYPE = 'INTERMEDIATE_DESTINATION_WAYPOINT_TYPE',
+ set extruded(value: boolean | null | undefined);
/**
- * Waypoints for picking up riders.
+ * Text to be displayed by this marker.
*/
- PICKUP_WAYPOINT_TYPE = 'PICKUP_WAYPOINT_TYPE',
+ get label(): string | null;
/**
- * Unknown waypoint type.
+ * Text to be displayed by this marker.
*/
- UNKNOWN_WAYPOINT_TYPE = 'UNKNOWN_WAYPOINT_TYPE',
- }
-}
-declare namespace google.maps.localContext {
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Shows a Local Context experience with a {@link google.maps.Map}.
- *
- * Access by calling `const {LocalContextMapView} = await
- * google.maps.importLibrary("localContext")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @deprecated Local Context is deprecated, and no longer recommended for new
- * websites. The feature will continue to work, and 12 months notice will
- * be given before support is discontinued. If you are interested in
- * building a Local Context-like experience yourself, we suggest that you
- * check out the "Neighborhood Discovery" solution in Quick
- * Builder or use the Places
- * Library, Maps JavaScript API. Code
- * samples and codelabs
- * for the Places Library can help you.
- */
- export class LocalContextMapView
- implements google.maps.localContext.LocalContextMapViewOptions
- {
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Shows a Local Context experience with a {@link google.maps.Map}.
- *
- * Access by calling `const {LocalContextMapView} = await
- * google.maps.importLibrary("localContext")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- * @deprecated Local Context is deprecated, and no longer recommended for
- * new websites. The feature will continue to work, and 12 months notice
- * will be given before support is discontinued. If you are interested
- * in building a Local Context-like experience yourself, we suggest that
- * you check out the "Neighborhood Discovery" solution in Quick
- * Builder or use the Places
- * Library, Maps JavaScript API. Code
- * samples and codelabs
- * for the Places Library can help you.
- */
- constructor(options: google.maps.localContext.LocalContextMapViewOptions);
- /**
- * Adds the given listener function to the given event name.
- */
- addListener(
- eventName: string,
- handler: Function,
- ): google.maps.MapsEventListener;
- /**
- * See {@link
- * google.maps.localContext.LocalContextMapViewOptions.directionsOptions}.
- */
- directionsOptions?: null | google.maps.localContext.MapDirectionsOptionsLiteral;
- /**
- * This Field is read-only. The DOM Element backing the view.
- */
- element?: HTMLElement | SVGElement | null;
- /**
- * Hides the place details.
- */
- hidePlaceDetailsView(): void;
- /**
- * Is set to true before {@link
- * google.maps.localContext.LocalContextMapView} begins changing the bounds
- * of the inner {@link google.maps.Map}, and set to false
- * after {@link google.maps.localContext.LocalContextMapView} finishes
- * changing the bounds of the inner {@link google.maps.Map}. (Not set when
- * layout mode changes happen due to responsive resizing.)
- */
- isTransitioningMapBounds: boolean;
- /**
- * See {@link
- * google.maps.localContext.LocalContextMapViewOptions.locationBias}.
- * Changing this property on the LocalContextMapView may
- * trigger a new search.
- */
- locationBias?:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string
- | null;
- /**
- * See {@link
- * google.maps.localContext.LocalContextMapViewOptions.locationRestriction}.
- * Changing this property on the LocalContextMapView may
- * trigger a new search.
- */
- locationRestriction?:
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | null;
- map?: google.maps.Map | null;
+ set label(value: string | null | undefined);
/**
- * See {@link
- * google.maps.localContext.LocalContextMapViewOptions.maxPlaceCount}.
- * Changing this property on the LocalContextMapView may
- * trigger a new search.
- */
- maxPlaceCount: number;
- pinOptionsSetup?:
- | ((a: {
- isHighlighted: boolean;
- isSelected: boolean;
- }) => google.maps.localContext.PinOptions | null | undefined)
- | google.maps.localContext.PinOptions
- | null;
- placeChooserViewSetup?:
- | ((a: {
- defaultLayoutMode: google.maps.localContext.PlaceChooserLayoutMode;
- defaultPosition: google.maps.localContext.PlaceChooserPosition | null;
- }) =>
- | google.maps.localContext.PlaceChooserViewSetupOptions
- | null
- | undefined)
- | google.maps.localContext.PlaceChooserViewSetupOptions
- | null;
- placeDetailsViewSetup?:
- | ((a: {
- defaultLayoutMode: google.maps.localContext.PlaceDetailsLayoutMode;
- defaultPosition: google.maps.localContext.PlaceDetailsPosition | null;
- }) =>
- | google.maps.localContext.PlaceDetailsViewSetupOptions
- | null
- | undefined)
- | google.maps.localContext.PlaceDetailsViewSetupOptions
- | null;
- /**
- * See {@link
- * google.maps.localContext.LocalContextMapViewOptions.placeTypePreferences}.
- * Changing this property on the LocalContextMapView may
- * trigger a new search.
- * Iterable<string|PlaceTypePreference> is also accepted.
- */
- placeTypePreferences: google.maps.localContext.PlaceTypePreference[];
- /**
- * Searches for places to show the user based on the current
- * maxPlaceCount, placeTypePreferences,
- * locationRestriction, and locationBias.
- */
- search(): void;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Options for constructing a {@link
- * google.maps.localContext.LocalContextMapView}, or accessing an
- * existing {@link google.maps.localContext.LocalContextMapView}.
- */
- export interface LocalContextMapViewOptions {
+ * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional.
+ */
+ get position(): google.maps.LatLngAltitude | null;
/**
- * Options for customizing directions. If not set, directions and distance
- * will be disabled.
+ * The location of the tip of the marker. Altitude is ignored in certain modes and thus optional.
*/
- directionsOptions?: null | google.maps.localContext.MapDirectionsOptionsLiteral;
+ set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined);
/**
- * This Field is read-only. The DOM Element backing the view.
+ * 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
*/
- element?: HTMLElement | SVGElement | null;
+ get sizePreserved(): boolean;
/**
- * A soft boundary or hint to use when searching for places.
- * @defaultValue null
+ * 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
*/
- locationBias?:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string
- | null;
- /**
- * Bounds to constrain search results. If not specified, results will be
- * constrained to the map viewport.
- */
- locationRestriction?:
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | null;
- /**
- * An already instantiated {@link google.maps.Map} instance. If passed in,
- * the map will be moved into the LocalContextMapView's DOM, and will
- * not be re-styled. The element associated with the Map
- * may also have styles and classes applied to it by the
- * LocalContextMapView.
+ set sizePreserved(value: boolean | null | undefined);
+ /**
+ * The zIndex compared to other markers.
*/
- map?: google.maps.Map | null;
+ get zIndex(): number | null;
/**
- * The maximum number of places to show. When this parameter is 0, the Local
- * Context Library does not load places. [0,24]
- */
- maxPlaceCount: number;
- /**
- * Configure the place marker icon based on the icon state. Invoked whenever
- * the input to the callback changes. Pass a function to dynamically
- * override the default setup when the LocalContextMapView draws the place
- * marker. Errors and invalid configurations may be determined
- * asynchronously, and will be ignored (defaults will be used, and errors
- * will be logged to the console).
- */
- pinOptionsSetup?:
- | ((a: {
- isHighlighted: boolean;
- isSelected: boolean;
- }) => google.maps.localContext.PinOptions | null | undefined)
- | google.maps.localContext.PinOptions
- | null;
- /**
- * Overrides the setup of the place chooser view. Pass a function to
- * dynamically override the default setup when the LocalContextMapView might
- * change its layout due to resizing. Errors and invalid configurations may
- * be determined asynchronously, and will be ignored (defaults will be used
- * instead, and errors will be logged to the console). Errors detected at
- * construction will cause errors to be thrown synchronously.
- */
- placeChooserViewSetup?:
- | ((a: {
- defaultLayoutMode: google.maps.localContext.PlaceChooserLayoutMode;
- defaultPosition: google.maps.localContext.PlaceChooserPosition | null;
- }) =>
- | google.maps.localContext.PlaceChooserViewSetupOptions
- | null
- | undefined)
- | google.maps.localContext.PlaceChooserViewSetupOptions
- | null;
- /**
- * Overrides the setup of the place details view. Pass a function to
- * dynamically override the default setup when the LocalContextMapView might
- * change its layout due to resizing. Errors and invalid configurations may
- * be determined asynchronously, and will be ignored (defaults will be used,
- * and errors will be logged to the console). Errors detected at
- * construction will cause errors to be thrown synchronously.
- */
- placeDetailsViewSetup?:
- | ((a: {
- defaultLayoutMode: google.maps.localContext.PlaceDetailsLayoutMode;
- defaultPosition: google.maps.localContext.PlaceDetailsPosition | null;
- }) =>
- | google.maps.localContext.PlaceDetailsViewSetupOptions
- | null
- | undefined)
- | google.maps.localContext.PlaceDetailsViewSetupOptions
- | null;
- /**
- * The types of places to search for (up to 10). The type
- * Iterable<string|PlaceTypePreference> is also accepted,
- * but is only supported in browsers which natively support JavaScript
- * Symbols.
- */
- placeTypePreferences: google.maps.localContext.PlaceTypePreference[];
+ * The zIndex compared to other markers.
+ */
+ set zIndex(value: number | null | undefined);
+ addEventListenerMap3DElement. 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 interface MapDirectionsOptionsLiteral {
+ export class SteadyChangeEvent extends Event {
/**
- * Origin for directions and distance.
+ * Indicates whether Map3DElement is steady (i.e. all rendering for the current scene has completed) or not.
*/
- origin: google.maps.LatLng | google.maps.LatLngLiteral;
+ isSteady: boolean;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Options for customizing a pin marker.
+ * 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 interface PinOptions {
+ export class Marker3DInteractiveElement extends google.maps.maps3d.Marker3DElement implements google.maps.maps3d.Marker3DInteractiveElementOptions {
/**
- * The color of the icon's shape, can be any valid CSS color.
+ * Creates an Marker3DInteractiveElement with the options specified.
+ * @param options
*/
- background?: string | null;
+ constructor(options?: google.maps.maps3d.Marker3DInteractiveElementOptions);
/**
- * The color of the icon's glyph, can be any valid CSS color.
+ * When set, the popover element will be open on this marker's click.
*/
- glyphColor?: string | null;
+ get gmpPopoverTargetElement(): google.maps.maps3d.PopoverElement | null;
/**
- * The scale of the icon. The value is absolute, not relative to the default
- * sizes in each state.
+ * When set, the popover element will be open on this marker's click.
*/
- scale?: number | null;
+ 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;
+ addEventListenerlayoutMode:HIDDEN. If not passed, a position
- * will be determined automatically based on the layoutMode.
+ * See {@link google.maps.maps3d.MarkerElement.collisionBehavior}.
*/
- position?: google.maps.localContext.PlaceChooserPosition | null;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Layout modes for the place details.
- *
- * Access by calling `const {PlaceDetailsLayoutMode} = await
- * google.maps.importLibrary("localContext")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export enum PlaceDetailsLayoutMode {
+ collisionBehavior?: google.maps.CollisionBehaviorString | null;
+ /**
+ * See {@link google.maps.maps3d.MarkerElement.collisionPriority}.
+ */
+ collisionPriority?: number | null;
/**
- * Place details is displayed in an {@link google.maps.InfoWindow}.
+ * See {@link google.maps.maps3d.MarkerElement.position}.
*/
- INFO_WINDOW = 'INFO_WINDOW',
+ position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null;
/**
- * Place details is displayed in a sheet.
+ * See {@link google.maps.maps3d.MarkerElement.title}.
*/
- SHEET = 'SHEET',
+ title?: string;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Display positions for the place details.
- *
- * Access by calling `const {PlaceDetailsPosition} = await
- * google.maps.importLibrary("localContext")`. 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.
+ * Access by calling `const {MarkerElement} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export enum PlaceDetailsPosition {
+ export class MarkerElement extends HTMLElement implements google.maps.maps3d.MarkerElementOptions {
/**
- * Place details is displayed inline with the map at the end of the line.
- * (In a left-to-right language this means that the place details is to the
- * right of the map.)
+ * Creates an MarkerElement with the options specified.
+ * @param options
*/
- INLINE_END = 'INLINE_END',
+ constructor(options?: google.maps.maps3d.MarkerElementOptions);
/**
- * Place details is displayed inline with the map at the start of the line.
- * (In a left-to-right language this means that the place details is to the
- * left of the map.)
+ * Specifies how the altitude component of the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- INLINE_START = 'INLINE_START',
- }
- /**
- * Setup options for the place details. Read more about setting
- * layout and visibility.
- */
- export interface PlaceDetailsViewSetupOptions {
- hidesOnMapClick?: boolean;
- layoutMode?: google.maps.localContext.PlaceDetailsLayoutMode | null;
+ get altitudeMode(): google.maps.maps3d.AltitudeModeString;
/**
- * Ignored when layoutMode:INFO_WINDOW. If not passed, a
- * position will be determined automatically based on the
- * layoutMode.
+ * Specifies how the altitude component of the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- position?: google.maps.localContext.PlaceDetailsPosition | null;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- */
- export type PlaceTypePreference = {type: string; weight?: number};
-}
-declare namespace google.maps.maps3d {
- /**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * 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 {
+ set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined);
/**
- * 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.
+ * 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%
*/
- ABSOLUTE = 'ABSOLUTE',
+ get anchorLeft(): string;
/**
- * 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.
+ * 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%
*/
- CLAMP_TO_GROUND = 'CLAMP_TO_GROUND',
+ set anchorLeft(value: string | null | undefined);
/**
- * 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.
+ * 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%
*/
- RELATIVE_TO_GROUND = 'RELATIVE_TO_GROUND',
+ get anchorTop(): string;
/**
- * 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).
+ * 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%
*/
- RELATIVE_TO_MESH = 'RELATIVE_TO_MESH',
+ set anchorTop(value: string | 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}
+ */
+ 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;
+ addEventListenerMap3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {CenterChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. 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 CenterChangeEvent extends Event {
+ 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);
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * This event is created from monitoring center change on
- * Map3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {CenterChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * When set, the popover element will be open on this marker's click.
*/
- constructor();
+ 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);
+ addEventListenerMap3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {HeadingChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. 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 HeadingChangeEvent extends Event {
+ export interface MarkerInteractiveElementOptions extends google.maps.maps3d.MarkerElementOptions {
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * This event is created from monitoring heading change on
- * Map3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {HeadingChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * See {@link google.maps.maps3d.MarkerInteractiveElement.gmpPopoverTargetElement}.
*/
- constructor();
+ gmpPopoverTargetElement?: google.maps.maps3d.PopoverElement | null;
}
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * 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.
+ * Model3DElementOptions object used to define the properties that can be set on a Model3DElement.
*/
- export class LocationClickEvent extends Event {
+ export interface Model3DElementOptions {
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * 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.
+ * See {@link google.maps.maps3d.Model3DElement.altitudeMode}.
*/
- constructor();
+ altitudeMode?: google.maps.maps3d.AltitudeModeString | null;
/**
- * 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.maps3d.Model3DElement.orientation}.
*/
- position: google.maps.LatLngAltitude | null;
- }
- /**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * Map3DElement is an HTML interface for the 3D Map view.
- *
- * 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
- {
+ orientation?: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null;
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * Map3DElement is an HTML interface for the 3D Map view.
- *
- * Access by calling `const {Map3DElement} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * See {@link google.maps.maps3d.Model3DElement.position}.
*/
- constructor(options?: google.maps.maps3d.Map3DElementOptions);
+ position?: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | 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.
+ * See {@link google.maps.maps3d.Model3DElement.scale}.
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ scale?: number | google.maps.Vector3D | google.maps.Vector3DLiteral | null;
/**
- * The center of the map given as a LatLngAltitude, where altitude is in
- * meters above ground 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).
+ * See {@link google.maps.maps3d.Model3DElement.src}.
*/
- center?: google.maps.LatLngAltitudeLiteral | null;
+ src?: string | URL | 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.
+ */
+ export class Model3DElement extends HTMLElement implements google.maps.maps3d.Model3DElementOptions {
/**
- * When true, default map labels aren't rendered.
- * @defaultValue false
+ * Creates an Model3DElement with the options specified.
+ * @param options
*/
- defaultLabelsDisabled?: boolean | null;
+ constructor(options?: google.maps.maps3d.Model3DElementOptions);
/**
- * 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.
+ * Specifies how altitude in the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- heading?: number | null;
+ get altitudeMode(): google.maps.maps3d.AltitudeModeString;
/**
- * 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).
+ * Specifies how altitude in the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- maxAltitude?: number | null;
+ set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined);
/**
- * 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].
+ * 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.
*/
- maxHeading?: number | null;
+ get orientation(): google.maps.Orientation3D | null;
/**
- * The maximum angle of incidence of the map. A valid value is between
- * 0 and 90 degrees.
+ * 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.
*/
- maxTilt?: number | null;
+ set orientation(value: google.maps.Orientation3D | google.maps.Orientation3DLiteral | null | undefined);
/**
- * 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).
+ * Sets the Model3DElement's position. Altitude is ignored in certain modes and thus optional.
*/
- minAltitude?: number | null;
+ get position(): google.maps.LatLngAltitude | 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].
+ * Sets the Model3DElement's position. Altitude is ignored in certain modes and thus optional.
*/
- minHeading?: number | null;
+ set position(value: google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null | undefined);
/**
- * The minimum angle of incidence of the map. A valid value is between
- * 0 and 90 degrees.
+ * Scales the model along the x, y, and z axes in the model's coordinate space.
+ * @defaultValue 1
*/
- minTilt?: number | null;
+ get scale(): google.maps.Vector3D | null;
/**
- * The distance from camera to the center of the map, in meters.
+ * Scales the model along the x, y, and z axes in the model's coordinate space.
+ * @defaultValue 1
*/
- range?: number | null;
+ set scale(value: number | google.maps.Vector3D | google.maps.Vector3DLiteral | null | undefined);
/**
- * 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.
+ * 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.
*/
- roll?: number | null;
+ get src(): URL | 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.
+ * 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.
*/
- tilt?: number | null;
+ set src(value: string | URL | null | undefined);
+ addEventListenerposition 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 interface Map3DElementOptions {
+ export class Model3DInteractiveElement extends google.maps.maps3d.Model3DElement implements google.maps.maps3d.Model3DInteractiveElementOptions {
/**
- * See {@link google.maps.maps3d.Map3DElement.bounds}.
+ * Creates a Model3DInteractiveElement with the options specified.
+ * @param options
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
+ constructor(options?: google.maps.maps3d.Model3DElementOptions);
+ addEventListenerPolygon3DElement with the options specified.
+ * @param options
*/
constructor(options?: google.maps.maps3d.Polygon3DElementOptions);
/**
* Specifies how altitude components in the coordinates are interpreted.
- * @defaultValue {@link google.maps.maps3d.AltitudeMode.ABSOLUTE}
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
+ */
+ get altitudeMode(): google.maps.maps3d.AltitudeModeString;
+ /**
+ * Specifies how altitude components in the coordinates are interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- altitudeMode?: google.maps.maps3d.AltitudeMode | null;
+ set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined);
/**
- * Specifies whether parts of the polygon which could be occluded are drawn
- * or not. Polygons can be occluded by map geometry (e.g. buildings).
+ * 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
*/
- drawsOccludedSegments?: boolean | null;
+ get drawsOccludedSegments(): boolean;
/**
- * Specifies whether to connect the polygon to the ground. To extrude a
- * polygon, the altitudeMode must be either
- * RELATIVE_TO_GROUND or ABSOLUTE.
+ * 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
*/
- extruded?: boolean | null;
+ set drawsOccludedSegments(value: boolean | null | undefined);
+ /**
+ * 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
+ */
+ get extruded(): boolean;
+ /**
+ * 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
+ */
+ set extruded(value: boolean | null | undefined);
/**
* The fill color. All CSS3 colors are supported.
*/
- fillColor?: string | null;
+ get fillColor(): string | null;
/**
- * The fill opacity between 0.0 and 1.0.
+ * The fill color. All CSS3 colors are supported.
*/
- fillOpacity?: number | null;
+ set fillColor(value: string | null | undefined);
/**
- * 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.
+ * 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
*/
- geodesic?: boolean | null;
+ get geodesic(): boolean;
+ /**
+ * 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
+ */
+ set geodesic(value: boolean | null | undefined);
/**
- * 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 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.
*/
- innerCoordinates?: Iterable0.0 and 1.0.
+ * The stroke color. All CSS3 colors are supported.
*/
- strokeOpacity?: number | null;
+ set strokeColor(value: string | null | undefined);
/**
* The stroke width in pixels.
*/
- strokeWidth?: number | null;
+ get strokeWidth(): number | null;
+ /**
+ * The stroke width in pixels.
+ */
+ set strokeWidth(value: number | null | undefined);
/**
* The zIndex compared to other polys.
*/
- zIndex?: number | null;
+ get zIndex(): number | null;
+ /**
+ * The zIndex compared to other polys.
+ */
+ set zIndex(value: number | null | undefined);
+ /**
+ * 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.
+ */
+ outerCoordinates?: IterableinnerPaths instead. This property will be removed in a future release.
+ */
+ innerCoordinates?: IterablePolygon3DElement, 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 Polygon3DElementOptions {
+ export class Polygon3DInteractiveElement extends google.maps.maps3d.Polygon3DElement implements google.maps.maps3d.Polygon3DInteractiveElementOptions {
/**
- * See {@link google.maps.maps3d.Polygon3DElement.altitudeMode}.
- * @defaultValue {@link google.maps.maps3d.AltitudeMode.ABSOLUTE}
+ * Creates a Polygon3DInteractiveElement with the options specified.
+ * @param options
*/
- altitudeMode?: google.maps.maps3d.AltitudeMode | null;
+ constructor(options?: google.maps.maps3d.Polygon3DElementOptions);
+ addEventListenerfalse
+ * See {@link google.maps.maps3d.Polyline3DElement.altitudeMode}.
*/
- drawsOccludedSegments?: boolean | null;
+ altitudeMode?: google.maps.maps3d.AltitudeModeString | null;
/**
- * See {@link google.maps.maps3d.Polygon3DElement.extruded}.
- * @defaultValue false
+ * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
+ * See {@link google.maps.maps3d.Polyline3DElement.autofitsCamera}.
*/
- extruded?: boolean | null;
+ autofitsCamera?: boolean | null;
/**
- * See {@link google.maps.maps3d.Polygon3DElement.fillColor}.
+ * See {@link google.maps.maps3d.Polyline3DElement.coordinates}.
*/
- fillColor?: string | null;
+ coordinates?: Iterablefalse
+ * See {@link google.maps.maps3d.Polyline3DElement.extruded}.
+ */
+ extruded?: boolean | null;
+ /**
+ * See {@link google.maps.maps3d.Polyline3DElement.geodesic}.
*/
geodesic?: boolean | null;
/**
- * See {@link google.maps.maps3d.Polygon3DElement.innerCoordinates}.
+ * See {@link google.maps.maps3d.Polyline3DElement.outerColor}.
*/
- innerCoordinates?: IterablePolyline3DElement 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.ABSOLUTE}
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- altitudeMode?: google.maps.maps3d.AltitudeMode | null;
+ get altitudeMode(): google.maps.maps3d.AltitudeModeString;
/**
- * The ordered sequence of coordinates of the Polyline. Altitude is ignored
- * in certain modes and thus optional.
+ * Specifies how altitude components in the coordinates are interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- coordinates?: Iterablefalse
*/
- drawsOccludedSegments?: boolean | null;
+ get autofitsCamera(): boolean;
/**
- * Specifies whether to connect the polyline to the ground. To extrude a
- * polyline, the altitudeMode must be either
- * RELATIVE_TO_GROUND or ABSOLUTE.
+ * 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
*/
- extruded?: boolean | null;
+ set autofitsCamera(value: boolean | null | undefined);
/**
- * 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.
+ * 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
*/
- geodesic?: boolean | null;
+ get drawsOccludedSegments(): boolean;
+ /**
+ * 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
+ */
+ set drawsOccludedSegments(value: boolean | null | undefined);
+ /**
+ * 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
+ */
+ get extruded(): boolean;
+ /**
+ * 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
+ */
+ set extruded(value: boolean | null | undefined);
+ /**
+ * 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
+ */
+ get geodesic(): boolean;
+ /**
+ * 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
+ */
+ set geodesic(value: boolean | null | undefined);
/**
* The outer color. All CSS3 colors are supported.
*/
- outerColor?: string | null;
+ get outerColor(): string | null;
+ /**
+ * The outer color. All CSS3 colors are supported.
+ */
+ set outerColor(value: string | null | undefined);
+ /**
+ * The outer width is between 0.0 and 1.0. This is a percentage of the strokeWidth.
+ */
+ get outerWidth(): number | null;
+ /**
+ * The outer width is between 0.0 and 1.0. This is a percentage of the strokeWidth.
+ */
+ set outerWidth(value: number | null | undefined);
+ /**
+ * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional.
+ */
+ get path(): google.maps.LatLngAltitude[] | null;
+ /**
+ * The ordered sequence of coordinates of the Polyline. Altitude is ignored in certain modes and thus optional.
+ */
+ set path(value: Iterablepath instead. This property will be removed in a future release.
+ */
+ coordinates?: IterablePolyline3DElement, 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 {
+ /**
+ * Creates a Polyline3DInteractiveElement with the options specified.
+ * @param options
+ */
+ constructor(options?: google.maps.maps3d.Polyline3DElementOptions);
+ addEventListener0.0 and 1.0.
+ * The duration of the animation in milliseconds. A duration of 0 will teleport the camera straight to the end position.
*/
- outerOpacity?: number | null;
+ durationMillis?: number;
/**
- * The outer width is between 0.0 and 1.0. This is
- * a percentage of the strokeWidth.
+ * The location at which the camera should point at the end of the animation.
*/
- outerWidth?: number | null;
+ endCamera: google.maps.maps3d.CameraOptions;
+ }
+ /**
+ * Customization options for the FlyCameraAround Animation.
+ */
+ export interface FlyAroundAnimationOptions {
/**
- * The stroke color. All CSS3 colors are supported.
+ * 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.
*/
- strokeColor?: string | null;
+ camera: google.maps.maps3d.CameraOptions;
/**
- * The stroke opacity between 0.0 and 1.0.
+ * The duration of one animation cycle in milliseconds.
*/
- strokeOpacity?: number | null;
+ durationMillis?: number;
/**
- * The stroke width in pixels.
+ * 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.
*/
- strokeWidth?: number | null;
+ repeatCount?: number;
/**
- * The zIndex compared to other polys.
+ * 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.
*/
- zIndex?: number | null;
+ rounds?: number;
}
/**
* 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.
*
- * Polyline3DElementOptions object used to define the properties that can be
- * set on a Polyline3DElement.
+ * Access by calling `const {AutofitsCameraAnimation} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export interface Polyline3DElementOptions {
+ export enum AutofitsCameraAnimation {
/**
- * See {@link google.maps.maps3d.Polyline3DElement.altitudeMode}.
- * @defaultValue {@link google.maps.maps3d.AltitudeMode.ABSOLUTE}
+ * Flies to the new position.
*/
- altitudeMode?: google.maps.maps3d.AltitudeMode | null;
+ FLY_TO = 'FLY_TO',
/**
- * See {@link google.maps.maps3d.Polyline3DElement.coordinates}.
+ * Snaps to the new position without an animation.
*/
- coordinates?: Iterablefalse
+ * 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}
*/
- drawsOccludedSegments?: boolean | null;
+ altitudeMode?: google.maps.maps3d.AltitudeModeString | null;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.extruded}.
- * @defaultValue false
+ * See {@link google.maps.maps3d.Map3DElement.cameraPosition}.
*/
- extruded?: boolean | null;
+ cameraPosition?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.geodesic}.
- * @defaultValue false
+ * See {@link google.maps.maps3d.Map3DElement.center}.
*/
- geodesic?: boolean | null;
+ center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | null;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.outerColor}.
+ * See {@link google.maps.maps3d.Map3DElement.fov}.
*/
- outerColor?: string | null;
+ fov?: number | null;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.outerOpacity}.
+ * See {@link google.maps.maps3d.Map3DElement.heading}.
*/
- outerOpacity?: number | null;
+ heading?: number | null;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.outerWidth}.
+ * See {@link google.maps.maps3d.Map3DElement.range}.
*/
- outerWidth?: number | null;
+ range?: number | null;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.strokeColor}.
+ * See {@link google.maps.maps3d.Map3DElement.roll}.
*/
- strokeColor?: string | null;
+ roll?: number | null;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.strokeOpacity}.
+ * See {@link google.maps.maps3d.Map3DElement.tilt}.
*/
- strokeOpacity?: number | null;
+ 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 {
/**
- * See {@link google.maps.maps3d.Polyline3DElement.strokeWidth}.
+ * The place id of the map feature.
*/
- strokeWidth?: number | null;
+ placeId: string;
/**
- * See {@link google.maps.maps3d.Polyline3DElement.zIndex}.
+ * 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.
*/
- zIndex?: number | null;
+ fetchPlace(): PromiseMap3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {RangeChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Map3DElementOptions object used to define the properties that can be set on a Map3DElement.
*/
- export class RangeChangeEvent extends Event {
+ export interface Map3DElementOptions {
/**
* Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * This event is created from monitoring range change on
- * Map3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {RangeChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * See {@link google.maps.maps3d.Map3DElement.autofitsCameraAnimation}.
*/
- constructor();
- }
- /**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * This event is created from monitoring roll change on
- * Map3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {RollChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class RollChangeEvent extends Event {
+ autofitsCameraAnimation?: google.maps.maps3d.AutofitsCameraAnimationString | null;
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * This event is created from monitoring roll change on
- * Map3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {RollChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * See {@link google.maps.maps3d.Map3DElement.bounds}.
*/
- constructor();
- }
- /**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * 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 {
+ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null;
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * 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.
+ * See {@link google.maps.maps3d.Map3DElement.cameraPosition}.
*/
- constructor();
+ cameraPosition?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null;
/**
- * Indicates whether Map3DElement is steady (i.e. all rendering for the
- * current scene has completed) or not.
+ * See {@link google.maps.maps3d.Map3DElement.center}.
*/
- isSteady: boolean;
- }
- /**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * This event is created from monitoring tilt change on
- * Map3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {TiltChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class TiltChangeEvent extends Event {
+ center?: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null;
/**
- * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
- *
- * This event is created from monitoring tilt change on
- * Map3DElement. This event bubbles up through the DOM tree.
- *
- * Access by calling `const {TiltChangeEvent} = await
- * google.maps.importLibrary("maps3d")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * See {@link google.maps.maps3d.Map3DElement.defaultUIHidden}.
*/
- constructor();
- }
-}
-declare namespace google.maps.marker {
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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 {
+ defaultUIHidden?: boolean | null;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * 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.
+ * See {@link google.maps.maps3d.Map3DElement.description}.
*/
- constructor();
- }
- /**
- * Shows a position on a map. Note that the position must be set
- * for the AdvancedMarkerElement to display.
- * Note: Usage as a Web Component (e.g. using the custom
- * <gmp-advanced-marker> HTML element, is only available in
- * the v=beta channel).
- *
- * 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
- {
- /**
- * Shows a position on a map. Note that the position must be
- * set for the AdvancedMarkerElement to display.
- * Note: Usage as a Web Component (e.g. using the custom
- * <gmp-advanced-marker> HTML element, is only available
- * in the v=beta channel).
- *
- * Access by calling `const {AdvancedMarkerElement} = await
- * google.maps.importLibrary("marker")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ description?: string | null;
+ /**
+ * See {@link google.maps.maps3d.Map3DElement.fov}.
*/
- constructor(options?: google.maps.marker.AdvancedMarkerElementOptions);
+ fov?: number | null;
/**
- * Adds the given listener function to the given event name in the Maps
- * Eventing system.
- * @param eventName Observed event.
- * @param handler Function to handle events.
+ * See {@link google.maps.maps3d.Map3DElement.gestureHandling}.
*/
- addListener(
- eventName: string,
- handler: Function,
- ): google.maps.MapsEventListener;
+ gestureHandling?: google.maps.maps3d.GestureHandlingString | null;
/**
- * See {@link
- * google.maps.marker.AdvancedMarkerElementOptions.collisionBehavior}.
+ * See {@link google.maps.maps3d.Map3DElement.heading}.
*/
- collisionBehavior?: google.maps.CollisionBehavior | null;
+ heading?: number | null;
/**
- * See {@link google.maps.marker.AdvancedMarkerElementOptions.content}.
+ * See {@link google.maps.maps3d.Map3DElement.internalUsageAttributionIds}.
*/
- content?: Node | null;
+ internalUsageAttributionIds?: IterableAdvancedMarkerElement
- * should behave when it collides with another
- * AdvancedMarkerElement or with the basemap labels on a vector
- * map. AdvancedMarkerElement to
- * AdvancedMarkerElement collision works on both raster and
- * vector maps, however, AdvancedMarkerElement to base
- * map's label collision only works on vector maps.
- */
- collisionBehavior?: google.maps.CollisionBehavior | null;
- /**
- * The DOM Element backing the visual of an
- * AdvancedMarkerElement. 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.element}
+ * See {@link google.maps.maps3d.Map3DElement.minTilt}.
*/
- content?: Node | null;
+ minTilt?: number | null;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- * 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
+ * See {@link google.maps.maps3d.Map3DElement.mode}.
*/
- gmpClickable?: boolean | null;
+ mode?: google.maps.maps3d.MapModeString | null;
/**
- * If true, the AdvancedMarkerElement can be
- * dragged. AdvancedMarkerElement
- * with altitude is not draggable.
- * @defaultValue false
+ * See {@link google.maps.maps3d.Map3DElement.range}.
*/
- gmpDraggable?: boolean | null;
+ range?: number | null;
/**
- * 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.
+ * See {@link google.maps.maps3d.Map3DElement.region}.
*/
- map?: google.maps.Map | null;
+ region?: string | null;
/**
- * 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. AdvancedMarkerElement with altitude is only supported on
- * vector maps.
+ * See {@link google.maps.maps3d.Map3DElement.roll}.
*/
- position?: google.maps.LatLng | google.maps.LatLngLiteral | null;
+ roll?: number | null;
/**
- * 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.maps3d.Map3DElement.tilt}.
*/
- title?: string | null;
+ tilt?: number | 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. 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.maps3d.Map3DElement.defaultUIDisabled}.
+ * @deprecated Please use {@link google.maps.maps3d.Map3DElement.defaultUIHidden} instead. This property will be removed in a future release.
*/
- zIndex?: number | null;
+ defaultUIDisabled?: boolean | 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}. 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}.
- * Note: Usage as a Web Component (e.g. usage as an
- * HTMLElement subclass, or via HTML) is not yet supported.
+ * Specifies how gesture events should be handled on the map element.
*
- * 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
- {
- /**
- * 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}. 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}.
- * Note: Usage as a Web Component (e.g. usage as an
- * HTMLElement subclass, or via HTML) is not yet supported.
- *
- * Access by calling `const {PinElement} = await
- * google.maps.importLibrary("marker")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {GestureHandling} = await google.maps.importLibrary("maps3d");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export enum GestureHandling {
+ /**
+ * 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.
*/
- constructor(options?: google.maps.marker.PinElementOptions);
+ AUTO = 'AUTO',
/**
- * See {@link google.maps.marker.PinElementOptions.background}.
+ * This forces cooperative mode, where modifier keys or two-finger gestures are required to scroll the map.
*/
- background?: string | null;
+ COOPERATIVE = 'COOPERATIVE',
/**
- * See {@link google.maps.marker.PinElementOptions.borderColor}.
+ * This forces greedy mode, where the host page cannot be scrolled from user events on the map element.
*/
- borderColor?: string | 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 {
/**
- * This field is read-only. The DOM Element backing the view.
+ *
+ * @param options
*/
- element: HTMLElement;
+ constructor(options?: google.maps.maps3d.Map3DElementOptions);
/**
- * See {@link google.maps.marker.PinElementOptions.glyph}.
+ * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
+ * The animation to use for automatic camera fitting.
+ * @defaultValue none
*/
- glyph?: string | Element | URL | null;
+ get autofitsCameraAnimation(): google.maps.maps3d.AutofitsCameraAnimationString | null;
/**
- * See {@link google.maps.marker.PinElementOptions.glyphColor}.
+ * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
+ * The animation to use for automatic camera fitting.
+ * @defaultValue none
*/
- glyphColor?: string | null;
+ set autofitsCameraAnimation(value: google.maps.maps3d.AutofitsCameraAnimationString | null | undefined);
/**
- * See {@link google.maps.marker.PinElementOptions.scale}.
+ * 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.
*/
- scale?: number | null;
- }
- /**
- * Options for creating a {@link google.maps.marker.PinElement}.
- */
- export interface PinElementOptions {
+ get bounds(): google.maps.LatLngBounds | null;
/**
- * The background color of the pin shape. Supports any CSS color
- * value.
+ * 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.
*/
- background?: string | null;
+ set bounds(value: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | null | undefined);
/**
- * The border color of the pin shape. Supports any CSS color
- * value.
+ * 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.
*/
- borderColor?: string | null;
+ get cameraPosition(): google.maps.LatLngAltitude | null;
/**
- * The DOM element displayed in the pin.
+ * 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.
*/
- glyph?: string | Element | URL | null;
+ set cameraPosition(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined);
/**
- * The color of the glyph. Supports any CSS color
- * value.
+ * 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).
*/
- glyphColor?: string | null;
+ get center(): google.maps.LatLngAltitude | null;
/**
- * The scale of the pin.
- * @defaultValue 1
+ * 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).
*/
- scale?: number | null;
- }
-}
-declare namespace google.maps.places {
- /**
- * Access by calling `const {AccessibilityOptions} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class AccessibilityOptions {
+ set center(value: google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.LatLngLiteral | null | undefined);
/**
- * Whether a place has a wheelchair accessible entrance. Returns
- * 'true' or 'false' if the value is known. Returns
- * 'null' if the value is unknown.
+ * When true, all default UI buttons are hidden.
+ * @defaultValue false
*/
- hasWheelchairAccessibleEntrance: boolean | null;
+ get defaultUIHidden(): boolean;
/**
- * Whether a place has wheelchair accessible parking. Returns 'true'
- * or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * When true, all default UI buttons are hidden.
+ * @defaultValue false
*/
- hasWheelchairAccessibleParking: boolean | null;
+ set defaultUIHidden(value: boolean | null | undefined);
/**
- * Whether a place has a wheelchair accessible restroom. Returns
- * 'true' or 'false' if the value is known. Returns
- * 'null' if the value is unknown.
+ * If provided, an accessibility description (e.g. for use with screen readers) will be added to the map with the provided value.
*/
- hasWheelchairAccessibleRestroom: boolean | null;
+ get description(): 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.
+ * If provided, an accessibility description (e.g. for use with screen readers) will be added to the map with the provided value.
*/
- hasWheelchairAccessibleSeating: boolean | null;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- *
- * Access by calling `const {AddressComponent} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class AddressComponent {
+ set description(value: string | null | undefined);
/**
- * The full text of the address component.
+ * 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.
*/
- longText: string | null;
+ get fov(): number | null;
/**
- * The abbreviated, short text of the given address component.
+ * 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.
*/
- shortText: string | null;
+ set fov(value: number | null | undefined);
/**
- * An array of strings denoting the type of this address component. A list
- * of valid types can be found here.
+ * 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}
*/
- types: string[];
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- *
- * Access by calling `const {Attribution} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class Attribution {
+ get gestureHandling(): google.maps.maps3d.GestureHandlingString;
/**
- * Attribution text to be displayed for this Place result.
+ * 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}
*/
- provider: string | null;
- providerURI: string | null;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- *
- * Access by calling `const {AuthorAttribution} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class AuthorAttribution {
+ set gestureHandling(value: google.maps.maps3d.GestureHandlingString | null | undefined);
/**
- * Author's name for this result.
+ * 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.
*/
- displayName: string;
+ get heading(): number | null;
/**
- * Author's photo URI for this result. This may not always be available.
+ * 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.
*/
- photoURI: string | null;
+ set heading(value: number | null | undefined);
/**
- * Author's profile URI for this result.
+ * 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.
*/
- uri: string | null;
- }
- /**
- * 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.
- */
- export class Autocomplete extends google.maps.MVCObject {
+ get internalUsageAttributionIds(): string[] | null;
/**
- * 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.
- * @param inputField The <input> text field to which the
- * Autocomplete should be attached.
- * @param opts Options.
+ * 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.
*/
- constructor(
- inputField: HTMLInputElement,
- opts?: google.maps.places.AutocompleteOptions | null,
- );
+ set internalUsageAttributionIds(value: Iterablename property set to the current value of the input field.
+ * Specifies a map ID which will be used to fetch cloud-based map style for the map.
*/
- getPlace(): google.maps.places.PlaceResult;
+ get mapId(): string | null;
/**
- * Sets the preferred area within which to return Place results. Results are
- * biased towards, but not restricted to, this area.
- * @param bounds The biasing bounds.
+ * Specifies a map ID which will be used to fetch cloud-based map style for the map.
*/
- setBounds(
- bounds:
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | undefined,
- ): void;
+ set mapId(value: string | null | undefined);
/**
- * Sets the component restrictions. Component restrictions are used to
- * restrict predictions to only those within the parent component. For
- * example, the country.
- * @param restrictions The restrictions to use.
+ * 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).
*/
- setComponentRestrictions(
- restrictions: google.maps.places.ComponentRestrictions | null,
- ): void;
+ get maxAltitude(): number | 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}.
+ * 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).
*/
- setFields(fields: string[] | undefined): void;
- setOptions(options: google.maps.places.AutocompleteOptions | null): void;
+ set maxAltitude(value: number | null | undefined);
/**
- * 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.
- * @param types The types of predictions to be included.
+ * 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].
*/
- setTypes(types: string[] | null): void;
- }
- /**
- * The options that can be set on an Autocomplete object.
- */
- export interface AutocompleteOptions {
+ get maxHeading(): number | null;
/**
- * The area in which to search for places.
+ * 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].
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
+ set maxHeading(value: number | null | undefined);
/**
- * The component restrictions. Component restrictions are used to restrict
- * predictions to only those within the parent component. For example, the
- * country.
+ * The maximum angle of incidence of the map. A valid value is between 0 and 90 degrees.
*/
- componentRestrictions?: google.maps.places.ComponentRestrictions;
+ get maxTilt(): number | 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'].
+ * The maximum angle of incidence of the map. A valid value is between 0 and 90 degrees.
*/
- fields?: string[];
+ set maxTilt(value: number | null | undefined);
+ /**
+ * 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 minAltitude(): number | null;
+ /**
+ * 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).
+ */
+ set minAltitude(value: number | null | undefined);
/**
- * 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 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].
*/
- placeIdOnly?: boolean;
+ get minHeading(): number | 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.
+ * 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].
*/
- strictBounds?: boolean;
+ set minHeading(value: number | null | undefined);
/**
- * 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 minimum angle of incidence of the map. A valid value is between 0 and 90 degrees.
*/
- types?: string[];
- }
- /**
- * Represents a single autocomplete prediction.
- */
- export interface AutocompletePrediction {
+ get minTilt(): number | null;
/**
- * This is the unformatted version of the query suggested by the Places
- * service.
+ * The minimum angle of incidence of the map. A valid value is between 0 and 90 degrees.
*/
- description: string;
+ set minTilt(value: number | null | undefined);
/**
- * The distance in meters of the place from the {@link
- * google.maps.places.AutocompletionRequest.origin}.
+ * Specifies a mode the map should be rendered in. If not set, the map won't be rendered.
*/
- distance_meters?: number;
+ get mode(): google.maps.maps3d.MapModeString | 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.
+ * Specifies a mode the map should be rendered in. If not set, the map won't be rendered.
*/
- matched_substrings: google.maps.places.PredictionSubstring[];
+ set mode(value: google.maps.maps3d.MapModeString | null | undefined);
/**
- * 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}).
+ * The distance from camera to the center of the map, in meters.
*/
- place_id: string;
+ get range(): number | 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.
+ * The distance from camera to the center of the map, in meters.
*/
- structured_formatting: google.maps.places.StructuredFormatting;
+ set range(value: number | null | undefined);
/**
- * Information about individual terms in the above description, from most to
- * least specific. For example, "Taco Bell", "Willitis",
- * and "CA".
+ * 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.
*/
- terms: google.maps.places.PredictionTerm[];
+ get region(): string | null;
/**
- * An array of types that the prediction belongs to, for example
- * 'establishment' or 'geocode'.
+ * 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.
*/
- types: string[];
- }
- /**
- * Request interface for {@link
- * google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions}.
- */
- export interface AutocompleteRequest {
+ set region(value: string | null | undefined);
/**
- * 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.
+ * 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.
*/
- includedPrimaryTypes?: string[];
+ get roll(): number | 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.
+ * 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.
*/
- includedRegionCodes?: string[];
+ set roll(value: number | null | undefined);
/**
- * The text string on which to search.
+ * 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.
*/
- input: string;
+ get tilt(): number | null;
/**
- * 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.
+ * 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.
*/
- inputOffset?: number;
+ set tilt(value: number | null | undefined);
/**
- * 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.
+ * 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.
*/
- language?: string;
+ defaultUIDisabled?: boolean | null;
/**
- * 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.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string;
- /**
- * 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.LatLngBounds
- | google.maps.LatLngBoundsLiteral;
- /**
- * 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.
+ * 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.
*/
- origin?: google.maps.LatLng | google.maps.LatLngLiteral;
+ flyCameraAround(options: google.maps.maps3d.FlyAroundAnimationOptions): void;
/**
- * 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.
+ * 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.
*/
- region?: string;
+ flyCameraTo(options: google.maps.maps3d.FlyToAnimationOptions): void;
/**
- * 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).
We recommend the following guidelines:
- *
+ * 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.
*/
- sessionToken?: google.maps.places.AutocompleteSessionToken;
+ stopCameraAnimation(): void;
+ addEventListenerbounds. 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.
+ *
+ * @param options
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
+ constructor(options?: google.maps.maps3d.PopoverElementOptions);
/**
- * The component restrictions. Component restrictions are used to restrict
- * predictions to only those within the parent component. For example, the
- * country.
+ * Specifies how the altitude component of the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- componentRestrictions?: google.maps.places.ComponentRestrictions;
+ get altitudeMode(): google.maps.maps3d.AltitudeModeString;
/**
- * The user entered input string.
+ * Specifies how the altitude component of the position is interpreted.
+ * @defaultValue {@link google.maps.maps3d.AltitudeMode.CLAMP_TO_GROUND}
*/
- input: string;
+ set altitudeMode(value: google.maps.maps3d.AltitudeModeString | null | undefined);
/**
- * 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.
+ * If set to true, disables panning the map to make the popover fully visible when it opens.
+ * @defaultValue false
*/
- language?: string | null;
+ get autoPanDisabled(): boolean;
/**
- * 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.
+ * If set to true, disables panning the map to make the popover fully visible when it opens.
+ * @defaultValue false
*/
- location?: google.maps.LatLng;
+ set autoPanDisabled(value: boolean | null | undefined);
/**
- * A soft boundary or hint to use when searching for places.
+ * 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
*/
- locationBias?:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string
- | null;
+ get lightDismissDisabled(): boolean;
/**
- * Bounds to constrain search results.
+ * 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
*/
- locationRestriction?:
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | null;
+ set lightDismissDisabled(value: boolean | null | undefined);
/**
- * The character position in the input term at which the service uses text
- * for predictions (the position of the cursor in the input field).
+ * Specifies whether this popover should be open or not.
+ * @defaultValue false
*/
- offset?: number;
+ get open(): boolean;
/**
- * The location where {@link
- * google.maps.places.AutocompletePrediction.distance_meters} is calculated
- * from.
+ * Specifies whether this popover should be open or not.
+ * @defaultValue false
*/
- origin?: google.maps.LatLng | google.maps.LatLngLiteral;
+ set open(value: boolean | null | undefined);
/**
- * 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 position at which to display this popover. If the popover is anchored to an interactive marker, the marker's position will be used instead.
*/
- radius?: number;
+ get positionAnchor(): google.maps.LatLngAltitude | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | 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 position at which to display this popover. If the popover is anchored to an interactive marker, the marker's position will be used instead.
*/
- region?: string | null;
+ set positionAnchor(value: google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.maps3d.Marker3DInteractiveElement | google.maps.maps3d.MarkerInteractiveElement | string | null | undefined);
+ addEventListener'OPERATIONAL' or
- * google.maps.places.BusinessStatus.OPERATIONAL).
- *
- * Access by calling `const {BusinessStatus} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 enum BusinessStatus {
+ export class SpeedReadingInterval {
/**
- * The business is closed permanently.
+ * The ending index of this interval in the polyline.
*/
- CLOSED_PERMANENTLY = 'CLOSED_PERMANENTLY',
+ get endPolylinePointIndex(): number | null | undefined;
/**
- * The business is closed temporarily.
+ * Traffic speed in this interval.
*/
- CLOSED_TEMPORARILY = 'CLOSED_TEMPORARILY',
+ get speed(): google.maps.routes.SpeedString | null | undefined;
/**
- * The business is operating normally.
+ * The starting index of this interval in the polyline.
*/
- OPERATIONAL = 'OPERATIONAL',
+ get startPolylinePointIndex(): number | null | undefined;
}
/**
- * Defines the component restrictions that can be used with the autocomplete
- * service.
+ * 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 interface ComponentRestrictions {
+ export class TollInfo {
/**
- * 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.
+ * 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.
*/
- country: string | string[] | null;
+ get estimatedPrices(): google.maps.places.Money[] | null | undefined;
+ toJSON(key?: string): unknown;
}
/**
- * EV charging information, aggregated for connectors of the same type and the
- * same charge rate.
+ * Extra computations to perform for a {@link google.maps.routes.RouteMatrix.computeRouteMatrix} request.
*
- * Access by calling `const {ConnectorAggregation} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {ComputeRouteMatrixExtraComputation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class ConnectorAggregation {
- /**
- * The time when the connector availability information in this aggregation
- * was last updated.
- */
- availabilityLastUpdateTime: Date | null;
+ export enum ComputeRouteMatrixExtraComputation {
/**
- * Number of connectors in this aggregation that are currently available.
+ * Toll information for the matrix item(s).
*/
- availableCount: number | null;
+ TOLLS = 'TOLLS',
+ }
+ export type ComputeRouteMatrixExtraComputationString = `${google.maps.routes.ComputeRouteMatrixExtraComputation}`;
+ /**
+ * A set of values describing the vehicle's emission type. Applies only to the DRIVING travel mode.
+ *
+ * Access by calling `const {VehicleEmissionType} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export enum VehicleEmissionType {
/**
- * Number of connectors in this aggregation.
+ * Diesel fueled vehicle.
*/
- count: number;
+ DIESEL = 'DIESEL',
/**
- * The static max charging rate in kw of each connector of the aggregation.
+ * Electricity powered vehicle.
*/
- maxChargeRateKw: number;
+ ELECTRIC = 'ELECTRIC',
/**
- * Number of connectors in this aggregation that are currently out of
- * service.
+ * Gasoline/petrol fueled vehicle.
*/
- outOfServiceCount: number | null;
+ GASOLINE = 'GASOLINE',
/**
- * The connector type of this aggregation.
+ * Hybrid fuel (such as gasoline + electric) vehicle.
*/
- type: google.maps.places.EVConnectorType | null;
+ HYBRID = 'HYBRID',
}
+ export type VehicleEmissionTypeString = `${google.maps.routes.VehicleEmissionType}`;
/**
- * 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.
+ * Contains the vehicle information, such as the vehicle emission type.
*/
- export class EVChargeOptions {
- /**
- * A list of EV charging connector aggregations that contain connectors of
- * the same type and same charge rate.
- */
- connectorAggregations: google.maps.places.ConnectorAggregation[];
+ export interface VehicleInfo {
/**
- * 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.
+ * Describes the vehicle's emission type. Applies only to the DRIVING travel mode.
*/
- connectorCount: number;
+ emissionType?: google.maps.routes.VehicleEmissionTypeString | null;
}
/**
- * EV charging connector types.
- *
- * Access by calling `const {EVConnectorType} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Encapsulates a set of optional conditions to satisfy when calculating routes.
*/
- export enum EVConnectorType {
+ export interface RouteModifiers {
/**
- * Combined Charging System (AC and DC). Based on SAE Type-1 J-1772
- * connector.
+ * 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}.
*/
- CCS_COMBO_1 = 'CCS_COMBO_1',
+ avoidFerries?: boolean | null;
/**
- * Combined Charging System (AC and DC). Based on Type-2 Mennekes connector.
+ * 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}.
*/
- CCS_COMBO_2 = 'CCS_COMBO_2',
+ avoidHighways?: boolean | null;
/**
- * CHAdeMO type connector.
+ * 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}.
*/
- CHADEMO = 'CHADEMO',
+ avoidIndoor?: boolean | null;
/**
- * J1772 type 1 connector.
+ * 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}.
*/
- J1772 = 'J1772',
+ avoidTolls?: boolean | null;
/**
- * Other connector types.
+ * 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.
*/
- OTHER = 'OTHER',
+ tollPasses?: IterableTRAFFIC_AWARE_OPTIMAL, some optimizations are applied to significantly reduce latency.
*/
- TYPE_2 = 'TYPE_2',
+ TRAFFIC_AWARE = 'TRAFFIC_AWARE',
/**
- * GB/T type corresponds to the GB/T standard in China. This type covers all
- * GB_T types.
+ * Calculates the routes taking live traffic conditions into consideration, without applying most performance optimizations. Using this value produces the highest latency.
*/
- UNSPECIFIED_GB_T = 'UNSPECIFIED_GB_T',
+ TRAFFIC_AWARE_OPTIMAL = 'TRAFFIC_AWARE_OPTIMAL',
/**
- * Unspecified wall outlet.
+ * Computes routes without taking live traffic conditions into consideration. Suitable when traffic conditions don't matter or are not applicable. Using this value produces the lowest latency.
*/
- UNSPECIFIED_WALL_OUTLET = 'UNSPECIFIED_WALL_OUTLET',
+ TRAFFIC_UNAWARE = 'TRAFFIC_UNAWARE',
}
+ export type RoutingPreferenceString = `${google.maps.routes.RoutingPreference}`;
/**
- * EV-related options that can be specified for a place search request.
+ * Preferences for TRANSIT based routes that influence the route that is returned.
*/
- export interface EVSearchOptions {
+ export interface TransitPreference {
/**
- * The list of preferred EV connector types. A place that does not support
- * any of the listed connector types is filtered out.
+ * A set of travel modes to use when getting a TRANSIT route. Defaults to all supported modes of travel.
*/
- connectorTypes?: google.maps.places.EVConnectorType[];
+ allowedTransitModes?: IterableTRANSIT route returned.
*/
- minimumChargingRateKw?: number;
+ routingPreference?: google.maps.TransitRoutePreferenceString;
}
/**
- * Options for fetching Place fields.
+ * 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 interface FetchFieldsRequest {
+ export interface DirectionalLocationLiteral extends google.maps.LatLngAltitudeLiteral {
/**
- * List of fields to be fetched.
+ * 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}.
*/
- fields: string[];
+ heading?: number | null;
}
/**
- * A find place from text search request to be sent to {@link
- * google.maps.places.PlacesService.findPlaceFromPhoneNumber}.
+ * 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 interface FindPlaceFromPhoneNumberRequest {
+ export class DirectionalLocation extends google.maps.LatLngAltitude implements google.maps.routes.DirectionalLocationLiteral {
/**
- * 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").
+ * 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}.
*/
- fields: string[];
+ get heading(): number | null | undefined;
/**
- * A language identifier for the language in which names and addresses
- * should be returned, when possible. See the list of
- * supported languages.
+ * Converts to a plain object.
*/
- language?: string | null;
+ toJSON(key?: string): google.maps.LatLngAltitudeLiteral;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * Represents a waypoint in a route.
+ */
+ export interface Waypoint {
/**
- * 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 location of the waypoint. A string may be an address, a plus code, or a Place resource name.
*/
- locationBias?:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string;
+ location: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place;
/**
- * The phone number of the place to look up. Format must be E.164.
+ * 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}
*/
- phoneNumber: string;
+ sideOfRoad?: boolean | null;
+ /**
+ * 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}.
+ */
+ vehicleStopover?: boolean | null;
+ /**
+ * 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:
+ */
+ via?: boolean | null;
}
/**
- * A find place from text search request to be sent to {@link
- * google.maps.places.PlacesService.findPlaceFromQuery}.
+ * Request for a route matrix.
*/
- export interface FindPlaceFromQueryRequest {
+ export interface ComputeRouteMatrixRequest {
/**
- * Fields to be included in the response, which
- * will be billed for. If true, this field cannot be set to true; otherwise, the request fails. ['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 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.
*/
- fields: string[];
+ arrivalTime?: Date;
/**
- * A language identifier for the language in which names and addresses
- * should be returned, when possible. See the list of
- * supported languages.
+ * 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.
*/
- language?: string | null;
+ departureTime?: Date;
/**
- * The bias used when searching for Place. The result will be biased
- * towards, but not restricted to, the given {@link
- * google.maps.places.LocationBias}.
+ * 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.
*/
- locationBias?:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string;
+ destinations: Iterable
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.
*/
- query: string;
- }
- /**
- * 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 FormattableText {
+ extraComputations?: Iterabletext. 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.
+ * Collection of fields to be fetched. Specify ["*"] for all fields.
*/
- matches: google.maps.places.StringRange[];
+ fields: Iterable
Several size restrictions apply to the cardinality of origins and destinations:
+ */
+ origins: Iterablestrings or {@link google.maps.places.Place}s must be no greater than 50. TRAFFIC_AWARE_OPTIMAL. TRANSIT. DRIVING or TWO_WHEELER, otherwise the request fails.
+ */
+ routingPreference?: google.maps.routes.RoutingPreferenceString;
/**
- * A list of fuel prices for each type of fuel this station has, one entry
- * per fuel type.
+ * 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.
*/
- fuelPrices: google.maps.places.FuelPrice[];
+ trafficModel?: google.maps.TrafficModelString;
+ /**
+ * 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.
+ */
+ transitPreference?: google.maps.routes.TransitPreference;
+ /**
+ * Specifies the mode of transportation.
+ */
+ travelMode?: google.maps.TravelModeString;
+ /**
+ * 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.
+ */
+ units?: google.maps.UnitSystem;
}
/**
- * Fuel price information for a given type of fuel.
+ * Extra computations to perform for a {@link google.maps.routes.Route.computeRoutes} request.
*
- * Access by calling `const {FuelPrice} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {ComputeRoutesExtraComputation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class FuelPrice {
+ export enum ComputeRoutesExtraComputation {
/**
- * The price of the fuel.
+ * Flyover information for the route(s). The "polylineDetails" field must be specified in {@link google.maps.routes.ComputeRoutesRequest.fields} to return this information. This data will only currently be populated for certain metros in India. This feature is experimental, and the SKU/charge is subject to change.
*/
- price: google.maps.places.Money | null;
+ FLYOVER_INFO_ON_POLYLINE = 'FLYOVER_INFO_ON_POLYLINE',
/**
- * The type of fuel.
+ * Estimated fuel consumption for the route(s).
*/
- type: google.maps.places.FuelType | null;
+ FUEL_CONSUMPTION = 'FUEL_CONSUMPTION',
/**
- * The time the fuel price was last updated.
+ * Navigation instructions presented as a formatted HTML text string. This content is meant to be read as-is and is for display only. Do not programmatically parse it.
+ */
+ HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 'HTML_FORMATTED_NAVIGATION_INSTRUCTIONS',
+ /**
+ * Narrow road information for the route(s). The "polylineDetails" field must be specified in {@link google.maps.routes.ComputeRoutesRequest.fields} to return this information. This data will only currently be populated for certain metros in India. This feature is experimental, and the SKU/charge is subject to change.
+ */
+ NARROW_ROAD_INFO_ON_POLYLINE = 'NARROW_ROAD_INFO_ON_POLYLINE',
+ /**
+ * Toll information for the route(s).
+ */
+ TOLLS = 'TOLLS',
+ /**
+ * Traffic aware polylines for the route(s).
*/
- updateTime: Date | null;
+ TRAFFIC_ON_POLYLINE = 'TRAFFIC_ON_POLYLINE',
}
+ export type ComputeRoutesExtraComputationString = `${google.maps.routes.ComputeRoutesExtraComputation}`;
/**
- * Types of fuel.
+ * Specifies the quality of the polyline.
*
- * Access by calling `const {FuelType} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {PolylineQuality} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export enum FuelType {
- /**
- * Bio-diesel.
- */
- BIO_DIESEL = 'BIO_DIESEL',
+ export enum PolylineQuality {
/**
- * Diesel fuel.
+ * Specifies a high-quality polyline that is composed using more points than OVERVIEW at the cost of increased response size. Use this value when you need more precision.
*/
- DIESEL = 'DIESEL',
+ HIGH_QUALITY = 'HIGH_QUALITY',
/**
- * E 80.
+ * Specifies an overview polyline that is composed using a small number of points. Using this option has a lower request latency compared to HIGH_QUALITY. Use this value when displaying an overview of the route.
*/
- E80 = 'E80',
+ OVERVIEW = 'OVERVIEW',
+ }
+ export type PolylineQualityString = `${google.maps.routes.PolylineQuality}`;
+ /**
+ * A supported reference route on a {@link google.maps.routes.ComputeRoutesRequest}.
+ *
+ * Access by calling `const {ReferenceRoute} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export enum ReferenceRoute {
/**
- * E 85.
+ * Fuel efficient route.
*/
- E85 = 'E85',
+ FUEL_EFFICIENT = 'FUEL_EFFICIENT',
/**
- * LPG.
+ * Route with shorter travel distance.
*/
- LPG = 'LPG',
+ SHORTER_DISTANCE = 'SHORTER_DISTANCE',
+ }
+ export type ReferenceRouteString = `${google.maps.routes.ReferenceRoute}`;
+ /**
+ * Request for routes.
+ */
+ export interface ComputeRoutesRequest {
/**
- * Methane.
+ * 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.
*/
- METHANE = 'METHANE',
+ arrivalTime?: Date;
/**
- * Midgrade.
+ * Specifies whether to calculate alternate routes in addition to the route. No alternative routes are returned for requests that have intermediate waypoints.
*/
- MIDGRADE = 'MIDGRADE',
+ computeAlternativeRoutes?: boolean;
/**
- * Premium.
+ * 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.
*/
- PREMIUM = 'PREMIUM',
+ departureTime?: Date;
/**
- * Regular unleaded.
+ * 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.
*/
- REGULAR_UNLEADED = 'REGULAR_UNLEADED',
+ destination: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint;
/**
- * SP 100.
+ * 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.
*/
- SP100 = 'SP100',
+ extraComputations?: Iterable["*"] for all fields.
*/
- SP91 = 'SP91',
+ fields: Iterable"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.
*/
- SP95 = 'SP95',
+ optimizeWaypointOrder?: boolean;
/**
- * SP95 E10.
+ * 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.
*/
- SP95_E10 = 'SP95_E10',
+ origin: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint;
/**
- * SP 98.
+ * Specifies the preference for the quality of the polyline.
*/
- SP98 = 'SP98',
+ polylineQuality?: google.maps.routes.PolylineQualityString;
/**
- * SP 99.
+ * 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.
*/
- SP99 = 'SP99',
+ region?: string;
/**
- * Truck diesel.
+ * 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.
*/
- TRUCK_DIESEL = 'TRUCK_DIESEL',
- }
- export type LocationBias =
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string;
- export type LocationRestriction =
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral;
- /**
- * 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 {
+ requestedReferenceRoutes?: IterableDRIVING or TWO_WHEELER, otherwise the request fails.
*/
- nanos: number;
+ routingPreference?: google.maps.routes.RoutingPreferenceString;
/**
- * Returns a human-readable representation of the amount of money with its
- * currency symbol.
+ * 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.
*/
- toString(): string;
+ trafficModel?: google.maps.TrafficModelString;
+ /**
+ * 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.
+ */
+ transitPreference?: google.maps.routes.TransitPreference;
+ /**
+ * Specifies the mode of transportation.
+ */
+ travelMode?: google.maps.TravelModeString;
/**
- * The whole units of the amount. For example, if {@link
- * google.maps.places.Money.currencyCode} is "USD", then 1 unit is
- * 1 US dollar.
+ * 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.
*/
- units: number;
+ units?: google.maps.UnitSystem;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
+ * 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 class RouteMatrixItemError extends Error {
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * The reason that a fallback response was returned in a {@link google.maps.routes.Route.computeRoutes} response.
*
- * Access by calling `const {OpeningHours} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {FallbackReason} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class OpeningHours {
+ export enum FallbackReason {
/**
- * Opening periods covering each day of the week, starting from Sunday, in
- * chronological order. Does not include days where the Place is not open.
+ * 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.
*/
- periods: google.maps.places.OpeningHoursPeriod[];
+ LATENCY_EXCEEDED = 'LATENCY_EXCEEDED',
/**
- * 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.
+ * 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.
*/
- weekdayDescriptions: string[];
+ SERVER_ERROR = 'SERVER_ERROR',
}
+ export type FallbackReasonString = `${google.maps.routes.FallbackReason}`;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * The actual routing mode used when a fallback response is returned in a {@link google.maps.routes.Route.computeRoutes} response.
*
- *
- * Access by calling `const {OpeningHoursPeriod} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {FallbackRoutingMode} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class OpeningHoursPeriod {
+ export enum FallbackRoutingMode {
/**
- * The closing time for the Place.
+ * Indicates the TRAFFIC_AWARE {@link google.maps.routes.RoutingPreference} was used to compute the response.
*/
- close: google.maps.places.OpeningHoursPoint | null;
+ TRAFFIC_AWARE = 'TRAFFIC_AWARE',
/**
- * The opening time for the Place.
+ * Indicates the TRAFFIC_UNAWARE {@link google.maps.routes.RoutingPreference} was used to compute the response.
*/
- open: google.maps.places.OpeningHoursPoint;
+ TRAFFIC_UNAWARE = 'TRAFFIC_UNAWARE',
}
+ export type FallbackRoutingModeString = `${google.maps.routes.FallbackRoutingMode}`;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- *
- * Access by calling `const {OpeningHoursPoint} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 OpeningHoursPoint {
- /**
- * The day of the week, as a number in the range [0, 6], starting on Sunday.
- * For example, 2 means Tuesday.
- */
- day: number;
+ export class FallbackInfo {
/**
- * 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 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.
*/
- hour: number;
+ get reason(): google.maps.routes.FallbackReasonString | null | undefined;
/**
- * The minute of the OpeningHoursPoint.time as a number, in the range [0,
- * 59]. This will be reported in the Place’s time zone.
+ * Routing mode used for the response. If fallback was triggered, the mode may be different from routing preference set in the original client request.
*/
- minute: number;
+ get routingMode(): google.maps.routes.FallbackRoutingModeString | null | undefined;
+ toJSON(key?: string): unknown;
}
/**
- * Access by calling `const {ParkingOptions} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 ParkingOptions {
+ export class GeocodedWaypoint {
+ /**
+ * Indicates the status code resulting from the geocoding operation.
+ */
+ get geocoderStatus(): google.maps.RPCStatusString | null;
/**
- * Whether a place offers free garage parking. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * The index of the corresponding intermediate waypoint in the request. Only populated if the corresponding waypoint is an intermediate waypoint.
*/
- hasFreeGarageParking: boolean | null;
+ get intermediateWaypointRequestIndex(): number | null;
/**
- * Whether a place offers free parking lots. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * 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.
*/
- hasFreeParkingLot: boolean | null;
+ get partialMatch(): boolean;
/**
- * Whether a place offers free street parking. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * The place ID for this result.
*/
- hasFreeStreetParking: boolean | null;
+ get placeId(): string;
/**
- * Whether a place offers paid garage parking. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * 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.
*/
- hasPaidGarageParking: boolean | null;
+ get types(): string[];
+ 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 {
/**
- * Whether a place offers paid parking lots. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * The geocoded waypoint for the destination.
*/
- hasPaidParkingLot: boolean | null;
+ get destination(): google.maps.routes.GeocodedWaypoint | null | undefined;
/**
- * Whether a place offers paid street parking. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * 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.
*/
- hasPaidStreetParking: boolean | null;
+ get intermediates(): google.maps.routes.GeocodedWaypoint[] | undefined;
/**
- * Whether a place offers valet parking. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * The geocoded waypoint for the origin.
*/
- hasValetParking: boolean | null;
+ get origin(): google.maps.routes.GeocodedWaypoint | null | undefined;
+ toJSON(key?: string): unknown;
}
/**
- * Access by calling `const {PaymentOptions} = await
- * google.maps.importLibrary("places")`. 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 PaymentOptions {
+ export class MultiModalSegment {
/**
- * Whether a place only accepts payment via cash. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * Instructions for navigating this multi-modal segment.
*/
- acceptsCashOnly: boolean | null;
+ get instructions(): string | null;
/**
- * Whether a place accepts payment via credit card. Returns 'true'
- * or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * The navigation maneuver to perform at this step. See Maneuver for a list of possible values.
*/
- acceptsCreditCards: boolean | null;
+ get maneuver(): string | 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.
+ * The corresponding {@link google.maps.routes.RouteLegStep} index that is the end of a multi-modal segment.
*/
- acceptsDebitCards: boolean | null;
+ get stepEndIndex(): number;
/**
- * Whether a place accepts payment via NFC. Returns 'true' or
- * 'false' if the value is known. Returns 'null' if the
- * value is unknown.
+ * The corresponding {@link google.maps.routes.RouteLegStep} index that is the start of a multi-modal segment.
*/
- acceptsNFC: boolean | null;
+ get stepStartIndex(): number;
+ /**
+ * The travel mode used for this multi-modal segment.
+ */
+ get travelMode(): google.maps.TravelModeString | null;
+ toJSON(key?: string): unknown;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
+ * Encapsulates the states of road features along a stretch of polyline.
*
- * Access by calling `const {Photo} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Access by calling `const {RoadFeatureState} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class Photo {
+ export enum RoadFeatureState {
/**
- * Attribution text to be displayed for this photo.
+ * The road feature does not exist.
*/
- authorAttributions: google.maps.places.AuthorAttribution[];
+ DOES_NOT_EXIST = 'DOES_NOT_EXIST',
/**
- * Returns the image URL corresponding to the specified options.
+ * The road feature exists.
*/
- getURI(options?: google.maps.places.PhotoOptions): string;
+ 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 {
/**
- * The height of the photo in pixels.
+ * The end index of this road feature in the polyline.
*/
- heightPx: number;
+ get endIndex(): number | null;
/**
- * The width of the photo in pixels.
+ * Denotes whether the road feature exists along the polyline.
+ */
+ get presence(): google.maps.routes.RoadFeatureStateString | null;
+ /**
+ * The start index of this road feature in the polyline.
*/
- widthPx: number;
+ get startIndex(): number | null;
+ toJSON(key?: string): unknown;
}
/**
- * Defines photo-requesting options.
+ * 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 interface PhotoOptions {
+ export class PolylineDetails {
/**
- * The maximum height in pixels of the returned image.
+ * Flyover details along the polyline.
*/
- maxHeight?: number | null;
+ get flyoverInfo(): google.maps.routes.PolylineDetailInfo[];
/**
- * The maximum width in pixels of the returned image.
+ * Narrow road details along the polyline.
*/
- maxWidth?: number | null;
+ get narrowRoadInfo(): google.maps.routes.PolylineDetailInfo[];
+ toJSON(key?: string): unknown;
}
/**
- * Access by calling `const {Place} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Labels for the route that are useful to identify specific properties to compare against others.
+ *
+ * Access by calling `const {RouteLabel} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class Place {
+ export enum RouteLabel {
/**
- * Access by calling `const {Place} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * The default "best" route returned for the route computation.
*/
- constructor(options: google.maps.places.PlaceOptions);
+ DEFAULT_ROUTE = 'DEFAULT_ROUTE',
/**
- * Accessibility options of this Place. undefined if the
- * accessibility options data have not been called for from the server.
+ * An alternative to the default "best" route. Routes like this will be returned when {@link google.maps.routes.ComputeRoutesRequest.computeAlternativeRoutes} is specified.
*/
- accessibilityOptions?: google.maps.places.AccessibilityOptions | null;
+ DEFAULT_ROUTE_ALTERNATE = 'DEFAULT_ROUTE_ALTERNATE',
/**
- * 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.
+ * Fuel efficient route. Routes labeled with this value are determined to be optimized for eco parameters such as fuel consumption.
*/
- addressComponents?: google.maps.places.AddressComponent[];
+ FUEL_EFFICIENT = 'FUEL_EFFICIENT',
/**
- * The representation of the Place’s address in the adr microformat.
+ * Shorter travel distance route. This is an experimental feature.
*/
- adrFormatAddress?: string | null;
- allowsDogs?: boolean | null;
+ 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 {
/**
- * Attribution text to be displayed for this Place result.
+ * Travel distance of the route leg in text form.
*/
- attributions?: google.maps.places.Attribution[];
+ get distance(): string | null;
/**
- * 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 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.
*/
- businessStatus?: google.maps.places.BusinessStatus | null;
+ get distanceLanguage(): string | null;
/**
- * The location's display name. null if there is no name.
- * undefined if the name data has not been loaded from the
- * server.
+ * Duration, represented in text form and localized to the region of the query. Takes traffic conditions into consideration.
*/
- displayName?: string | null;
+ get duration(): string | null;
/**
- * 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 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.
*/
- displayNameLanguageCode?: string | null;
+ get durationLanguage(): string | null;
/**
- * The editorial summary for this place. null if there is no
- * editorial summary. undefined if this field has not yet been
- * requested.
+ * Duration without taking traffic conditions into consideration, represented in text form.
*/
- editorialSummary?: string | null;
+ get staticDuration(): string | 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.
+ * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn".
*/
- editorialSummaryLanguageCode?: string | null;
+ get staticDurationLanguage(): string | null;
+ 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 {
/**
- * EV Charge options provided by the place. undefined if the EV
- * charge options have not been called for from the server.
+ * Travel distance of the route leg step in text form.
*/
- evChargeOptions?: google.maps.places.EVChargeOptions | null;
- fetchFields(
- options: google.maps.places.FetchFieldsRequest,
- ): Promise<{place: google.maps.places.Place}>;
+ get distance(): string | null;
/**
- * The locations’s full address.
+ * 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.
*/
- formattedAddress?: string | null;
+ get distanceLanguage(): string | null;
/**
- * Fuel options provided by the place. undefined if the fuel
- * options have not been called for from the server.
+ * Duration without taking traffic conditions into consideration, represented in text form.
*/
- fuelOptions?: google.maps.places.FuelOptions | null;
+ get staticDuration(): string | null;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- * Calculates the Date representing the next OpeningHoursTime. Returns
- * undefined if the data is insufficient to calculate the result, or this
- * place is not operational.
+ * 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.
*/
- getNextOpeningTime(date?: Date): Promise
For more information see: https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*/
- id: string;
+ get nameLanguage(): string | null;
/**
- * The Place’s phone number in international format. International format
- * includes the country code, and is prefixed with the plus (+) sign.
+ * 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.
*/
- internationalPhoneNumber?: string | null;
- isGoodForChildren?: boolean | null;
- isGoodForGroups?: boolean | null;
- isGoodForWatchingSports?: boolean | null;
+ get vehicleType(): string | null;
+ 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 {
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- * Check if the place is open at the given datetime. Resolves with
- * undefined if the known data for the location is insufficient
- * to calculate this, e.g. if the opening hours are unregistered.
- * @param date Defaults to now.
+ * The transit agency (or agencies) that operates this transit line.
*/
- isOpen(date?: Date): Promiseundefined if the
- * parking options data have not been called for from the server.
+ * The color commonly used in text on signage for this line. Represented in hexadecimal.
*/
- parkingOptions?: google.maps.places.ParkingOptions | null;
+ get textColor(): string | null;
/**
- * Payment options provided by the place. undefined if the
- * payment options data have not been called for from the server.
+ * The URL for this transit line as provided by the transit agency.
*/
- paymentOptions?: google.maps.places.PaymentOptions | null;
+ get url(): URL | null;
/**
- * Photos of this Place. The collection will contain up to ten {@link
- * google.maps.places.Photo} objects.
+ * The type of vehicle that operates on this transit line.
*/
- photos?: google.maps.places.Photo[];
- plusCode?: google.maps.places.PlusCode | null;
+ get vehicle(): google.maps.routes.TransitVehicle | null;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * 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 {
/**
- * The price level of the Place. This property can return any of the
- * following values
- *
+ * The location of the stop expressed in latitude/longitude coordinates and an optional heading.
*/
- priceLevel?: google.maps.places.PriceLevel | null;
+ get location(): google.maps.routes.DirectionalLocation | null;
/**
- * The location's primary type. FreeInexpensiveModerateExpensiveVery Expensivenull if there is no type.
- * undefined if the type data has not been loaded from the
- * server.
+ * The name of the transit stop.
*/
- primaryType?: string | null;
+ get name(): string | null;
+ 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 location's primary type display name. null if there
- * is no type. undefined if the type data has not been loaded
- * from the server.
+ * Information about the arrival stop for the step.
*/
- primaryTypeDisplayName?: string | null;
+ get arrivalStop(): google.maps.routes.TransitStop | null;
/**
- * 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.
+ * The estimated time of arrival for the step.
*/
- primaryTypeDisplayNameLanguageCode?: string | null;
+ get arrivalTime(): Date | null;
/**
- * A rating, between 1.0 to 5.0, based on user reviews of this Place.
+ * Information about the departure stop for the step.
*/
- rating?: number | null;
- regularOpeningHours?: google.maps.places.OpeningHours | null;
+ get departureStop(): google.maps.routes.TransitStop | null;
/**
- * The requested language for this place.
+ * The estimated time of departure for the step.
*/
- requestedLanguage?: string | null;
+ get departureTime(): Date | null;
/**
- * The requested region for this place.
+ * 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.
*/
- requestedRegion?: string | null;
+ get headsign(): string | null;
/**
- * A list of reviews for this Place.
+ * 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.
*/
- reviews?: google.maps.places.Review[];
+ get headwayMillis(): number | 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.
+ * 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.
*/
- servesBeer?: boolean | null;
+ get stopCount(): number;
/**
- * 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.
+ * Information about the transit line used in the step.
*/
- servesBreakfast?: boolean | null;
+ get transitLine(): google.maps.routes.TransitLine | 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.
+ * 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.
*/
- servesBrunch?: boolean | null;
- servesCocktails?: boolean | null;
- servesCoffee?: boolean | null;
- servesDessert?: boolean | null;
+ get tripShortText(): string | null;
+ 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 {
/**
- * 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.
+ * The travel distance of this step, in meters.
*/
- servesDinner?: boolean | null;
+ get distanceMeters(): number;
/**
- * 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.
+ * The end location of this step.
*/
- servesLunch?: boolean | null;
+ get endLocation(): google.maps.routes.DirectionalLocation | null;
/**
- * 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.
+ * Instructions for navigating this step.
*/
- servesVegetarianFood?: boolean | null;
+ get instructions(): 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.
+ * Text representations of properties of the RouteLegStep.
*/
- servesWine?: boolean | null;
+ get localizedValues(): google.maps.routes.RouteLegStepLocalizedValues | null;
/**
- * URI to the svg image mask resource that can be used to represent a
- * place’s category.
+ * The navigation maneuver to perform at this step. See Maneuver for a list of possible values.
*/
- svgIconMaskURI?: string | null;
- toJSON(): object;
+ get maneuver(): string | null;
/**
- * An array of types
- * for this Place (for example, ["political",
- * "locality"] or ["restaurant",
- * "establishment"]).
+ * 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.
*/
- types?: string[];
+ get path(): google.maps.LatLngAltitude[];
/**
- * The number of user ratings which contributed to this Place’s {@link
- * google.maps.places.Place.rating}.
+ * The start location of this step.
*/
- userRatingCount?: number | null;
+ get startLocation(): google.maps.routes.DirectionalLocation | 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.
+ * 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.
*/
- utcOffsetMinutes?: number | null;
+ get staticDurationMillis(): number | null;
/**
- * The preferred viewport when displaying this Place on a map.
+ * Details pertaining to this step if the travel mode is TRANSIT.
*/
- viewport?: google.maps.LatLngBounds | null;
+ get transitDetails(): google.maps.routes.TransitDetails | null;
/**
- * The authoritative website for this Place, such as a business'
- * homepage.
+ * The travel mode used for this step.
*/
- websiteURI?: string | null;
+ get travelMode(): google.maps.TravelModeString | null;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * 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 class RouteLegTravelAdvisory {
/**
- * Text query based place search.
+ * 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:
*/
- static searchByText(
- this: any,
- request: google.maps.places.SearchByTextRequest,
- ): Promise<{places: google.maps.places.Place[]}>;
+ get speedReadingIntervals(): google.maps.routes.SpeedReadingInterval[] | undefined;
/**
- * Search for nearby places.
+ * 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}.
*/
- static searchNearby(
- this: any,
- request: google.maps.places.SearchNearbyRequest,
- ): Promise<{places: google.maps.places.Place[]}>;
+ get tollInfo(): google.maps.routes.TollInfo | null;
+ toJSON(key?: string): unknown;
}
/**
- * Defines information about an aspect of the place that users have reviewed.
- * @deprecated This interface is no longer used.
+ * 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 interface PlaceAspectRating {
- /**
- * 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.
- */
- rating: number;
+ export class StepsOverview {
/**
- * The aspect type. For example, polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
speedReadingIntervals: [A,C), [C,D), [D,G) "food", "decor",
- * "service", or "overall".
+ * Summarized information about different multi-modal segments of the {@link google.maps.routes.RouteLeg.steps}.
*/
- type: string;
+ get multiModalSegments(): google.maps.routes.MultiModalSegment[];
+ toJSON(key?: string): unknown;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * PlaceAutocompleteElement is an HTMLElement subclass which
- * provides a UI component for the Places Autocomplete API.
- *
- * Access by calling `const {PlaceAutocompleteElement} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * 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 class PlaceAutocompleteElement
- extends HTMLElement
- implements google.maps.places.PlaceAutocompleteElementOptions
- {
+ export class RouteLeg {
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * PlaceAutocompleteElement is an HTMLElement subclass which
- * provides a UI component for the Places Autocomplete API.
- *
- * Access by calling `const {PlaceAutocompleteElement} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * The travel distance of the route leg, in meters.
*/
- constructor(options: google.maps.places.PlaceAutocompleteElementOptions);
+ get distanceMeters(): number;
/**
- * The component restrictions. Component restrictions are used to restrict
- * predictions to only those within the parent component. For example, the
- * country.
+ * 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.
*/
- componentRestrictions: google.maps.places.ComponentRestrictions | null;
+ get durationMillis(): number | null;
/**
- * A soft boundary or hint to use when searching for places.
+ * 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.
*/
- locationBias:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string
- | null;
+ get endLocation(): google.maps.routes.DirectionalLocation | null;
/**
- * Bounds to constrain search results.
+ * Text representations of properties of the RouteLeg.
*/
- locationRestriction:
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | null;
+ get localizedValues(): google.maps.routes.RouteLegLocalizedValues | 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.
+ * 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}.
*/
- name: string | null;
+ get path(): google.maps.LatLngAltitude[];
/**
- * 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.
+ * 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.
*/
- requestedLanguage: string | null;
+ get speedPaths(): google.maps.routes.SpeedPath[];
/**
- * 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 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.
*/
- requestedRegion: string | null;
+ 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;
/**
- * 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.
+ * Contains the additional information that the user should be informed about, such as possible traffic zone restrictions, on a route leg.
*/
- types: string[] | null;
+ get travelAdvisory(): google.maps.routes.RouteLegTravelAdvisory | null;
+ toJSON(key?: string): unknown;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Options for constructing a PlaceAutocompleteElement.
+ * 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 interface PlaceAutocompleteElementOptions {
+ export class RouteLocalizedValues {
/**
- * See {@link
- * google.maps.places.PlaceAutocompleteElement.componentRestrictions}
+ * Travel distance of the route represented in text form.
*/
- componentRestrictions?: google.maps.places.ComponentRestrictions | null;
+ get distance(): string | null;
/**
- * See {@link google.maps.places.PlaceAutocompleteElement.locationBias}
+ * 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.
*/
- locationBias?:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.Circle
- | google.maps.CircleLiteral
- | string
- | null;
+ get distanceLanguage(): string | null;
/**
- * See {@link
- * google.maps.places.PlaceAutocompleteElement.locationRestriction}
+ * 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.
*/
- locationRestriction?:
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | null;
+ get duration(): string | null;
/**
- * See {@link google.maps.places.PlaceAutocompleteElement.requestedLanguage}
+ * 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.
*/
- requestedLanguage?: string | null;
+ get durationLanguage(): string | null;
/**
- * See {@link google.maps.places.PlaceAutocompleteElement.requestedRegion}
+ * Duration without taking traffic conditions into consideration, represented in text form.
*/
- requestedRegion?: string | null;
+ get staticDuration(): string | null;
/**
- * See {@link google.maps.places.PlaceAutocompleteElement.types}
+ * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn".
*/
- types?: string[] | null;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * This event is created after the user selects a place with the Place
- * Autocomplete Element. Access the selection with event.place.
- *
- * Access by calling `const {PlaceAutocompletePlaceSelectEvent} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class PlaceAutocompletePlaceSelectEvent extends Event {
+ get staticDurationLanguage(): string | null;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * This event is created after the user selects a place with the Place
- * Autocomplete Element. Access the selection with event.place.
- *
- * Access by calling `const {PlaceAutocompletePlaceSelectEvent} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Transit fare represented in text form.
*/
- constructor();
+ get transitFare(): string | null;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
+ * The transit fare text's BCP-47 language code, such as "en-US" or "sr-Latn".
*/
- place: google.maps.places.Place;
+ get transitFareLanguage(): string | null;
+ toJSON(key?: string): unknown;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * This event is emitted by the PlaceAutocompleteElement when there is an
- * issue with the network request.
- *
- * Access by calling `const {PlaceAutocompleteRequestErrorEvent} = await
- * google.maps.importLibrary("places")`. 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.Route}.
+ * Access by calling `const {RouteTravelAdvisory} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
*/
- export class PlaceAutocompleteRequestErrorEvent extends Event {
+ export class RouteTravelAdvisory {
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * This event is emitted by the PlaceAutocompleteElement when there is an
- * issue with the network request.
- *
- * Access by calling `const {PlaceAutocompleteRequestErrorEvent} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * The predicted fuel consumption in microliters.
Note: If the fuel consumption exceeds 2^53 microliters, then this value is Number.POSITIVE_INFINITY.
*/
- constructor();
- }
- /**
- * A Place details query to be sent to the PlacesService.
- */
- export interface PlaceDetailsRequest {
+ get fuelConsumptionMicroliters(): number | undefined;
/**
- * 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").
+ * The {@link google.maps.routes.Route} may have restrictions that are not suitable for the requested travel mode or route modifiers.
*/
- fields?: string[];
+ get routeRestrictionsPartiallyIgnored(): boolean | null | undefined;
/**
- * A language identifier for the language in which details should be
- * returned. See the list of
- * supported languages.
+ * 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:
*/
- language?: string | null;
+ get speedReadingIntervals(): google.maps.routes.SpeedReadingInterval[] | undefined;
/**
- * The Place ID of the Place for which details are being requested.
+ * 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}.
*/
- placeId: string;
+ get tollInfo(): google.maps.routes.TollInfo | 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"
- * (polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
speedReadingIntervals: [A,C), [C,D), [D,G) .co.uk) while its ISO 3166-1 code is "gb"
- * (technically for the entity of "The United Kingdom of Great Britain
- * and Northern Ireland").
+ * 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.
*/
- region?: string | null;
+ get transitFare(): google.maps.places.Money | null | undefined;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * Groups together the {@link google.maps.LatLngAltitude}s of a route interval with the speed reading for the interval.
+ */
+ export interface SpeedPath {
/**
- * Unique reference used to bundle the details request with an autocomplete
- * session.
+ * The path covered by this speed path.
*/
- sessionToken?: google.maps.places.AutocompleteSessionToken;
+ path: google.maps.LatLngAltitude[];
+ /**
+ * The speed reading of the path.
+ */
+ speed?: google.maps.routes.SpeedString | null;
}
/**
- * Defines information about the geometry of a Place.
+ * A single origin for a {@link google.maps.routes.ComputeRouteMatrixRequest}.
*/
- export interface PlaceGeometry {
+ export interface RouteMatrixOrigin {
/**
- * The Place’s position.
+ * Modifiers for every route that takes this as the origin.
*/
- location?: google.maps.LatLng;
+ routeModifiers?: google.maps.routes.RouteModifiers | null;
/**
- * 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 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.
*/
- viewport?: google.maps.LatLngBounds;
+ waypoint: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitudeLiteral | google.maps.routes.DirectionalLocationLiteral | google.maps.places.Place | google.maps.routes.Waypoint;
}
/**
- * Defines information about the opening hours of a Place.
+ * 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.
*/
- export interface PlaceOpeningHours {
+ export class Route {
/**
- * 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.
+ * A description of the route.
*/
- isOpen(date?: Date): boolean | undefined;
+ get description(): string | null | undefined;
/**
- * 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
+ * The travel distance of the route, in meters.
*/
- open_now?: boolean;
+ get distanceMeters(): number | undefined;
/**
- * 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}.
+ * The length of time needed to navigate the route in milliseconds. If you set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to TRAFFIC_UNAWARE, then this value is the same as {@link google.maps.routes.Route.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.
*/
- periods?: google.maps.places.PlaceOpeningHoursPeriod[];
+ get durationMillis(): number | null | undefined;
/**
- * 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.
+ * A collection of legs (path segments between waypoints) that make up the route. Each leg corresponds to the trip between two non-via waypoints.
For example:
The order of the legs matches the order of waypoints from via intermediate waypoint has two legs. via intermediate waypoint has one leg. origin to intermediates to destination.
*/
- weekday_text?: string[];
- }
- /**
- * 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 {
+ get legs(): google.maps.routes.RouteLeg[] | undefined;
/**
- * The closing time for the Place.
+ * Text representations of properties of the {@link google.maps.routes.Route}.
*/
- close?: google.maps.places.PlaceOpeningHoursTime;
+ get localizedValues(): google.maps.routes.RouteLocalizedValues | null | undefined;
/**
- * The opening time for the Place.
+ * If you set {@link google.maps.routes.ComputeRoutesRequest.optimizeWaypointOrder} to true, this field contains the optimized ordering of intermediate waypoints. Otherwise, this field is empty. The index starts with 0 for the first intermediate waypoint provided in the input.
For example, if you give an input of:
and the optimized intermediate waypoint order is Phoenix, Dallas, Bangor, then this field will be [2, 0, 1].
*/
- open: google.maps.places.PlaceOpeningHoursTime;
- }
- /**
- * Defines when a Place opens or closes.
- */
- export interface PlaceOpeningHoursTime {
+ get optimizedIntermediateWaypointIndices(): number[] | undefined;
/**
- * The days of the week, as a number in the range [0,
- * 6], starting on Sunday. For example, 2 means
- * Tuesday.
+ * The list of {@link google.maps.LatLngAltitude}s of the route, which can be used to draw a route polyline. Granularity of the path can be controlled by setting {@link google.maps.routes.ComputeRoutesRequest.polylineQuality}.
*/
- day: number;
+ get path(): google.maps.LatLngAltitude[] | undefined;
/**
- * 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.
+ * Contains information about details along the path.
*/
- hours: number;
+ get polylineDetails(): google.maps.routes.PolylineDetails | null | undefined;
/**
- * 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.
+ * Labels for the route that are useful to identify specific properties of to compare against others.
*/
- minutes: number;
+ get routeLabels(): google.maps.routes.RouteLabelString[] | undefined;
/**
- * 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.
+ * An opaque token that can be passed to Navigation SDK to reconstruct the route during navigation, and, in the event of rerouting, honor the original intention when the route was created. Treat this token as an opaque blob. Don't compare its value across requests as its value may change even if the service returns the exact same route.
Note: routeToken is only available for requests that have set {@link google.maps.routes.ComputeRoutesRequest.routingPreference} to TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL. It is not supported for requests that have via waypoints.
*/
- nextDate?: number;
+ get routeToken(): string | null | undefined;
/**
- * 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.
+ * Groupings of sections of the route 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.
*/
- time: string;
- }
- /**
- * Options for constructing a Place.
- */
- export interface PlaceOptions {
+ get speedPaths(): google.maps.routes.SpeedPath[] | undefined;
/**
- * The unique place id.
+ * The duration of traveling through the route without taking traffic conditions into consideration.
Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY.
*/
- id: string;
+ get staticDurationMillis(): number | null | undefined;
/**
- * A language identifier for the language in which details should be
- * returned. See the list of
- * supported languages.
+ * Additional information about the route.
*/
- requestedLanguage?: string | null;
+ get travelAdvisory(): google.maps.routes.RouteTravelAdvisory | 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").
+ * The viewport bounding box of the route.
*/
- requestedRegion?: string | null;
- }
- /**
- * Represents a photo element of a Place.
- */
- export interface PlacePhoto {
+ get viewport(): google.maps.LatLngBounds | null | undefined;
/**
- * Returns the image URL corresponding to the specified options.
+ * An array of warnings to show when displaying the route.
*/
- getUrl(opts?: google.maps.places.PhotoOptions): string;
+ get warnings(): string[] | undefined;
/**
- * The height of the photo in pixels.
+ * Returns the primary route along with optional alternate routes, given a set of terminal and intermediate waypoints.
Note: This method requires that you specify a response field mask in the request by setting the {@link google.maps.routes.ComputeRoutesRequest.fields} property. The value is a list of field paths.
For example:
fields: ['*']fields: ['durationMillis', 'distanceMeters', 'path']
Use of the wildcard response field mask fields: ['*'] is discouraged because:
*/
- height: number;
+ static computeRoutes(request: google.maps.routes.ComputeRoutesRequest): Promise<{routes: (google.maps.routes.Route[] | undefined), fallbackInfo: (google.maps.routes.FallbackInfo | null), geocodingResults: (google.maps.routes.GeocodingResults | null)}>;
/**
- * Attribution text to be displayed for this photo.
+ * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
+ * Creates 3D polylines for the route based on the data available for the route.
*/
- html_attributions: string[];
+ create3DPolylines(options?: google.maps.routes.RoutePolyline3DOptions): Promise
Multi-modal polylines:
"path" and "legs" fields must be requested in {@link google.maps.routes.ComputeRoutesRequest.fields} TRANSIT.
Traffic polylines:
"path" and "travelAdvisory" fields (or just "speedPaths" as a shorthand) must be requested in {@link google.maps.routes.ComputeRoutesRequest.fields}. TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL. TRAFFIC_ON_POLYLINE.
Overall polyline:
*/
- width: number;
- }
- /**
- * 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 {
+ createPolylines(options?: google.maps.routes.RoutePolylineOptions): google.maps.Polyline[];
/**
- * 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,
- *
"path" or "legs" field must be requested in {@link google.maps.routes.ComputeRoutesRequest.fields}. "9G8F+5W Zurich, Switzerland". If no suitable locality that
- * can be found to shorten the code then this field is omitted.
+ * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel.
+ * Creates a popover for the route based on the data available for the route, configured in a way suitable for annotating a route on a map. Currently uses {@link google.maps.routes.Route.localizedValues} and {@link google.maps.routes.Route.path}, if available.
*/
- compound_code?: string;
+ createPopover(): Promise"8FVC9G8F+5W".
+ * Creates markers for the route labeled 'A', 'B', 'C', etc. for each waypoint. Markers have default styling applied. Options can be passed in to alter the marker style based on the marker index or properties of the corresponding {@link google.maps.routes.RouteLeg}. The {@link google.maps.routes.WaypointMarkerDetails.leg} parameter will be undefined if the route has no legs.
The "legs" field must be requested in {@link google.maps.routes.ComputeRoutesRequest.fields} in order for intermediate waypoints to be included.
*/
- global_code: string;
+ createWaypointAdvancedMarkers(options?: google.maps.marker.AdvancedMarkerElementOptions | ((arg0: google.maps.marker.AdvancedMarkerElementOptions, arg1: google.maps.routes.WaypointMarkerDetails) => google.maps.marker.AdvancedMarkerElementOptions)): Promiseorigin if
- * origin is specified.
+ * 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.
*/
- distanceMeters: number | null;
+ colorScheme?: google.maps.ColorSchemeString;
/**
- * Represents the name of the Place.
+ * Options for customizing the style of a 3D polyline.
*/
- mainText: google.maps.places.FormattableText | null;
+ polylineOptions?: google.maps.maps3d.Polyline3DElementOptions | ((arg0: google.maps.maps3d.Polyline3DElementOptions, arg1: google.maps.routes.RoutePolylineDetails) => google.maps.maps3d.Polyline3DElementOptions);
+ }
+ /**
+ * Options for creating route polylines.
+ */
+ export interface RoutePolylineOptions {
/**
- * The unique identifier of the suggested Place. This identifier can be used
- * in other APIs that accept Place IDs.
+ * 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.
*/
- placeId: string;
+ colorScheme?: google.maps.ColorSchemeString;
/**
- * Represents additional disambiguating features (such as a city or region)
- * to further identify the Place.
+ * 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.
*/
- secondaryText: google.maps.places.FormattableText | null;
+ polylineOptions?: google.maps.PolylineOptions | ((arg0: google.maps.PolylineOptions, arg1: google.maps.routes.RoutePolylineDetails) => google.maps.PolylineOptions);
+ }
+ /**
+ * Details about a section of a route corresponding to a polyline that can be used to customize the polyline style.
+ */
+ export interface RoutePolylineDetails {
/**
- * 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.
+ * The speed reading of the section of the route corresponding to this polyline. Only populated for routes with traffic information.
*/
- text: google.maps.places.FormattableText;
+ speed?: google.maps.routes.SpeedString | null;
/**
- * Returns a Place representation of this PlacePrediction. A subsequent call
- * to {@link google.maps.places.Place.fetchFields} is required to get full
- * Place details.
+ * The transit details of the section of the route corresponding to this polyline. Only populated for routes with transit information.
*/
- toPlace(): google.maps.places.Place;
+ transitDetails?: google.maps.routes.TransitDetails | 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 travel mode of the section of the route corresponding to this polyline. Empty for traffic polylines.
*/
- types: string[];
+ travelMode?: google.maps.TravelModeString | null;
}
/**
- * Defines information about a Place.
+ * Details about a waypoint that can be used to customize marker style.
*/
- export interface PlaceResult {
+ export interface WaypointMarkerDetails {
/**
- * The collection of address components for this Place’s location. Only
- * available with {@link google.maps.places.PlacesService.getDetails}.
+ * The index of the marker.
*/
- address_components?: google.maps.GeocoderAddressComponent[];
+ index: number;
/**
- * The representation of the Place’s address in the adr microformat. Only
- * available with {@link google.maps.places.PlacesService.getDetails}.
+ * The leg that the marker belongs to. Empty if the route has no legs.
*/
- adr_address?: string;
+ leg?: google.maps.routes.RouteLeg;
/**
- * The rated aspects of this Place, based on Google and Zagat user reviews.
- * The ratings are on a scale of 0 to 30.
+ * The total number of markers in the route.
*/
- aspects?: google.maps.places.PlaceAspectRating[];
+ totalMarkers: number;
+ }
+ /**
+ * Route3DElementOptions object used to define the properties that can be set on a Route3DElement.
+ */
+ export interface Route3DElementOptions {
/**
- * 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.
+ * Whether or not to opt into automatically fitting the camera to the route.
*/
- business_status?: google.maps.places.BusinessStatus;
+ autofitsCamera?: boolean | null;
/**
- * The Place’s full address.
+ * See {@link google.maps.routes.Route3DElement.departureTime}.
*/
- formatted_address?: string;
+ departureTime?: Date | null;
/**
- * The Place’s phone number, formatted according to the
- * number's regional convention. Only available with {@link
- * google.maps.places.PlacesService.getDetails}.
+ * See {@link google.maps.routes.Route3DElement.destination}.
*/
- formatted_phone_number?: string;
+ destination: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null;
/**
- * The Place’s geometry-related information.
+ * See {@link google.maps.routes.Route3DElement.origin}.
*/
- geometry?: google.maps.places.PlaceGeometry;
+ origin: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null;
/**
- * 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.
+ * See {@link google.maps.routes.Route3DElement.routingPreference}.
*/
- html_attributions?: string[];
+ routingPreference?: google.maps.routes.RoutingPreferenceString | null;
/**
- * URL to an image resource that can be used to represent this Place’s
- * category.
+ * See {@link google.maps.routes.Route3DElement.travelMode}.
*/
- icon?: string;
+ travelMode?: google.maps.TravelModeString | null;
+ }
+ /**
+ * 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.
+ */
+ export class Route3DElement extends HTMLElement implements google.maps.routes.Route3DElementOptions {
/**
- * Background color for use with a Place's icon. See also {@link
- * google.maps.places.PlaceResult.icon_mask_base_uri}.
+ * Creates a Route3DElement with the options specified.
+ * @param options
*/
- icon_background_color?: string;
+ constructor(options?: google.maps.routes.Route3DElementOptions);
/**
- * A truncated URL to an icon mask. Access different icon types by appending
- * a file extension to the end (i.e. .svg or
- * .png).
+ * If provided, the specified route will be made visible within the map viewport, alongside any other elements that have opted in.
+ * @defaultValue false
*/
- icon_mask_base_uri?: string;
+ autofitsCamera?: boolean | 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}.
+ * 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}.
*/
- international_phone_number?: string;
+ departureTime?: Date | 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).
+ * The destination of the route.
*/
- name?: string;
+ destination: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | null;
/**
- * Defines when the Place opens or closes.
+ * The origin of the route.
*/
- opening_hours?: google.maps.places.PlaceOpeningHours;
+ origin: string | google.maps.LatLng | google.maps.LatLngLiteral | google.maps.LatLngAltitude | google.maps.LatLngAltitudeLiteral | google.maps.places.Place | 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.
+ * 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.
*/
- permanently_closed?: boolean;
+ routingPreference?: google.maps.routes.RoutingPreferenceString | null;
/**
- * Photos of this Place. The collection will contain up to ten {@link
- * google.maps.places.PlacePhoto} objects.
+ * If provided, the polyline is based on the specified travel mode.
*/
- photos?: google.maps.places.PlacePhoto[];
+ travelMode?: google.maps.TravelModeString | null;
+ addEventListener
- *
+ * Travel distance of the route matrix item in text form.
*/
- price_level?: number;
+ get distance(): string | null | undefined;
/**
- * A rating, between 1.0 to 5.0, based on user reviews of this Place.
+ * The distance text's BCP-47 language code, such as "en-US" or "sr-Latn". 0: Free 1: Inexpensive
- * 2: Moderate 3: Expensive
- * 4: Very Expensive
- *
For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*/
- rating?: number;
+ get distanceLanguage(): string | null | undefined;
/**
- * A list of reviews of this Place. Only available with {@link
- * google.maps.places.PlacesService.getDetails}.
+ * 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}.
*/
- reviews?: google.maps.places.PlaceReview[];
+ get duration(): string | null | undefined;
/**
- * An array of
- * types for this Place (for example, ["political",
- * "locality"] or ["restaurant", "establishment"]).
+ * 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.
*/
- types?: string[];
+ get durationLanguage(): string | null | undefined;
/**
- * 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}.
+ * Duration without taking traffic conditions into consideration, represented in text form.
*/
- url?: string;
+ get staticDuration(): string | null | undefined;
/**
- * The number of user ratings which contributed to this Place’s {@link
- * google.maps.places.PlaceResult.rating}.
+ * The static duration text's BCP-47 language code, such as "en-US" or "sr-Latn".
*/
- user_ratings_total?: number;
+ get staticDurationLanguage(): string | null | undefined;
/**
- * 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
+ * Transit fare, represented in text form.
*/
- utc_offset?: number;
+ get transitFare(): string | null | undefined;
/**
- * 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 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.
*/
- utc_offset_minutes?: number;
+ get transitFareLanguage(): string | null | undefined;
+ toJSON(key?: string): unknown;
+ }
+ /**
+ * A matrix of routes computed for a set of origin/destination pairs by {@link google.maps.routes.RouteMatrix.computeRouteMatrix}
+ * Access by calling `const {RouteMatrix} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries.
+ */
+ export class RouteMatrix {
/**
- * 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 rows of the matrix. Each row corresponds to an origin and contains an array of {@link google.maps.routes.RouteMatrixItem}s, each representing a route to a destination.
*/
- vicinity?: string;
+ get rows(): google.maps.routes.RouteMatrixRow[];
/**
- * The authoritative website for this Place, such as a business'
- * homepage. Only available with {@link
- * google.maps.places.PlacesService.getDetails}.
+ * Takes in a list of origins and destinations and returns a matrix containing route information for each combination of origin and destination.
Note: This method requires that you specify a response field mask in the request by setting the {@link google.maps.routes.ComputeRouteMatrixRequest.fields} property. The value is a list of field paths.
For example:
fields: ['*']fields: ['durationMillis', 'distanceMeters']
Use of the wildcard response field mask fields: ['*'] is discouraged because:
*/
- website?: string;
+ static computeRouteMatrix(request: google.maps.routes.ComputeRouteMatrixRequest): Promise<{matrix: google.maps.routes.RouteMatrix}>;
+ toJSON(key?: string): unknown;
}
/**
- * Represents a single review of a place.
+ * 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 PlaceReview {
+ export class RouteMatrixRow {
/**
- * The aspects rated by the review. The ratings on a scale of 0 to 3.
- * @deprecated This field is no longer available.
+ * The route information for each destination.
*/
- aspects?: google.maps.places.PlaceAspectRating[];
+ get items(): google.maps.routes.RouteMatrixItem[];
+ 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.
+ */
+ export class RouteMatrixItem {
/**
- * The name of the reviewer.
+ * Indicates whether the route was found or not.
*/
- author_name: string;
+ get condition(): google.maps.routes.RouteMatrixItemConditionString | null | undefined;
/**
- * A URL to the reviewer's profile. This will be undefined
- * when the reviewer's profile is unavailable.
+ * The travel distance of the route in meters.
*/
- author_url?: string;
+ get distanceMeters(): number | undefined;
/**
- * 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'.
+ * The length of time needed to navigate the route in milliseconds. If you set {@link google.maps.routes.ComputeRouteMatrixRequest.routingPreference} to TRAFFIC_UNAWARE, then this value is the same as {@link google.maps.routes.RouteMatrixItem.staticDurationMillis}. If you set {@link google.maps.routes.ComputeRouteMatrixRequest.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.
*/
- language: string;
+ get durationMillis(): number | null | undefined;
/**
- * A URL to the reviwer's profile image.
+ * Error that occurred during the computation of the route.
*/
- profile_photo_url: string;
+ get error(): google.maps.routes.RouteMatrixItemError | null | undefined;
/**
- * The rating of this review, a number between 1.0 and 5.0 (inclusive).
+ * In some cases when the server is not able to compute the route with the given preferences for this particular origin/destination pair, it may fall back to using a different mode of computation. When a fallback is used, this field contains detailed information about the fallback response. Otherwise this field is unset.
*/
- rating?: number;
+ get fallbackInfo(): google.maps.routes.FallbackInfo | null | undefined;
/**
- * 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".
+ * Text representations of properties of the {@link google.maps.routes.RouteMatrixItem}.
*/
- relative_time_description: string;
+ get localizedValues(): google.maps.routes.RouteMatrixItemLocalizedValues | null | undefined;
/**
- * The text of a review.
+ * The duration of traveling through the route without taking traffic conditions into consideration.
Note: If the duration exceeds 2^53 milliseconds, then this value is Number.POSITIVE_INFINITY.
*/
- text: string;
+ get staticDurationMillis(): number | null | undefined;
/**
- * Timestamp for the review, expressed in seconds since epoch.
+ * Additional information about the route.
*/
- time: number;
+ get travelAdvisory(): google.maps.routes.RouteTravelAdvisory | null | undefined;
}
+}
+
+declare namespace google.maps.visualization {
/**
- * An object used to fetch additional pages of Places results.
+ * This object defines the properties that can be set on a HeatmapLayer object.
*/
- export interface PlaceSearchPagination {
+ export interface HeatmapLayerOptions {
/**
- * Indicates if further results are available. true when there
- * is an additional results page.
+ * The data points to display. Required.
*/
- hasNextPage: boolean;
+ data?: google.maps.MVCArrayPlacesService.
- */
- export interface PlaceSearchRequest {
+ dissipating?: boolean | null;
/**
- * The bounds within which to search for Places. Both location
- * and radius will be ignored if bounds is set.
+ * The color gradient of the heatmap, specified as an array of CSS color strings. All CSS3 colors are supported except for extended named colors.
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
+ gradient?: string[] | 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.
+ * The map on which to display the layer.
*/
- keyword?: string;
+ map?: google.maps.Map | null;
/**
- * A language identifier for the language in which names and addresses
- * should be returned, when possible. See the list of
- * supported languages.
+ * The maximum intensity of the heatmap. By default, heatmap colors are dynamically scaled according to the greatest concentration of points at any particular pixel on the map. This property allows you to specify a fixed maximum.
*/
- language?: string | null;
+ maxIntensity?: number | null;
/**
- * The location around which to search for Places.
+ * The opacity of the heatmap, expressed as a number between 0 and 1.
+ * @defaultValue 0.6
*/
- location?: google.maps.LatLng | google.maps.LatLngLiteral;
+ opacity?: number | 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.
+ * The radius of influence for each data point, in pixels.
*/
- maxPriceLevel?: number;
+ radius?: number | null;
+ }
+ /**
+ * A data point entry for a heatmap. This is a geographical data point with a weight attribute.
+ */
+ export interface WeightedLocation {
/**
- * 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 location of the data point.
*/
- minPriceLevel?: number;
+ location: google.maps.LatLng;
/**
- * 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.
+ * The weighting value of the data point.
*/
- name?: string;
+ weight: number;
+ }
+ /**
+ * 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 supported. This API was deprecated in May 2025 and will be made unavailable in a later version of the Maps JavaScript API, releasing in May 2026. For more info, see https://developers.google.com/maps/deprecations).
+ */
+ export class HeatmapLayer extends google.maps.MVCObject {
/**
- * Restricts results to only those places that are open right now.
+ * Creates a new instance of HeatmapLayer.
+ * @param opts
*/
- openNow?: boolean;
+ constructor(opts?: google.maps.visualization.HeatmapLayerOptions | null);
/**
- * The distance from the given location within which to search for Places,
- * in meters. The maximum allowed value is 50 000.
+ * Returns the data points currently displayed by this heatmap.
*/
- radius?: number;
+ getData(): google.maps.MVCArrayrankBy is set to DISTANCE, you must
- * specify a location but you cannot specify a
- * radius or bounds.
- * @defaultValue {@link google.maps.places.RankBy.PROMINENCE}
+ * Sets the data points to be displayed by this heatmap.
*/
- rankBy?: google.maps.places.RankBy;
+ setData(data: google.maps.MVCArraynull, the heatmap will be removed.
*/
- type?: string;
+ setMap(map: google.maps.Map | null): void;
+
+ setOptions(options: google.maps.visualization.HeatmapLayerOptions | null): void;
}
+}
+
+declare namespace google.maps.Data {
/**
- * 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.
+ * The properties of a addfeature event.
*/
- export class PlacesService {
+ export interface AddFeatureEvent {
/**
- * 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.
+ * The feature that was added to the FeatureCollection.
*/
- 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: (
- a: google.maps.places.PlaceResult[] | null,
- b: google.maps.places.PlacesServiceStatus,
- ) => void,
- ): void;
- /**
- * 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.
- */
- findPlaceFromQuery(
- request: google.maps.places.FindPlaceFromQueryRequest,
- callback: (
- a: google.maps.places.PlaceResult[] | null,
- b: google.maps.places.PlacesServiceStatus,
- ) => void,
- ): void;
- /**
- * Retrieves details about the place identified by the given
- * placeId.
- */
- getDetails(
- request: google.maps.places.PlaceDetailsRequest,
- callback: (
- a: google.maps.places.PlaceResult | null,
- b: google.maps.places.PlacesServiceStatus,
- ) => void,
- ): void;
- /**
- * 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).
- */
- nearbySearch(
- request: google.maps.places.PlaceSearchRequest,
- callback: (
- a: google.maps.places.PlaceResult[] | null,
- b: google.maps.places.PlacesServiceStatus,
- c: google.maps.places.PlaceSearchPagination | null,
- ) => void,
- ): void;
- /**
- * 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).
- */
- textSearch(
- request: google.maps.places.TextSearchRequest,
- callback: (
- a: google.maps.places.PlaceResult[] | null,
- b: google.maps.places.PlacesServiceStatus,
- c: 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.
+ feature: google.maps.Data.Feature;
+ }
+ /**
+ * Optional parameters for importing GeoJSON.
*/
- export enum PlacesServiceStatus {
+ export interface GeoJsonOptions {
/**
- * This request was invalid.
+ * The name of the Feature property to use as the feature ID. If not specified, the GeoJSON Feature id will be used.
*/
- INVALID_REQUEST = 'INVALID_REQUEST',
+ idPropertyName?: string | null;
+ }
+ /**
+ * DataOptions object used to define the properties that a developer can set on a Data object.
+ */
+ export interface DataOptions {
/**
- * The place referenced was not found.
+ * The position of the drawing controls on the map.
+ * @defaultValue {@link google.maps.ControlPosition.TOP_LEFT}
*/
- NOT_FOUND = 'NOT_FOUND',
+ controlPosition?: google.maps.ControlPosition;
/**
- * The response contains a valid result.
+ * 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
*/
- OK = 'OK',
+ controls?: string[] | null;
/**
- * The application has gone over its request quota.
+ * 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
*/
- OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT',
+ drawingMode?: string | null;
/**
- * The application is not allowed to use the PlacesService.
+ * 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.
*/
- REQUEST_DENIED = 'REQUEST_DENIED',
+ featureFactory?: ((arg0: google.maps.Data.Geometry) => google.maps.Data.Feature) | null;
/**
- * The PlacesService request could not be processed due to a
- * server error. The request may succeed if you try again.
+ * Map on which to display the features in the collection.
*/
- UNKNOWN_ERROR = 'UNKNOWN_ERROR',
+ map: google.maps.Map;
/**
- * No result was found for this request.
+ * Style for all features in the collection. For more details, see the setStyle() method above.
*/
- ZERO_RESULTS = 'ZERO_RESULTS',
+ style?: google.maps.Data.StylingFunction | google.maps.Data.StyleOptions;
}
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- *
- * Access by calling `const {PlusCode} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * Optional parameters for creating Data.Feature objects.
*/
- export class PlusCode {
+ export interface FeatureOptions {
/**
- * 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".
+ * 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.
*/
- compoundCode: string | null;
+ geometry?: google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral | null;
/**
- * A plus code with a 1/8000th of a degree by 1/8000th of a degree area. For
- * example, "8FVC9G8F+5W".
+ * 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.
*/
- globalCode: string | null;
+ id?: number | string;
+ /**
+ * The feature properties. This is an arbitrary mapping of property names to values.
+ */
+ properties?: object | null;
}
/**
- * Represents a prediction substring.
+ * A superclass for the various geometry objects.
*/
- export interface PredictionSubstring {
+ export interface Geometry {
/**
- * The length of the substring.
+ * Repeatedly invokes the given function, passing a point from the geometry to the function on each invocation.
*/
- length: number;
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * The offset to the substring's start within the description string.
+ * Returns the type of the geometry object. Possibilities are "Point", "MultiPoint", "LineString", "MultiLineString", "LinearRing", "Polygon", "MultiPolygon", or "GeometryCollection".
*/
- offset: number;
+ getType(): string;
}
/**
- * Represents a prediction term.
+ * 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 interface PredictionTerm {
+ export class Point implements google.maps.Data.Geometry {
/**
- * The offset, in unicode characters, of the start of this term in the
- * description of the place.
+ * Constructs a Data.Point from the given LatLng or LatLngLiteral.
+ * @param latLng
*/
- offset: number;
+ constructor(latLng: google.maps.LatLng | google.maps.LatLngLiteral);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * The value of this term, for example, "Taco Bell".
+ * Returns the contained LatLng.
*/
- value: string;
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- * Price level enum for Place objects.
- *
- * 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',
+ get(): google.maps.LatLng;
+ /**
+ * Returns the string "Point".
+ */
+ getType(): string;
}
/**
- * Represents a single Query Autocomplete prediction.
+ * 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 interface QueryAutocompletePrediction {
+ export class Feature {
/**
- * This is the unformatted version of the query suggested by the Places
- * service.
+ * Constructs a Feature with the given options.
+ * @param options
*/
- description: string;
+ constructor(options?: google.maps.Data.FeatureOptions | 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.
+ * Repeatedly invokes the given function, passing a property value and name on each invocation. The order of iteration through the properties is undefined.
*/
- matched_substrings: google.maps.places.PredictionSubstring[];
+ forEachProperty(callback: (arg0: unknown, arg1: string) => void): void;
/**
- * 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}).
+ * Returns the feature's geometry.
*/
- place_id?: string;
+ getGeometry(): google.maps.Data.Geometry | null;
/**
- * 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".
+ * Returns the feature ID.
*/
- terms: google.maps.places.PredictionTerm[];
- }
- /**
- * A QueryAutocompletion request to be sent to the
- * QueryAutocompleteService.
- */
- export interface QueryAutocompletionRequest {
+ getId(): number | string | undefined;
/**
- * 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.
+ * Returns the value of the requested property, or undefined if the property does not exist.
*/
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
+ getProperty(name: string): unknown;
/**
- * The user entered input string.
+ * Removes the property with the given name.
*/
- input: string;
+ removeProperty(name: string): void;
/**
- * Location for prediction biasing. Predictions will be biased towards the
- * given location and radius. Alternatively,
- * bounds can be used.
+ * Sets the feature's geometry.
*/
- location?: google.maps.LatLng;
+ setGeometry(newGeometry: google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral | null): void;
/**
- * The character position in the input term at which the service uses text
- * for predictions (the position of the cursor in the input field).
+ * Sets the value of the specified property. If newValue is undefined this is equivalent to calling removeProperty.
*/
- offset?: number;
+ setProperty(name: string, newValue: unknown): void;
/**
- * 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.
+ * Exports the feature to a GeoJSON object.
*/
- radius?: number;
+ toGeoJson(callback: (arg0: object) => void): void;
}
/**
- * Ranking options for a PlaceSearchRequest.
- *
- * Access by calling `const {RankBy} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * The properties of a setgeometry event.
*/
- export enum RankBy {
+ export interface SetGeometryEvent {
/**
- * Ranks place results by distance from the location.
+ * The feature whose geometry was set.
*/
- DISTANCE = 0.0,
+ feature: google.maps.Data.Feature;
/**
- * Ranks place results by their prominence.
+ * The new feature geometry.
*/
- PROMINENCE = 1.0,
- }
- /**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- *
- *
- * Access by calling `const {Review} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export class Review {
+ newGeometry?: google.maps.Data.Geometry;
/**
- * The reviewer.
+ * The previous feature geometry.
*/
- authorAttribution: google.maps.places.AuthorAttribution | null;
- publishTime: Date | null;
+ oldGeometry?: google.maps.Data.Geometry;
+ }
+ /**
+ * The properties of a setproperty event.
+ */
+ export interface SetPropertyEvent {
/**
- * The rating of this review, a number between 1.0 and 5.0 (inclusive).
+ * The feature whose property was set.
*/
- rating: number | null;
+ feature: google.maps.Data.Feature;
/**
- * 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"'.
+ * The property name.
*/
- relativePublishTimeDescription: string | null;
+ name: string;
/**
- * The text of a review.
+ * The new value.
*/
- text: string | null;
+ newValue: unknown;
/**
- * 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'.
+ * The previous value. Will be undefined if the property was added.
*/
- textLanguageCode: string | null;
+ oldValue: unknown;
}
/**
- * 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.
+ * The properties of a removeproperty event.
*/
- export class SearchBox extends google.maps.MVCObject {
- /**
- * 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.
- */
- constructor(
- inputField: HTMLInputElement,
- opts?: google.maps.places.SearchBoxOptions | null,
- );
+ export interface RemovePropertyEvent {
/**
- * Returns the bounds to which query predictions are biased.
+ * The feature whose property was removed.
*/
- getBounds(): google.maps.LatLngBounds | undefined;
+ feature: google.maps.Data.Feature;
/**
- * Returns the query selected by the user to be used with
- * places_changed event.
+ * The property name.
*/
- getPlaces(): google.maps.places.PlaceResult[] | undefined;
+ name: string;
/**
- * Sets the region to use for biasing query predictions. Results will only
- * be biased towards this area and not be completely restricted to it.
+ * The previous value.
*/
- setBounds(
- bounds: google.maps.LatLngBounds | null | google.maps.LatLngBoundsLiteral,
- ): void;
+ oldValue: unknown;
}
/**
- * The options that can be set on a SearchBox object.
+ * This object is passed to mouse event handlers on a Data object.
*/
- export interface SearchBoxOptions {
+ export interface MouseEvent extends google.maps.MapMouseEvent {
/**
- * The area towards which to bias query predictions. Predictions are biased
- * towards, but not restricted to, queries targeting these bounds.
+ * The feature which generated the mouse event.
*/
- bounds?: google.maps.LatLngBounds | null | google.maps.LatLngBoundsLiteral;
+ feature: google.maps.Data.Feature;
}
/**
- * RankPreference enum for SearchByTextRequest.
- *
- * Access by calling `const {SearchByTextRankPreference} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
+ * The properties of a removefeature event.
*/
- export enum SearchByTextRankPreference {
- /**
- * Ranks results by distance.
- */
- DISTANCE = 'DISTANCE',
+ export interface RemoveFeatureEvent {
/**
- * Ranks results by relevance.
+ * The feature that was removed from the FeatureCollection.
*/
- RELEVANCE = 'RELEVANCE',
+ feature: google.maps.Data.Feature;
}
/**
- * Request interface for {@link google.maps.places.Place.searchByText}.
+ * These options specify the way a Feature should appear when displayed on a map.
*/
- export interface SearchByTextRequest {
+ export interface StyleOptions {
/**
- * EV-related options that can be specified for a place search request.
+ * The animation to play when marker is added to a map. Only applies to point geometries.
*/
- evSearchOptions?: google.maps.places.EVSearchOptions;
+ animation?: google.maps.Animation;
/**
- * 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.
+ * If true, the marker receives mouse and touch events.
+ * @defaultValue true
*/
- fields: string[];
+ clickable?: boolean;
/**
- * 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}
+ * Mouse cursor to show on hover. Only applies to point geometries.
*/
- includedType?: string;
+ cursor?: string;
/**
- * Used to restrict the search to places that are currently open.
+ * If true, the object can be dragged across the map and the underlying feature will have its geometry updated.
* @defaultValue false
*/
- isOpenNow?: boolean;
+ draggable?: 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.
+ * 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
*/
- language?: string;
+ editable?: boolean;
/**
- * 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 fill color. All CSS3 colors are supported except for extended named colors. Only applies to polygon geometries.
*/
- locationBias?:
- | google.maps.LatLng
- | google.maps.LatLngLiteral
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral
- | google.maps.CircleLiteral
- | google.maps.Circle;
+ fillColor?: string;
/**
- * 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 fill opacity between 0.0 and 1.0. Only applies to polygon geometries.
*/
- locationRestriction?:
- | google.maps.LatLngBounds
- | google.maps.LatLngBoundsLiteral;
+ fillOpacity?: number;
/**
- * Maximum number of results to return. It must be between 1 and 20,
- * inclusively.
+ * 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.
*/
- maxResultCount?: number;
+ icon?: string | google.maps.Icon | google.maps.Symbol;
/**
- * 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 icons to be rendered along a polyline. Only applies to line geometries.
*/
- minRating?: number;
+ icons?: google.maps.IconSequence[];
/**
- * 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.
+ * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. Only applies to point geometries.
*/
- priceLevels?: google.maps.places.PriceLevel[];
+ label?: string | google.maps.MarkerLabel;
/**
- * @deprecated Please use textQuery instead
+ * The marker's opacity between 0.0 and 1.0. Only applies to point geometries.
*/
- query?: string;
+ opacity?: number;
/**
- * Available only in the v=beta channel: https://goo.gle/3oAthT3.
- * @deprecated Please use rankPreference instead.
+ * Defines the image map used for hit detection. Only applies to point geometries.
*/
- rankBy?: google.maps.places.SearchByTextRankPreference;
+ shape?: google.maps.MarkerShape;
/**
- * How results will be ranked in the response.
- * @defaultValue SearchByTextRankPreference.RELEVANCE
+ * The stroke color. All CSS3 colors are supported except for extended named colors. Only applies to line and polygon geometries.
*/
- rankPreference?: google.maps.places.SearchByTextRankPreference;
+ strokeColor?: string;
/**
- * 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.
+ * The stroke opacity between 0.0 and 1.0. Only applies to line and polygon geometries.
*/
- region?: string;
+ strokeOpacity?: number;
/**
- * Required. The text query for textual search.
+ * The stroke width in pixels. Only applies to line and polygon geometries.
*/
- textQuery?: string;
+ strokeWeight?: number;
/**
- * 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
+ * Rollover text. Only applies to point geometries.
*/
- useStrictTypeFiltering?: boolean;
- }
- /**
- * RankPreference enum for SearchNearbyRequest.
- *
- * Access by calling `const {SearchNearbyRankPreference} = await
- * google.maps.importLibrary("places")`. See
- * https://developers.google.com/maps/documentation/javascript/libraries.
- */
- export enum SearchNearbyRankPreference {
+ title?: string;
/**
- * Ranks results by distance.
+ * Whether the feature is visible.
+ * @defaultValue true
*/
- DISTANCE = 'DISTANCE',
+ visible?: boolean;
/**
- * Ranks results by popularity.
+ * 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.
*/
- POPULARITY = 'POPULARITY',
+ zIndex?: number;
}
+
+ export type StylingFunction = (arg0: google.maps.Data.Feature) => google.maps.Data.StyleOptions;
/**
- * Request interface for {@link google.maps.places.Place.searchNearby}. For
- * more information on the request, see Places
- * API reference.
+ * 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 SearchNearbyRequest {
+ export class GeometryCollection implements google.maps.Data.Geometry {
/**
- * Excluded primary place type. 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.
+ * Constructs a Data.GeometryCollection from the given geometry objects or LatLngs.
+ * @param elements
*/
- excludedPrimaryTypes?: string[];
+ constructor(elements: (google.maps.Data.Geometry | google.maps.LatLng | google.maps.LatLngLiteral)[]);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * Excluded place type. 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.
+ * Returns an array of the contained geometry objects. A new array is returned each time getArray() is called.
*/
- excludedTypes?: string[];
+ getArray(): google.maps.Data.Geometry[];
/**
- * 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.
+ * Returns the n-th contained geometry object.
*/
- fields: string[];
+ getAt(n: number): google.maps.Data.Geometry;
/**
- * Included primary place type. 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.
+ * Returns the number of contained geometry objects.
*/
- includedPrimaryTypes?: string[];
+ getLength(): number;
/**
- * Included place type. 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.
+ * Returns the string "GeometryCollection".
*/
- includedTypes?: string[];
+ getType(): string;
+ }
+ /**
+ * 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 LineString implements google.maps.Data.Geometry {
/**
- * 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.
+ * Constructs a Data.LineString from the given LatLngs or LatLngLiterals.
+ * @param elements
*/
- language?: string;
+ constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * The region to search, specified as a circle with center and radius.
- * Results outside given location are not returned.
+ * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called.
*/
- locationRestriction: google.maps.Circle | google.maps.CircleLiteral;
+ getArray(): google.maps.LatLng[];
/**
- * Maximum number of results to return. It must be between 1 and 20,
- * inclusively.
+ * Returns the n-th contained LatLng.
*/
- maxResultCount?: number;
+ getAt(n: number): google.maps.LatLng;
/**
- * How results will be ranked in the response.
- * @defaultValue SearchNearbyRankPreference.DISTANCE
+ * Returns the number of contained LatLngs.
*/
- rankPreference?: google.maps.places.SearchNearbyRankPreference;
+ getLength(): number;
/**
- * 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.
+ * Returns the string "LineString".
*/
- region?: string;
+ getType(): string;
}
/**
- * 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.
+ * 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 StringRange {
+ export class LinearRing implements google.maps.Data.Geometry {
/**
- * Zero-based offset of the last Unicode character of the substring
- * (exclusive).
+ * Constructs a Data.LinearRing from the given LatLngs or LatLngLiterals.
+ * @param elements
*/
- endOffset: number;
+ constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * Zero-based offset of the first Unicode character of the substring
- * (inclusive).
+ * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called.
*/
- 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 {
+ getArray(): google.maps.LatLng[];
/**
- * This is the main text part of the unformatted description of the place
- * suggested by the Places service. Usually the name of the place.
+ * Returns the n-th contained LatLng.
*/
- main_text: string;
+ getAt(n: number): google.maps.LatLng;
/**
- * 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.
+ * Returns the number of contained LatLngs.
*/
- main_text_matched_substrings: google.maps.places.PredictionSubstring[];
+ getLength(): number;
/**
- * This is the secondary text part of the unformatted description of the
- * place suggested by the Places service. Usually the location of the place.
+ * Returns the string "LinearRing".
*/
- secondary_text: string;
+ getType(): string;
}
/**
- * A text search request to be sent to the PlacesService.
+ * 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 TextSearchRequest {
- /**
- * 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.
- */
- bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
- /**
- * 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;
+ export class MultiLineString implements google.maps.Data.Geometry {
/**
- * The center of the area used to bias results when searching for Places.
+ * Constructs a Data.MultiLineString from the given Data.LineStrings or arrays of positions.
+ * @param elements
*/
- location?: google.maps.LatLng | google.maps.LatLngLiteral;
+ constructor(elements: (google.maps.Data.LineString | (google.maps.LatLng | google.maps.LatLngLiteral)[])[]);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * 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').
+ * Returns an array of the contained Data.LineStrings. A new array is returned each time getArray() is called.
*/
- query?: string;
+ getArray(): google.maps.Data.LineString[];
/**
- * The radius of the area used to bias results when searching for Places, in
- * meters.
+ * Returns the n-th contained Data.LineString.
*/
- radius?: number;
+ getAt(n: number): google.maps.Data.LineString;
/**
- * 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").
+ * Returns the number of contained Data.LineStrings.
*/
- region?: string | null;
+ getLength(): number;
/**
- * 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.
+ * Returns the string "MultiLineString".
*/
- type?: string;
+ getType(): string;
}
-}
-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.
+ * 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 class HeatmapLayer extends google.maps.MVCObject {
+ export class MultiPoint implements google.maps.Data.Geometry {
/**
- * 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.
+ * Constructs a Data.MultiPoint from the given LatLngs or LatLngLiterals.
+ * @param elements
*/
- constructor(opts?: google.maps.visualization.HeatmapLayerOptions | null);
+ constructor(elements: (google.maps.LatLng | google.maps.LatLngLiteral)[]);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * Returns the data points currently displayed by this heatmap.
+ * Returns an array of the contained LatLngs. A new array is returned each time getArray() is called.
*/
- getData(): google.maps.MVCArray<
- google.maps.LatLng | google.maps.visualization.WeightedLocation
- >;
- getMap(): google.maps.Map | undefined;
+ getArray(): google.maps.LatLng[];
/**
- * Sets the data points to be displayed by this heatmap.
+ * Returns the n-th contained LatLng.
*/
- setData(
- data:
- | google.maps.MVCArray<
- google.maps.LatLng | google.maps.visualization.WeightedLocation
- >
- | (google.maps.LatLng | google.maps.visualization.WeightedLocation)[],
- ): void;
+ getAt(n: number): google.maps.LatLng;
/**
- * Renders the heatmap on the specified map. If map is set to
- * null, the heatmap will be removed.
+ * Returns the number of contained LatLngs.
*/
- setMap(map: google.maps.Map | null): void;
- setOptions(
- options: google.maps.visualization.HeatmapLayerOptions | null,
- ): void;
+ getLength(): number;
+ /**
+ * Returns the string "MultiPoint".
+ */
+ getType(): string;
}
/**
- * This object defines the properties that can be set on a
- * HeatmapLayer object.
+ * 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 interface HeatmapLayerOptions {
+ export class Polygon implements google.maps.Data.Geometry {
/**
- * The data points to display. Required.
+ * Constructs a Data.Polygon from the given Data.LinearRings or arrays of positions.
+ * @param elements
*/
- data?:
- | google.maps.MVCArray<
- google.maps.LatLng | google.maps.visualization.WeightedLocation
- >
- | null
- | (google.maps.LatLng | google.maps.visualization.WeightedLocation)[];
+ constructor(elements: (google.maps.Data.LinearRing | (google.maps.LatLng | google.maps.LatLngLiteral)[])[]);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * Specifies whether heatmaps dissipate on zoom. By default, the radius of
- * influence of a data point is specified by the radius option only. When
- * dissipating is disabled, the radius option is interpreted as a radius at
- * zoom level 0.
+ * Returns an array of the contained Data.LinearRings. A new array is returned each time getArray() is called.
*/
- dissipating?: boolean | null;
+ getArray(): google.maps.Data.LinearRing[];
/**
- * The color gradient of the heatmap, specified as an array of CSS color
- * strings. All CSS3 colors are supported except for extended named colors.
+ * Returns the n-th contained Data.LinearRing.
*/
- gradient?: string[] | null;
+ getAt(n: number): google.maps.Data.LinearRing;
/**
- * The map on which to display the layer.
+ * Returns the number of contained Data.LinearRings.
*/
- map?: google.maps.Map | null;
+ getLength(): number;
/**
- * The maximum intensity of the heatmap. By default, heatmap colors are
- * dynamically scaled according to the greatest concentration of points at
- * any particular pixel on the map. This property allows you to specify a
- * fixed maximum.
+ * Returns the string "Polygon".
*/
- maxIntensity?: number | 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 {
/**
- * The opacity of the heatmap, expressed as a number between 0 and 1.
- * @defaultValue 0.6
+ * Constructs a Data.MultiPolygon from the given Data.Polygons or arrays of positions.
+ * @param elements
*/
- opacity?: number | null;
+ constructor(elements: (google.maps.Data.Polygon | (google.maps.Data.LinearRing | (google.maps.LatLng | google.maps.LatLngLiteral)[])[])[]);
+
+ forEachLatLng(callback: (arg0: google.maps.LatLng) => void): void;
/**
- * The radius of influence for each data point, in pixels.
+ * Returns an array of the contained Data.Polygons. A new array is returned each time getArray() is called.
*/
- radius?: number | null;
- }
- /**
- * A data point entry for a heatmap. This is a geographical data point with a
- * weight attribute.
- */
- export interface WeightedLocation {
+ getArray(): google.maps.Data.Polygon[];
/**
- * The location of the data point.
+ * Returns the n-th contained Data.Polygon.
*/
- location: google.maps.LatLng | null;
+ getAt(n: number): google.maps.Data.Polygon;
/**
- * The weighting value of the data point.
+ * Returns the number of contained Data.Polygons.
*/
- weight: number;
+ getLength(): number;
+ /**
+ * Returns the string "MultiPolygon".
+ */
+ 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;
}
}
+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 {
+ export interface CSSProperties {
+ "--gmp-button-border-color"?: string;
+ "--gmp-button-border-radius"?: string;
+ "--gmp-button-border-width"?: string;
+ "--gmp-card-border-radius"?: string;
+ "--gmp-collage-border-radius-outer"?: string;
+ "--gmp-dialog-border-radius"?: string;
+ "--gmp-mat-color-disabled-surface"?: string;
+ "--gmp-mat-color-info"?: string;
+ "--gmp-mat-color-negative"?: string;
+ "--gmp-mat-color-neutral-container"?: string;
+ "--gmp-mat-color-on-neutral-container"?: string;
+ "--gmp-mat-color-on-positive-container"?: string;
+ "--gmp-mat-color-on-secondary-container"?: string;
+ "--gmp-mat-color-on-surface"?: string;
+ "--gmp-mat-color-on-surface-variant"?: string;
+ "--gmp-mat-color-outline-decorative"?: string;
+ "--gmp-mat-color-positive"?: string;
+ "--gmp-mat-color-positive-container"?: string;
+ "--gmp-mat-color-primary"?: string;
+ "--gmp-mat-color-secondary-container"?: string;
+ "--gmp-mat-color-surface"?: string;
+ "--gmp-mat-font-body-medium"?: string;
+ "--gmp-mat-font-body-small"?: string;
+ "--gmp-mat-font-display-small"?: string;
+ "--gmp-mat-font-family"?: string;
+ "--gmp-mat-font-headline-medium"?: string;
+ "--gmp-mat-font-label-large"?: string;
+ "--gmp-mat-font-label-medium"?: string;
+ "--gmp-mat-font-title-medium"?: string;
+ "--gmp-mat-font-title-small"?: string;
+ "--gmp-mat-spacing-extra-large"?: string;
+ "--gmp-mat-spacing-extra-small"?: string;
+ "--gmp-mat-spacing-large"?: string;
+ "--gmp-mat-spacing-medium"?: string;
+ "--gmp-mat-spacing-small"?: string;
+ "--gmp-mat-spacing-two-extra-large"?: string;
+ "--gmp-popover-max-width"?: string;
+ "--gmp-popover-min-width"?: string;
+ "--gmp-popover-pixel-offset-x"?: string;
+ "--gmp-popover-pixel-offset-y"?: string;
+ "--gmp-star-rating-color"?: string;
+ "--gmp-thumbnail-border-radius"?: string;
+ }
+}
\ No newline at end of file
diff --git a/types/google.maps/package.json b/types/google.maps/package.json
index cf1910a7a2b5ec..9561d66a906fba 100644
--- a/types/google.maps/package.json
+++ b/types/google.maps/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/google.maps",
- "version": "3.58.9999",
+ "version": "3.64.9999",
"nonNpm": true,
"nonNpmDescription": "Google Maps JavaScript API",
"projects": [