import { Libraries } from '@googlemaps/js-api-loader';
import { Algorithm, SuperClusterOptions, onClusterClickHandler, Renderer } from '@googlemaps/markerclusterer';
/**
* Base class that all other classes extend.
*/
declare class Base {
#private;
/**
* Constructor
*
* @param {string} objectType The object type for the class
*/
constructor(objectType: string);
/**
* Returns the object type
*
* @returns {string}
*/
getObjectType(): string;
/**
* Include the mixin into the class
*
* https://javascript.info/mixins
* https://www.digitalocean.com/community/tutorials/js-using-js-mixins
*
* @param {any} mixin The mixin to include
*/
static include(mixin: any): void;
/**
* Returns if the object is an Icon object
*
* @returns {boolean}
*/
isIcon(): boolean;
/**
* Returns if the object is an InfoWindow object
*
* @returns {boolean}
*/
isInfoWindow(): boolean;
/**
* Returns if the object is an LatLng object
*
* @returns {boolean}
*/
isLatLng(): boolean;
/**
* Returns if the object is an LatLngBounds object
*
* @returns {boolean}
*/
isLatLngBounds(): boolean;
/**
* Returns if the object is a Map object
*
* @returns {boolean}
*/
isMap(): boolean;
/**
* Returns if the object is a Marker object
*
* @returns {boolean}
*/
isMarker(): boolean;
/**
* Returns if the object is a MarkerCluster object
*
* @returns {boolean}
*/
isMarkerCluster(): boolean;
/**
* Returns if the object is a Point object
*
* @returns {boolean}
*/
isPoint(): boolean;
/**
* Returns if the object is a Polyline object
*
* @returns {boolean}
*/
isPolyline(): boolean;
/**
* Returns if the object is a Popup object
*
* @returns {boolean}
*/
isPopup(): boolean;
/**
* Returns if the object is a Size object
*
* @returns {boolean}
*/
isSize(): boolean;
/**
* Returns if the object is a SvgSymbol object
*
* @returns {boolean}
*/
isSvgSymbol(): boolean;
}
declare const READY_EVENT = "ready";
/**
* Events that can be fired by the Autocomplete search box.
*
* https://aptuitiv.github.io/gmaps-docs/api-reference/autocomplete-search-box#events
*/
declare const AutocompleteSearchBoxEvents: Readonly<{
PLACE_CHANGED: "place_changed";
}>;
/**
* Identifiers used to specify the placement of controls on the map.
* See https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
*/
declare const ControlPosition: Readonly<{
/**
* Equivalent to BOTTOM_CENTER in both LTR and RTL.
*/
BLOCK_END_INLINE_CENTER: "0.0";
/**
* Equivalent to BOTTOM_RIGHT in LTR, or BOTTOM_LEFT in RTL.
*/
BLOCK_END_INLINE_END: "1.0";
/**
* Equivalent to BOTTOM_LEFT in LTR, or BOTTOM_RIGHT in RTL.
*/
BLOCK_END_INLINE_START: "2.0";
/**
* Equivalent to TOP_CENTER in both LTR and RTL.
*/
BLOCK_START_INLINE_CENTER: "3.0";
/**
* Equivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL.
*/
BLOCK_START_INLINE_END: "4.0";
/**
* Equivalent to TOP_LEFT in LTR, or TOP_RIGHT in RTL.
*/
BLOCK_START_INLINE_START: "5.0";
/**
* Elements are positioned in the center of the bottom row. Consider using
* BLOCK_END_INLINE_CENTER instead.
*/
BOTTOM_CENTER: "6.0";
/**
* Elements are positioned in the bottom left and flow towards the middle.
* Elements are positioned to the right of the Google logo. Consider using
* BLOCK_END_INLINE_START instead.
*/
BOTTOM_LEFT: "7.0";
/**
* Elements are positioned in the bottom right and flow towards the middle.
* Elements are positioned to the left of the copyrights. Consider using
* BLOCK_END_INLINE_END instead.
*/
BOTTOM_RIGHT: "8.0";
/**
* Equivalent to RIGHT_CENTER in LTR, or LEFT_CENTER in RTL.
*/
INLINE_END_BLOCK_CENTER: "9.0";
/**
* Equivalent to RIGHT_BOTTOM in LTR, or LEFT_BOTTOM in RTL.
*/
INLINE_END_BLOCK_END: "10.0";
/**
* Equivalent to RIGHT_TOP in LTR, or LEFT_TOP in RTL.
*/
INLINE_END_BLOCK_START: "11.0";
/**
* Equivalent to LEFT_CENTER in LTR, or RIGHT_CENTER in RTL.
*/
INLINE_START_BLOCK_CENTER: "12.0";
/**
* Equivalent to LEFT_BOTTOM in LTR, or RIGHT_BOTTOM in RTL.
*/
INLINE_START_BLOCK_END: "13.0";
/**
* Equivalent to LEFT_TOP in LTR, or RIGHT_TOP in RTL.
*/
INLINE_START_BLOCK_START: "14.0";
/**
* Elements are positioned on the left, above bottom-left elements, and flow
* upwards. Consider using INLINE_START_BLOCK_END instead.
*/
LEFT_BOTTOM: "15.0";
/**
* Elements are positioned in the center of the left side. Consider using
* INLINE_START_BLOCK_CENTER instead.
*/
LEFT_CENTER: "16.0";
/**
* Elements are positioned on the left, below top-left elements, and flow
* downwards. Consider using INLINE_START_BLOCK_START instead.
*/
LEFT_TOP: "17.0";
/**
* Elements are positioned on the right, above bottom-right elements, and
* flow upwards. Consider using INLINE_END_BLOCK_END instead.
*/
RIGHT_BOTTOM: "18.0";
/**
* Elements are positioned in the center of the right side. Consider using
* INLINE_END_BLOCK_CENTER instead.
*/
RIGHT_CENTER: "19.0";
/**
* Elements are positioned on the right, below top-right elements, and flow
* downwards. Consider using INLINE_END_BLOCK_START instead.
*/
RIGHT_TOP: "20.0";
/**
* Elements are positioned in the center of the top row. Consider using
* BLOCK_START_INLINE_CENTER instead.
*/
TOP_CENTER: "21.0";
/**
* Elements are positioned in the top left and flow towards the middle.
* Consider using BLOCK_START_INLINE_START instead.
*/
TOP_LEFT: "22.0";
/**
* Elements are positioned in the top right and flow towards the middle.
* Consider using BLOCK_START_INLINE_END instead.
*/
TOP_RIGHT: "23.0";
}>;
type ControlPositionValue = (typeof ControlPosition)[keyof typeof ControlPosition];
/**
* Converts a ControlPosition string value to a google.maps.ControlPosition value.
*
* This is only necessary because the Google Maps API uses a float value for the
* ControlPosition.
*
* @param {string} value The ControlPosition value to convert
* @returns {google.maps.ControlPosition}
*/
declare const convertControlPosition: (value: string) => google.maps.ControlPosition;
/**
* Error status value for the Geocode object.
*
* https://developers.google.com/maps/documentation/javascript/reference/3.56/geocoder?hl=en#GeocoderStatus
*/
declare const GeocoderErrorStatus: Readonly<{
ERROR: "ERROR";
INVALID_REQUEST: "INVALID_REQUEST";
OVER_QUERY_LIMIT: "OVER_QUERY_LIMIT";
REQUEST_DENIED: "REQUEST_DENIED";
UNKNOWN_ERROR: "UNKNOWN_ERROR";
}>;
type GeocoderErrorStatusValue = (typeof GeocoderErrorStatus)[keyof typeof GeocoderErrorStatus];
/**
* The type of location returned by the Geocoder.
*
* https://developers.google.com/maps/documentation/javascript/reference/3.56/geocoder?hl=en#GeocoderLocationType
*/
declare const GeocoderLocationType: Readonly<{
APPROXIMATE: "APPROXIMATE";
GEOMETRIC_CENTER: "GEOMETRIC_CENTER";
RANGE_INTERPOLATED: "RANGE_INTERPOLATED";
ROOFTOP: "ROOFTOP";
}>;
type GeocoderLocationTypeValue = (typeof GeocoderLocationType)[keyof typeof GeocoderLocationType];
/**
* Events that can be fired by the ImageOverlay.
*/
declare const ImageOverlayEvents: Readonly<{
ROTATE_START: "rotatestart";
ROTATE: "rotate";
ROTATE_END: "rotateend";
}>;
/**
* Events that can be fired by the InfoWindow.
*/
declare const InfoWindowEvents: Readonly<{
CLOSE: "close";
CLOSECLICK: "closeclick";
CONTENT_CHANGED: "content_changed";
DOMREADY: "domready";
HEADER_CONTENT_CHANGED: "headercontent_changed";
HEADER_DISABLED_CHANGED: "headerdisabled_changed";
POSITION_CHANGED: "position_changed";
VISIBLE: "visible";
ZINDEX_CHANGED: "zindex_changed";
READY: "ready";
}>;
/**
* Events that can be fired by the Layer.
*/
declare const LayerEvents: Readonly<{
READY: "ready";
}>;
/**
* Events that can be fired by the Loader.
*
* https://aptuitiv.github.io/gmaps-docs/api-reference/loader#events
*/
declare const LoaderEvents: Readonly<{
LOAD: "load";
MAP_LOAD: "map_load";
}>;
/**
* Events that can be fired by the Map.
*
* This includes references to Google Maps events https://developers.google.com/maps/documentation/javascript/reference/map#Map-Events
* and this library's custom events.
*/
declare const MapEvents: Readonly<{
BOUNDS_CHANGED: "bounds_changed";
CENTER_CHANGED: "center_changed";
CLICK: "click";
CONTEXT_MENU: "contextmenu";
DBLCLICK: "dblclick";
DRAG: "drag";
DRAG_END: "dragend";
DRAG_START: "dragstart";
HEADING_CHANGED: "heading_changed";
IDLE: "idle";
IS_FRACTIONAL_ZOOM_ENABLED_CHANGED: "isfractionalzoomenabled_changed";
MAP_CAPABILITIES_CHANGED: "mapcapabilities_changed";
MAP_TYPE_ID_CHANGED: "maptypeid_changed";
MOUSE_MOVE: "mousemove";
MOUSE_OUT: "mouseout";
MOUSE_OVER: "mouseover";
PROJECTION_CHANGED: "projection_changed";
RENDERING_TYPE_CHANGED: "renderingtype_changed";
TILES_LOADED: "tilesloaded";
TILT_CHANGED: "tilt_changed";
ZOOM_CHANGED: "zoom_changed";
LOCATION_ERROR: "locationerror";
LOCATION_FOUND: "locationfound";
READY: "ready";
}>;
/**
* Style values for common MapTypesControls.
*
* https://developers.google.com/maps/documentation/javascript/reference/control#MapTypeControlStyle
*/
declare const MapTypeControlStyle: Readonly<{
/**
* 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.
*/
DEFAULT: "0.0";
/**
* A dropdown menu for the screen realestate conscious.
*/
DROPDOWN_MENU: "1.0";
/**
* The standard horizontal radio buttons bar.
*/
HORIZONTAL_BAR: "2.0";
}>;
type MapTypeControlStyleValue = (typeof MapTypeControlStyle)[keyof typeof MapTypeControlStyle];
/**
* Converts a MapTypeControlStyle string value to a google.maps.ControlPosition value.
*
* This is only necessary because the Google Maps API uses a float value for the
* MapTypeControlStyle.
*
* @param {string} value The MapTypeControlStyle value to convert
* @returns {google.maps.ControlPosition}
*/
declare const convertMapTypeControlStyle: (value: string) => google.maps.MapTypeControlStyle;
/**
* Identifiers for common MapTypes.
*
* https://developers.google.com/maps/documentation/javascript/reference/map#MapTypeId
*/
declare const MapTypeId: Readonly<{
/**
* This map type displays a transparent layer of major streets on satellite
* images.
*/
HYBRID: "hybrid";
/**
* This map type displays a normal street map.
*/
ROADMAP: "roadmap";
/**
* This map type displays satellite images.
*/
SATELLITE: "satellite";
/**
* This map type displays maps with physical features such as terrain and
* vegetation.
*/
TERRAIN: "terrain";
}>;
type MapTypeIdValue = (typeof MapTypeId)[keyof typeof MapTypeId];
/**
* Events that can be fired by the Marker.
*
* This includes references to Google Maps marker events https://developers.google.com/maps/documentation/javascript/reference/marker#Marker-Events
* and this library's custom events.
*/
declare const MarkerEvents: Readonly<{
ANIMATION_CHANGED: "animation_changed";
CLICK: "click";
CLICKABLE_CHANGED: "clickable_changed";
CONTEXT_MENU: "contextmenu";
CURSOR_CHANGED: "cursor_changed";
DBLCLICK: "dblclick";
DRAG: "drag";
DRAG_END: "dragend";
DRAGGABLE_CHANGED: "draggable_changed";
DRAG_START: "dragstart";
FLAT_CHANGED: "flat_changed";
ICON_CHANGED: "icon_changed";
MOUSE_DOWN: "mousedown";
MOUSE_OUT: "mouseout";
MOUSE_OVER: "mouseover";
MOUSE_UP: "mouseup";
POSITION_CHANGED: "position_changed";
SHAPE_CHANGED: "shape_changed";
TITLE_CHANGED: "title_changed";
VISIBLE_CHANGED: "visible_changed";
ZINDEX_CHANGED: "zindex_changed";
READY: "ready";
}>;
/**
* Events that can be fired by the Overlay.
*/
declare const OverlayEvents: Readonly<{
DRAG_START: "dragstart";
DRAG: "drag";
DRAGGABLE_CHANGED: "draggable_changed";
DRAG_END: "dragend";
OPEN: "open";
RESIZE_START: "resizestart";
RESIZE: "resize";
RESIZE_END: "resizeend";
}>;
/**
* Events that can be fired by the PlacesSearchBox.
*/
declare const PlacesSearchBoxEvents: Readonly<{
PLACES_CHANGED: "places_changed";
}>;
/**
* Events that can be fired by the Popup.
*/
declare const PolylineEvents: Readonly<{
CLICK: "click";
CONTEXT_MENU: "contextmenu";
DBLCLICK: "dblclick";
DRAG: "drag";
DRAG_END: "dragend";
DRAG_START: "dragstart";
MOUSE_DOWN: "mousedown";
MOUSE_MOVE: "mousemove";
MOUSE_OUT: "mouseout";
MOUSE_OVER: "mouseover";
MOUSE_UP: "mouseup";
READY: "ready";
}>;
/**
* Events that can be fired by the Popup.
*/
declare const PopupEvents: Readonly<{
OPEN: "open";
}>;
/**
* The rendering type of the map.
*
* https://developers.google.com/maps/documentation/javascript/reference/map#RenderingType
*/
declare const RenderingType: Readonly<{
RASTER: "RASTER";
UNINITIALIZED: "UNINITIALIZED";
VECTOR: "VECTOR";
}>;
type RenderingTypeValue = (typeof RenderingType)[keyof typeof RenderingType];
/**
* Street view sources
* https://developers.google.com/maps/documentation/javascript/reference/street-view-service#StreetViewSource
*/
declare const StreetViewSource: Readonly<{
DEFAULT: "default";
GOOGLE: "google";
OUTDOOR: "outdoor";
}>;
type StreetViewSourceValue = (typeof StreetViewSource)[keyof typeof StreetViewSource];
/**
* Build in symbols
* https://developers.google.com/maps/documentation/javascript/symbols#predefined
*/
declare const SymbolPath: Readonly<{
BACKWARD_CLOSED_ARROW: "BACKWARD_CLOSED_ARROW";
BACKWARD_OPEN_ARROW: "BACKWARD_OPEN_ARROW";
CIRCLE: "CIRCLE";
FORWARD_CLOSED_ARROW: "FORWARD_CLOSED_ARROW";
FORWARD_OPEN_ARROW: "FORWARD_OPEN_ARROW";
}>;
type SymbolPathValue = (typeof SymbolPath)[keyof typeof SymbolPath];
/**
* Converts a SymbolPath string value to a google.maps.SymbolPath value.
*
* @param {string} value The SymbolPath value to convert
* @returns {google.maps.SymbolPath}
*/
declare const convertSymbolPath: (value: string) => string;
type LatLngLiteral = {
lat?: number | string;
lng?: number | string;
};
type LatLngLiteralExpanded = {
latitude: number | string;
longitude: number | string;
};
type Latitude = number | number[] | string | string[] | LatLngLiteral | LatLngLiteralExpanded;
/**
* The LatLng class to set up and manage latitude/longitude pairs
*/
declare class LatLng extends Base {
#private;
/**
* Constructor
*
* @param {Latitude|LatLng|google.maps.LatLng} latitude The latitude value or the latitude/longitude pair
* @param {number|string} [longitude] The longitude value
*/
constructor(latitude?: Latitude | LatLng | google.maps.LatLng, longitude?: number | string);
/**
* Get the latitude value
*
* @returns {number}
*/
get latitude(): number;
/**
* Set the latitude value
*
* @param {number|string} latitude The latitude value. Ideally it's a number but it could be a number string
*/
set latitude(latitude: number | string);
/**
* Get the latitude value (shortened version of the latitude property)
*
* @returns {number}
*/
get lat(): number;
/**
* Set the latitude value
*
* @param {number|string} latitude The latitude value. Ideally it's a number but it could be a number string
*/
set lat(latitude: number | string);
/**
* Get the longitude value
*
* @returns {number}
*/
get longitude(): number;
/**
* Set the longitude value
*
* @param {number|string} longitude The longitude value. Ideally it's a number but it could be a number string
*/
set longitude(longitude: number | string);
/**
* Get the longitude value (shortened version of the longitude property)
*
* @returns {number}
*/
get lng(): number;
/**
* Set the longitude value
*
* @param {number|string} longitude The longitude value. Ideally it's a number but it could be a number string
*/
set lng(longitude: number | string);
/**
* Returns a new copy of the latitude/longitude pair
*
* @returns {LatLng}
*/
clone(): LatLng;
/**
* Tests to see if the given latitude/longitude pair is equal to this latitude/longitude pair
*
* @param {number[] | string[] | LatLngLiteral | LatLngLiteralExpanded | LatLng} other The latitude/longitude pair to compare to
* @returns {boolean}
*/
equals(other: number[] | string[] | LatLngLiteral | LatLngLiteralExpanded | LatLng): boolean;
/**
* Set the latitude/longitude pair
*
* @param {Latitude|LatLng} latitude The latitude value or the latitude/longitude pair
* @param {number|string} longitude The longitude value
* @returns {LatLng}
*/
set(latitude: Latitude | LatLng | google.maps.LatLng, longitude?: number | string): LatLng;
/**
* Sets the latitude value
*
* @param {number|string} lat The latitude value. Ideally it's a number, but it could be a number string
* @returns {LatLng}
*/
setLat(lat: number | string): LatLng;
/**
* Returns the longitude value
*
* @returns {number}
*/
getLat(): number;
/**
* Sets the longitude value
*
* @param {number|string} lng The longitude value. Ideally it's a number, but it could be a number string
* @returns {LatLng}
*/
setLng(lng: number | string): LatLng;
/**
* Returns the latitude value
*
* @returns {number}
*/
getLng(): number;
/**
* Get the Google maps LatLng object
*
* https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng
*
* @returns {google.maps.LatLng|null}
*/
toGoogle(): google.maps.LatLng | null;
/**
* Returns whether the latitude/longitude pair are valid values
*
* @returns {boolean}
*/
isValid(): boolean;
/**
* Converts the latitude/longitude pair to a JSON object
*
* @returns {google.maps.LatLngLiteral}
*/
toJson(): google.maps.LatLngLiteral;
}
type LatLngValue = number[] | string[] | LatLngLiteral | LatLngLiteralExpanded | LatLng | google.maps.LatLng;
/**
* Helper function to set up a new LatLng object value
*
* @param {LatLngValue} [latitude] The latitude value or the latitude/longitude pair
* @param {number|string} [longitude] The longitude value
* @returns {LatLng}
*/
declare const latLng: (latitude?: LatLngValue | string | number, longitude?: number | string) => LatLng;
type PointObject = {
x: number | string;
y: number | string;
};
type XPoint = number | number[] | string | string[] | PointObject;
/**
* The Point class to set up and manage x/y coordinates
*/
declare class Point extends Base {
#private;
/**
* Constructor
*
* @param {XPoint|Point} [x] The X value
* @param {number|string} [y] The Y value
*/
constructor(x?: XPoint | Point, y?: number | string);
/**
* Get the x value
*
* @returns {number}
*/
get x(): number;
/**
* Set the x value
*
* @param {number|string} x The x value. Ideally it's a number but it could be a number string
*/
set x(x: number | string);
/**
* Get the y value
*
* @returns {number}
*/
get y(): number;
/**
* Set the y value
*
* @param {number|string} y The y value. Ideally it's a number but it could be a number string
*/
set y(y: number | string);
/**
* Adds the x/y values to this point.
*
* This is the best way to either explicitly add an absolute x/y position, or to combine
* two points together. The other point could include negative values.
*
* @param {PointValue} x The x value, or the Point object, or an array of [x, y] pairs, or a {x, y} object
* @param {number|string} [y] The y value
* @returns {Point}
*/
add(x: PointValue, y?: number | string): Point;
/**
* Rounds the x/y values up to the nearest integer.
* If the value is already an integer, it will return the same value.
*
* @returns {Point}
*/
ceil(): Point;
/**
* Returns a new copy of the point
*
* @returns {Point}
*/
clone(): Point;
/**
* Divides the x/y values by a number.
*
* @param {number|string} num The number to divide the x and y values by
* @returns {Point}
*/
divide(num: number | string): Point;
/**
* This returns the cartesian distance between this point and the given point.
*
* @param {PointValue} p The point to compare to
* @returns {number}
*/
distanceTo(p: PointValue): number;
/**
* Returns whether the current point is equal to the given point
*
* @param {PointValue} p The point value to compare
* @returns {boolean}
*/
equals(p: PointValue): boolean;
/**
* Returns a copy of the curent point with the x/y values rounded down to the nearest integer.
* If the value is already an integer, it will return the same value.
*
* @returns {Point}
*/
floor(): Point;
/**
* Get the x value
*
* @returns {number}
*/
getX(): number;
/**
* Get the y value
*
* @returns {number}
*/
getY(): number;
/**
* Returns whether the x/y pair are valid values
*
* @returns {boolean}
*/
isValid(): boolean;
/**
* Multiplies the x/y values by a number
*
* @param {number|string} num The number to multiply the x and y values by
* @returns {Point}
*/
multiply(num: number | string): Point;
/**
* Rounds the x/y values to the nearest integer.
*
* @returns {Point}
*/
round(): Point;
/**
* Set the x/y values
*
* @param {XPoint|Point} x The x value, or the Point object, or an array of [x, y] pairs, or a {x, y} object
* @param {number|string} y The y value
* @returns {Point}
*/
set(x: XPoint | Point, y?: number | string): Point;
/**
* Set the x value
*
* @param {number|string} x The x value. Ideally it's a number but it could be a number string
* @returns {Point}
*/
setX(x: number | string): Point;
/**
* Set the y value
*
* @param {number|string} y The y value. Ideally it's a number but it could be a number string
* @returns {Point}
*/
setY(y: number | string): Point;
/**
* Subtract the x/y values to this point.
*
* The x/y values to subtract should ideally be absolute values to avoid confusion.
* While they can include negative numbers, that may return unexpected results.
*
* @param {PointValue} x The x value, or the Point object, or an array of [x, y] pairs, or a {x, y} object
* @param {number|string} [y] The y value
* @returns {Point}
*/
subtract(x: PointValue, y?: number | string): Point;
/**
* Returns the Google maps point object
*
* https://developers.google.com/maps/documentation/javascript/reference/coordinates#Point
*
* @returns {google.maps.Point}
*/
toGoogle(): google.maps.Point;
/**
* Change the x/y values to the integer part of a number by removing any fractional digits.
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
*
* @returns {Point}
*/
trunc(): Point;
}
type PointValue = Point | number | number[] | string | string[] | PointObject;
/**
* Helper function to set up the point object
*
* @param {PointValue} [x] The x value, or the Point object, or an array of [x, y] pairs, or a {x, y} object
* @param {number|string} [y] The y value
* @returns {Point}
*/
declare const point: (x?: PointValue, y?: number | string) => Point;
type Event$1 = {
domEvent?: MouseEvent | TouchEvent | PointerEvent | KeyboardEvent | Event$1;
latLng?: LatLng;
placeId?: string;
pixel?: Point;
stop?: () => void;
type: string;
};
type EventCallback = (event: Event$1) => void;
type EventConfig = {
callImmediate?: boolean;
context?: object;
once?: boolean;
only?: boolean;
};
type EventListenerOptions = {
once?: boolean;
};
/**
* Evented class to add syntatic sugar to handling events
*/
declare class Evented extends Base {
#private;
/**
* Constructor
*
* @param {string} objectType The object type for the class
* @param {string} testObject The object that needs Google maps. This should be the name of the object that calls this method.
* @param {string} [testLibrary] An optional Google maps library class to check for. This needs to be part of the google.maps object.
*/
constructor(objectType: string, testObject: string, testLibrary?: string);
/**
* Dispatch an event
*
* @param {string} event The event to dispatch
* @param {Event} [data] The data to pass to the event listener callback function.
* @returns {Evented}
*/
dispatch(event: string, data?: any): Evented;
/**
* Test if there are any listeners for the given event type
*
* Optionally you can test if there are any listeners for the given event type and callback
*
* @param {string} type The event type to test for
* @param {EventCallback} callback Optional callback function to include in the test
* @returns {boolean}
*/
hasListener(type: string, callback?: EventCallback): boolean;
/**
* Removes the event listener
*
* There are three ways to remove event listeners:
* 1. Remove a specific event listener
* this.off('click', onClickFunction);
* this.off('click', onClickFunction, options);
* 2. Remove all listeners for a given event type
* this.off('click');
* 3. Remove all listeners for all event types
* this.off();
* this.offAll();
*
* @param {string} [type] The event type
* @param {EventCallback} [callback] The callback function to include when finding the event to remove
* @param {EventListenerOptions} [options] The options to use when finding the event to remove
*/
off(type?: string, callback?: EventCallback, options?: EventListenerOptions): void;
/**
* Removes all event listeners
*/
offAll(): void;
/**
* Add an event listener to the object
*
* @param {string} type The event type
* @param {Function} callback The event listener callback function
* @param {EventConfig} [config] Configuration for the event.
*/
on(type: string, callback: EventCallback, config?: EventConfig): void;
/**
* Add an event listener to the object. It will be called immediately if the event has already been dispatched.
*
* @param {string} type The event type
* @param {Function} callback The event listener callback function
* @param {EventConfig} [config] Configuration for the event.
*/
onImmediate(type: string, callback: EventCallback, config?: EventConfig): void;
/**
* Sets up an event listener that will only be called once
*
* @param {string} type The event type
* @param {EventCallback} [callback] The event listener callback function
* @param {EventConfig} [config] Configuration for the event.
*/
once(type: string, callback?: EventCallback, config?: EventConfig): void;
/**
* Sets up an event listener that will only be called once. It will be called immediately if the event has already been dispatched.
*
* @param {string} type The event type
* @param {EventCallback} [callback] The event listener callback function
* @param {EventConfig} [config] Configuration for the event.
*/
onceImmediate(type: string, callback?: EventCallback, config?: EventConfig): void;
/**
* Sets up an event listener that will have only one event listener for this type.
*
* It will be called immediately if the event has already been dispatched.
*
* The difference between this and on() is that only() will only set up one event listener for this type.
*
* @param {string} type The event type
* @param {EventCallback} [callback] The event listener callback function
* @param {EventConfig} [config] Configuration for the event.
*/
only(type: string, callback: EventCallback, config?: EventConfig): void;
/**
* Sets up an event listener that will only be called once and only one event listener for this type will be set up.
*
* It will be called immediately if the event has already been dispatched.
*
* The difference between this and once() is that onlyOnce() will only set up one event listener for this type.
*
* @param {string} type The event type
* @param {EventCallback} [callback] The event listener callback function
* @param {EventConfig} [config] Configuration for the event.
*/
onlyOnce(type: string, callback: EventCallback, config?: EventConfig): void;
/**
* Set the Google maps MVC object
*
* This is the Google object that the object represents. Event listeners will be added to it.
*
* This should only be called from the class that extends this class.
* This is not intended to be called from outside of this library.
*
* @internal
* @param {google.maps.MVCObject| google.maps.marker.AdvancedMarkerElement} googleObject The Google maps MVC object
*/
setEventGoogleObject(googleObject: google.maps.MVCObject | google.maps.marker.AdvancedMarkerElement): void;
/**
* Triggers an event
*
* Alias to dispatch()
*
* @param {string} event The event to dispatch
* @param {Event} [data] The data to pass to the event listener callback function.
* @returns {Evented}
*/
trigger(event: string, data?: any): Evented;
}
type 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;
};
type LatLngBoundsEdges = {
ne: LatLngValue;
sw: LatLngValue;
};
/**
* The LatLngBounds class to set up and manage latitude/longitude bounds
*/
declare class LatLngBounds extends Base {
#private;
/**
* Constructor
*
* @param {LatLngValue | LatLngValue[]} [latLngValue] The latitude/longitude value(s). If not set then add points with the extend method.
* See comments on the extended method for the types of values that latLngValue can be.
*/
constructor(latLngValue?: LatLngValue | LatLngValue[] | LatLngBoundsEdges | LatLngBoundsLiteral);
/**
* Returns whether the the given LatLng value is within this bounds
*
* @param {LatLngValue} latLngValue The LatLng value to test
* @returns {boolean}
*/
contains(latLngValue: LatLngValue): boolean;
/**
* Returns whether this bounds approximately equals the given bounds
*
* @param {LatLngBounds} other The LatLngBounds object to compare
* @returns {Promise}
*/
equals(other: LatLngBounds): Promise;
/**
* Extends this bounds to contain the given point
*
* https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLngBounds.extend
*
* The latLngValue parameter can be:
* - an array of [lat, lng] pairs: [[lat, lng], [lat, lng], ...]
* - an array of {lat, lng} objects (LatLngLiteral[]): [{lat, lng}, {lat, lng}, ...]
* - an array of LatLng objects: [LatLng, LatLng, ...]
* - a [lat, lng] pair
* - a {lat, lng} object (LatLngLiteral)
*
* @param {LatLngValue | LatLngValue[]} latLngValue The latitude/longitude value(s)
* @returns {LatLngBounds}
*/
extend(latLngValue: LatLngValue | LatLngValue[]): LatLngBounds;
/**
* Get the center of the LatLngBounds
*
* @returns {LatLng}
*/
getCenter(): LatLng;
/**
* Get the north-east corner of the LatLngBounds
*
* @returns {LatLng}
*/
getNorthEast(): LatLng;
/**
* Get the south-west corner of the LatLngBounds
*
* @returns {LatLng}
*/
getSouthWest(): LatLng;
/**
* Initialize the lat/lng bounds object so that the Google maps library is available
*
* This is not intended to be called outside of this library.
*
* @internal
* @returns {Promise}
*/
init(): Promise;
/**
* Returns whether this bounds shares any points with the other bounds
*
* @param {LatLngBounds} other The LatLngBounds object to compare
* @returns {Promise}
*/
intersects(other: LatLngBounds): Promise;
/**
* Returns whether this bounds is empty
*
* @returns {boolean}
*/
isEmpty(): boolean;
/**
* Get the Google maps LatLngBounds object
*
* https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLngBounds
*
* @returns {Promise}
*/
toGoogle(): Promise;
/**
* Converts the LatLngBounds object to a JSON object
*
* @returns {google.maps.LatLngBoundsLiteral}
*/
toJson(): google.maps.LatLngBoundsLiteral;
/**
* Converts the LatLngBounds object to a string
*
* @returns {string}
*/
toString(): string;
/**
* Returns the LatLngBounds object as a string that can be used in a URL
*
* @param {number} [precision] The number of decimal places to round the lat/lng values to
* @returns {string}
*/
toUrlValue(precision?: number): string;
/**
* Extends this bounds to contain the union of this and the given bounds
*
* @param {LatLngBounds} other The LatLngBounds object to join with
* @returns {Promise}
*/
union(other: LatLngBounds | google.maps.LatLngBounds): Promise;
}
type LatLngBoundsValue = LatLngValue | LatLngValue[] | LatLngBoundsEdges | LatLngBoundsLiteral | LatLngBounds;
/**
* Helper function to set up the LatLngBounds object
*
* See comments on the extended method in the LatLngBounds class for the types of values
* that latLngValue can be.
*
* @param {LatLngBoundsValue} [latLngValue] The latitude/longitude bounds value
* @returns {LatLngBounds}
*/
declare const latLngBounds: (latLngValue?: LatLngBoundsValue) => LatLngBounds;
declare class GeocodeAddressTypes {
#private;
/**
* Constructor
*
* @param {string[]} [types] The types for the address
*/
constructor(types?: string[]);
/**
* Gets the address types
*
* @returns {string[]}
*/
getTypes(): string[];
/**
* Returns if the address is an administrative area level 1.
*
* This is the highest level of administrative area below the country level.
* In the United States, these administrative levels are states.
*
* @returns {boolean}
*/
isAdministrativeAreaLevel1(): boolean;
/**
* Returns if the address is an administrative area level 2.
*
* Within the United States this would be a county.
*
* @returns {boolean}
*/
isAdministrativeAreaLevel2(): boolean;
/**
* Returns if the address is an administrative area level 3.
*
* This is a minor civil division.
*
* @returns {boolean}
*/
isAdministrativeAreaLevel3(): boolean;
/**
* Returns if the address is an administrative area level 4.
*
* This is a minor civil division.
*
* @returns {boolean}
*/
isAdministrativeAreaLevel4(): boolean;
/**
* Returns if the address is an administrative area level 5.
*
* This is a minor civil division.
*
* @returns {boolean}
*/
isAdministrativeAreaLevel5(): boolean;
/**
* Returns if the address is an administrative area level 6.
*
* This is a minor civil division.
*
* @returns {boolean}
*/
isAdministrativeAreaLevel6(): boolean;
/**
* Returns if the address is an administrative area level 7.
*
* This is a minor civil division.
*
* @returns {boolean}
*/
isAdministrativeAreaLevel7(): boolean;
/**
* Returns if the address is an airport.
*
* @returns {boolean}
*/
isAirport(): boolean;
/**
* Returns if the address is a bus station or bus stop.
*
* @returns {boolean}
*/
isBusStation(): boolean;
/**
* Returns if the address is a city.
*
* This is an alias for isLocality()
*
* @returns {boolean}
*/
isCity(): boolean;
/**
* Returns if the address is a commonly used alternative name for the entity.
*
* @returns {boolean}
*/
isColloquialArea(): boolean;
/**
* Returns if the address is a country.
*
* @returns {boolean}
*/
isCountry(): boolean;
/**
* Returns if the address is a county.
*
* This is an alias for isAdministrativeAreaLevel2()
*
* @returns {boolean}
*/
isCounty(): boolean;
/**
* Returns if the address is a place that hasn't yet been categorized.
*
* @returns {boolean}
*/
isEstablishment(): boolean;
/**
* Returns if the address is a floor in a building.
*
* @returns {boolean}
*/
isFloor(): boolean;
/**
* Returns if the address is a major intersection, usually of two major roads.
*
* @returns {boolean}
*/
isIntersection(): boolean;
/**
* Returns if the address is a landmark.
*
* @returns {boolean}
*/
isLandmark(): boolean;
/**
* Returns if the address is a locality.
*
* @returns {boolean}
*/
isLocality(): boolean;
/**
* Returns if the address is a prominent natural feature.
*
* @returns {boolean}
*/
isNaturalFeature(): boolean;
/**
* Returns if the address is a neighborhood.
*
* @returns {boolean}
*/
isNeighborhood(): boolean;
/**
* Returns if the address is a plus code.
*
* See https://plus.codes/ for more information.
*
* @returns {boolean}
*/
isPlusCode(): boolean;
/**
* Returns if the address is a named park.
*
* @returns {boolean}
*/
isPark(): boolean;
/**
* Returns if the address is a parking lot.
*
* @returns {boolean}
*/
isParking(): boolean;
/**
* Returns if the address is a point of interest.
*
* @returns {boolean}
*/
isPointOfInterest(): boolean;
/**
* Returns if the address is a political entity. This would usually be some type of civil administration.
*
* @returns {boolean}
*/
isPolitical(): boolean;
/**
* Returns if the address is a specific post box.
*
* @returns {boolean}
*/
isPostBox(): boolean;
/**
* Returns if the address is a postal code.
*
* @returns {boolean}
*/
isPostalCode(): boolean;
/**
* Returns if the address is a grouping of geographic areas.
*
* @returns {boolean}
*/
isPostalTown(): boolean;
/**
* Returns if the location is a named location, usually a building or collection of buildings with a common name.
*
* @returns {boolean}
*/
isPremise(): boolean;
/**
* Returns if the address is a room of a building.
*
* @returns {boolean}
*/
isRoom(): boolean;
/**
* Returns if the address is a named route (such as "US 101").
*
* @returns {boolean}
*/
isRoute(): boolean;
/**
* Returns if the address is a state or province.
*
* This is an alias for isAdministrativeAreaLevel1()
*
* @returns {boolean}
*/
isState(): boolean;
/**
* Returns if the address is a street address
*
* @returns {boolean}
*/
isStreetAddress(): boolean;
/**
* Returns if the address indicates a precise street number.
*
* @returns {boolean}
*/
isStreetNumber(): boolean;
/**
* Returns if the address is a sublocality.
*
* @returns {boolean}
*/
isSubLocality(): boolean;
/**
* Returns if the address is a sublocality level 1.
*
* @returns {boolean}
*/
isSubLocalityLevel1(): boolean;
/**
* Returns if the address is a sublocality level 2.
*
* @returns {boolean}
*/
isSubLocalityLevel2(): boolean;
/**
* Returns if the address is a sublocality level 3.
*
* @returns {boolean}
*/
isSubLocalityLevel3(): boolean;
/**
* Returns if the address is a sublocality level 4.
*
* @returns {boolean}
*/
isSubLocalityLevel4(): boolean;
/**
* Returns if the address is a sublocality level 5.
*
* @returns {boolean}
*/
isSubLocalityLevel5(): boolean;
/**
* Returns if the location is a subpremise.
*
* This is the next level below a premise, usually a single building in a collection of buildings with a common name.
*
* @returns {boolean}
*/
isSubPremise(): boolean;
/**
* Returns if the address is a town.
*
* This is an alias for isLocality()
*
* @returns {boolean}
*/
isTown(): boolean;
/**
* Returns if the address is a train station.
*
* @returns {boolean}
*/
isTrainStation(): boolean;
/**
* Returns if the address is a transit station.
*
* @returns {boolean}
*/
isTransitStation(): boolean;
}
/**
* The geocode address component class
*/
declare class GeocodeAddressComponent extends Base {
#private;
/**
* Constructor
*
* @param {google.maps.GeocoderAddressComponent} component The Google Maps GeocoderAddressComponent object
*/
constructor(component: google.maps.GeocoderAddressComponent);
/**
* Gets the full name of the address component
*
* @returns {string}
*/
getLongName(): string;
/**
* Gets the abbreviated name of the address component
*
* @returns {string}
*/
getShortName(): string;
/**
* Gets the array of types objects for the address component
*
* @returns {GeocodeAddressTypes}
*/
getTypes(): GeocodeAddressTypes;
/**
* Gets the array of types for the address component
*
* https://developers.google.com/maps/documentation/javascript/geocoding?hl=en#GeocodingAddressTypes
*
* @returns {string[]}
*/
getTypesArray(): string[];
/**
* Get the original Google Maps GeocoderAddressComponent object
*
* @returns {google.maps.GeocoderAddressComponent}
*/
toGoogle(): google.maps.GeocoderAddressComponent;
}
/**
* The geocode result class
*
* This is intended to be an internal class and not instantiated directly outside this library.
* It is used to wrap the Google Maps GeocoderResult object.
*/
declare class GeocodeResult extends Base {
#private;
/**
* Constructor
*
* @param {google.maps.GeocoderResult} [result] The Google Maps GeocoderResult object
*/
constructor(result?: google.maps.GeocoderResult);
/**
* Get the address component objects
*
* @returns {GeocodeAddressComponent[]}
*/
getAddressComponents(): GeocodeAddressComponent[];
/**
* Get the precise bounds of the result, if available
*
* @returns {LatLngBounds|undefined}
*/
getBounds(): LatLngBounds | undefined;
/**
* Get the compound plus code associated with the location
*
* @returns {string}
*/
getCompoundPlusCode(): string;
/**
* Gets the formatted address for the location.
*
* @returns {string}
*/
getFormattedAddress(): string;
/**
* Get the latitude of the location.
*
* This is a shorcut to getting the geometry location latitude.
*
* @returns {number|undefined}
*/
getLatitude(): number;
/**
* Gets the LatLng object for the result
*
* @returns {LatLng|undefined}
*/
getLocation(): LatLng | undefined;
/**
* Gets the location type
*
* @returns {string}
*/
getLocationType(): string;
/**
* Get the longitude of the location.
*
* This is a shorcut to getting the geometry location longitude.
*
* @returns {number|undefined}
*/
getLongitude(): number;
/**
* Get the place id for the location.
*
* @returns {string}
*/
getPlaceId(): string;
/**
* Get the plus code associated with the location
*
* @returns {string}
*/
getPlusCode(): string;
/**
* Gets the postal code localities for the location.
*
* This is only populated when the result is a postal code that contains multiple localities.
*
* @returns {string[]}
*/
getPostalCodeLocalities(): string[];
/**
* Gets the types object for the returned geocoded element.
*
* https://developers.google.com/maps/documentation/javascript/geocoding?hl=en#GeocodingAddressTypes
*
* @returns {GeocodeAddressTypes}
*/
getTypes(): GeocodeAddressTypes;
/**
* Gets the types for the returned geocoded element.
*
* https://developers.google.com/maps/documentation/javascript/geocoding?hl=en#GeocodingAddressTypes
*
* @returns {string[]}
*/
getTypesArray(): string[];
/**
* Returns if the location is an approximate location.
*
* @returns {boolean}
*/
isLocationApproximate(): boolean;
/**
* Returns if the location is a geometic center of a result.
*
* @returns {boolean}
*/
isLocationGeometricCenter(): boolean;
/**
* Returns if the location is an approximation interpolated between two precise locations.
*
* @returns {boolean}
*/
isLocationRangeInterpolated(): boolean;
/**
* Returns if the location is a rooftop location, which is the most precise location available.
*
* @returns {boolean}
*/
isLocationRooftop(): boolean;
/**
* Returns if the location is a partial match for the original request.
*
* @returns {boolean}
*/
isPartialMatch(): boolean;
/**
* Get the original Google Maps GeocoderResult object
*
* If the result is empty, an empty object is returned.
*
* @returns {google.maps.GeocoderResult | object}
*/
toGoogle(): google.maps.GeocoderResult | object;
}
/**
* The geocode result class
*
* This is intended to be an internal class and not instantiated directly outside this library.
* It is used to wrap the array of Google Maps GeocoderResult objects and hold them as GeocodeResult objects.
*/
declare class GeocodeResults extends Base {
#private;
/**
* Constructor
*
* @param {google.maps.GeocoderResult[]} [results] The Google Maps GeocoderResult objects
*/
constructor(results?: google.maps.GeocoderResult[]);
/**
* Gets the first result
*
* @returns {GeocodeResult}
*/
getFirst(): GeocodeResult;
/**
* Returns the results
*
* @returns {GeocodeResult[]}
*/
getResults(): GeocodeResult[];
/**
* Returns whether any results were found
*
* @returns {boolean}
*/
hasResults(): boolean;
}
type GeocodeComponentRestrictions = {
administrativeArea?: string;
country?: string;
locality?: string;
postalCode?: string;
route?: string;
};
type GeocodeOptions = {
address?: string;
bounds?: LatLngBoundsValue;
componentRestrictions?: GeocodeComponentRestrictions;
language?: string;
location?: LatLngValue;
placeId?: string;
region?: string;
};
/**
* The Geocode class
*/
declare class Geocode extends Base {
#private;
/**
* Constructor
*
* @param {GeocodeOptions} [options] The Geocode options
*/
constructor(options: GeocodeOptions);
/**
* Returns the address
*
* @returns {string|undefined}
*/
get address(): string | undefined;
/**
* Sets the address to geocode
*
* @param {string} address The address to geocode
*/
set address(address: string);
/**
* Returns the bounds
*
* @returns {LatLngBounds|undefined}
*/
get bounds(): LatLngBounds | undefined;
/**
* Sets the bounds within which to bias geocode results more prominently
*
* @param {LatLngBoundsValue} bounds The bounds within which to bias geocode results more prominently
*/
set bounds(bounds: LatLngBoundsValue);
/**
* Get the component restrictions
*
* @returns {GeocodeComponentRestrictions|undefined}
*/
get componentRestrictions(): GeocodeComponentRestrictions | undefined;
/**
* Set the component restrictions
*
* @param {GeocodeComponentRestrictions} componentRestrictions The component restrictions
*/
set componentRestrictions(componentRestrictions: GeocodeComponentRestrictions);
/**
* Get the language to use for the geocode
*
* @returns {string|undefined}
*/
get language(): string | undefined;
/**
* Set the language to use for the geocode
*
* See https://developers.google.com/maps/faq#languagesupport for the list of supported languages
*
* @param {string} language The language to use for the geocode
*/
set language(language: string);
/**
* Get the location to geocode
*
* @returns {LatLng|undefined}
*/
get location(): LatLng | undefined;
/**
* Set the location to geocode
*
* @param {LatLngValue} location The location to geocode
*/
set location(location: LatLngValue);
/**
* Get the place id
*
* @returns {string|undefined}
*/
get placeId(): string | undefined;
/**
* Set the place id
*
* @param {string} placeId The place id
*/
set placeId(placeId: string);
/**
* Get the region code
*
* @returns {string|undefined}
*/
get region(): string | undefined;
/**
* Set the region code
*
* @param {string} region The region code
*/
set region(region: string);
/**
* Call the Google Maps Geocoder service
*
* Alias for the geocode method
*
* @param {GeocodeOptions} [options] The Geocode options
* @returns {Promise}
*/
fetch(options?: GeocodeOptions): Promise;
/**
* Call the Google Maps Geocoder service
*
* @param {GeocodeOptions} [options] The Geocode options
* @returns {Promise}
*/
geocode(options?: GeocodeOptions): Promise;
/**
* Set the address to geocode
*
* @param {string} address The address to geocode
* @returns {Geocode}
*/
setAddress(address: string): Geocode;
/**
* Set the bounds within which to bias geocode results more prominently
*
* @param {LatLngBoundsValue} bounds The bounds within which to bias geocode results more prominently
* @returns {Geocode}
*/
setBounds(bounds: LatLngBoundsValue): Geocode;
/**
* Set the component restrictions
*
* @param {GeocodeComponentRestrictions} componentRestrictions The component restrictions
* @returns {Geocode}
*/
setComponentRestrictions(componentRestrictions: GeocodeComponentRestrictions): Geocode;
/**
* Set the language to use for the geocode
* See https://developers.google.com/maps/faq#languagesupport for the list of supported languages
*
* @param {string} language The language to use for the geocode
* @returns {Geocode}
*/
setLanguage(language: string): Geocode;
/**
* Set the location to geocode
*
* @param {LatLngValue} location The location to geocode
* @returns {Geocode}
*/
setLocation(location: LatLngValue): Geocode;
/**
* Set the place id
*
* @param {string} placeId The place id
* @returns {Geocode}
*/
setPlaceId(placeId: string): Geocode;
/**
* Set the region code
*
* @param {string} region The region code
* @returns {Geocode}
*/
setRegion(region: string): Geocode;
/**
* Sets the options for the popup
*
* @param {GeocodeOptions} options Geocode options
* @returns {Geocode}
*/
setOptions(options: GeocodeOptions): Geocode;
}
type GeocodeValue = Geocode | GeocodeOptions;
/**
* Helper function to set up a new Geocode object value
*
* @param {GeocodeValue} [options] The options for the Geocode object
* @returns {Geocode}
*/
declare const geocode: (options?: GeocodeValue) => Geocode;
/**
* Returns if the value is boolean
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isBoolean: (thing: any) => thing is boolean;
/**
* Tests to see if the value is defined
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isDefined: (thing: any) => thing is T;
/**
* Returns if the thing is a function
*
* @param {any} thing The thing to test
* @returns {boolean}
*/
declare const isFunction: (thing: any) => thing is Function;
/**
* Returns if the value is null.
*
* @param {any} thing The thing to test
* @returns {boolean}
*/
declare const isNull: (thing: any) => thing is null;
/**
* Returns if the value is a valid number
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isNumber: (thing: any) => thing is number;
/**
* Returns if the given value is a string that represents a numerical value
* e.g. returns true for `"34"` and false for `"text34"` and `34`
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isNumberString: (thing: any) => thing is string;
/**
* Returns if the given value is a number or string that represents a numerical value
* e.g. returns true for 34 or "34" and false for "text34" and "text"
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isNumberOrNumberString: (thing: any) => thing is number | string;
/**
* Returns if the value is a string
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isString: (thing: any) => thing is string;
/**
* Returns if the value is string and has a length greater than 0
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isStringWithValue: (thing: any) => thing is string;
/**
* Returns if the value is a valid string or number
*
* @param {unknown} thing The value to test against
* @returns {boolean}
*/
declare const isStringOrNumber: (thing: unknown) => thing is string | number;
/**
* Returns if the value is undefined
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isUndefined: (thing: any) => thing is undefined;
/**
* Returns if the value is null or undefined
*
* @param {any} thing The thing to test
* @returns {boolean}
*/
declare const isNullOrUndefined: (thing: any) => thing is null | undefined;
/**
* Get the number value for the given thing
* If the thing is a number, return it
* If the thing is a string that represents a number, return the number
* Otherwise, return NaN
*
* @param {any} thing The value to convert to a number
* @returns {number|typeof NaN}
*/
declare const getNumber: (thing: any) => number | typeof NaN;
/**
* Converts a value to a boolean
*
* The following values are considered true:
* - true (boolean)
* - 'true' (string)
* - 'yes'
* - 1 (number)
* - '1' (string)
*
* @param {any} thing The value to convert to a boolean
* @returns {boolean}
*/
declare const getBoolean: (thing: any) => boolean;
/**
* Returns if the value is an object
*
* https://attacomsian.com/blog/javascript-check-variable-is-object
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isObject: (thing: any) => thing is T;
/**
* Returns if the value is an object
*
* https://attacomsian.com/blog/javascript-check-variable-is-object
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isObjectWithValues: (thing: any) => thing is T;
/**
* Returns if the thing is a Promise function
*
* It's assumed to be a promise if the thing exists and "thing.then" is a function
*
* @param {any} thing The value to test
* @returns {boolean}
*/
declare const isPromise: (thing: any) => thing is Promise;
/**
* Get the pixel location of the element from the LagLng value
*
* @param {google.maps.Map} map The Google map object
* @param {google.maps.LatLng} position The Google maps LatLng object
* @returns {google.maps.Point}
*/
declare const getPixelsFromLatLng: (map: google.maps.Map, position: google.maps.LatLng) => google.maps.Point;
/**
* Checks to see if Google maps has been loaded
*
* @param {string} object The object that needs Google maps
* @param {string} [library] An optional Google maps library class to check for. This needs to be part of the google.maps object
* @param {boolean} [throwError] An optional flag to throw an error if the Google maps library is not loaded
* @returns {boolean}
*/
declare const checkForGoogleMaps: (object: string, library?: string, throwError?: boolean) => boolean;
/**
* Get the size value with a unit
*
* @param {number|string} value The value to check
* @param {string} defaultUnit The unit to use if the value is a number or a string that does not have a unit
* @param {string[]} allowedUnits The allowed unites.
* @param {boolean} allowNegative If the number can be negative
* @returns {string|boolean} The value with the unit or false if the value is invalid
*/
declare const getSizeWithUnit: (value: string | number, defaultUnit?: string, allowedUnits?: string[], allowNegative?: boolean) => boolean | string;
/**
* Compare two objects to see if they are equal
*
* @param {any} a The first object to compare
* @param {any} b The second object to compare
* @returns {boolean}
*/
declare const objectEquals: (a: any, b: any) => boolean;
/**
* Tests to see if the object is a valid object and if the key is a valid key
*
* @param {any} obj The object to test
* @param {string} key The object key to test
* @returns {boolean}
*/
declare const objectHasValue: (obj: any, key: string) => boolean;
/**
* Call the callback function if it is a function
*
* @param {Function|undefined} callback The callback function to call
* @param {any[]} args The arguments to pass to the callback function
*/
declare const callCallback: (callback: Function | undefined, ...args: any[]) => void;
/**
* Calculate the dimensions of the container based on the image aspect ratio
*
* @param {number} aspectRatio The aspect ratio of the image
* @param {number} width The width of the container
* @param {number} height The height of the container
* @returns {object} The new width and height of the container
*/
declare const calculateDimensions: (aspectRatio: number, width: number, height: number) => {
width: number;
height: number;
};
type AutocompleteSearchBoxOptions = {
bounds?: LatLngBoundsValue;
input: string | HTMLInputElement;
countryRestriction?: string | string[];
fields?: string[];
strictBounds?: boolean;
types?: string[];
};
type AutocompleteSearchBoxEvent = 'place_changed';
type AutocompleteSearchBoxEventObject = Event & {
place: google.maps.places.PlaceResult;
bounds: LatLngBounds;
};
type AutocompleteSearchBoxEventCallback = (event: AutocompleteSearchBoxEventObject) => void;
/**
* The AutocompleteSearchBox class
*/
declare class AutocompleteSearchBox extends Evented {
#private;
/**
* Constructor
*
* @param {string | HTMLInputElement | AutocompleteSearchBoxOptions} input The input reference or the options
* @param {AutocompleteSearchBoxOptions} [options] The places autocomplete search box options if the input is reference to the input element
*/
constructor(input: string | HTMLInputElement | AutocompleteSearchBoxOptions, options?: AutocompleteSearchBoxOptions);
/**
* Get the bounds to which query predictions are biased.
*
* @returns {LatLngBounds | undefined}
*/
get bounds(): LatLngBounds | undefined;
/**
* Sets the region to use for biasing query predictions.
*
* Results will only be biased towards this area and not be completely restricted to it.
*
* @param {LatLngBoundsValue} value The bounds to set
*/
set bounds(value: LatLngBoundsValue);
/**
* Sets the country or countries to use for biasing query predictions.
*
* @param {string | string[] | null} value The country restriction to set
*/
set countryRestriction(value: string | string[] | null);
/**
* Get the country or countries to use for biasing query predictions.
*
* @returns {string | string[] | null}
*/
get countryRestriction(): string | string[] | null;
/**
* Set the fields to be included for the Place in the details response when the details are successfully retrieved.
*
* @param {string | string[]} value The fields to set
*/
set fields(value: string | string[]);
/**
* Get the fields to be included for the Place in the details response when the details are successfully retrieved.
*
* @returns {string[]}
*/
get fields(): string[];
/**
* Get the input reference
*
* @returns {HTMLInputElement | undefined}
*/
get input(): HTMLInputElement | undefined;
/**
* Set the input reference
*
* @param {string | HTMLInputElement} value The input HTMLInputElement or the selector for the input element
*/
set input(value: string | HTMLInputElement);
/**
* Get whether the Autocomplete widget should only return those places that are inside the bounds of the Autocomplete widget at the time the query is sent.
*
* @returns {boolean}
*/
get strictBounds(): boolean;
/**
* Set 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.
*
* @param {boolean} value The value to set
*/
set strictBounds(value: boolean);
/**
* Get the types of predictions to be returned.
*
* @returns {string[] | undefined}
*/
get types(): string[] | undefined;
/**
* Set the types of predictions to be returned.
*
* To clear the types set it to null.
*
* @param {string | string[] | null} value The types to set
*/
set types(value: null | string | string[]);
/**
* Get the bounds to which query predictions are biased.
*
* @returns {LatLngBounds | undefined}
*/
getBounds(): LatLngBounds | undefined;
/**
* Get the country or countries to use for biasing query predictions.
*
* @returns {string | string[] | null}
*/
getCountryRestriction(): string | string[] | null;
/**
* Get the fields to be included for the Place in the details response when the details are successfully retrieved.
*
* @returns {string[]}
*/
getFields(): string[];
/**
* Get the HTML input element reference
*
* @returns {HTMLInputElement | undefined}
*/
getInput(): HTMLInputElement | undefined;
/**
* Gets the place that has been found
*
* The results from the place_changed event is one place and it's the place that the user clicked on.
*
* @returns {google.maps.places.PlaceResult | undefined}
*/
getPlace(): google.maps.places.PlaceResult | undefined;
/**
* Get the map bounds based on the place that has been found.
*
* @returns {LatLngBounds|undefined}
*/
getPlaceBounds(): LatLngBounds | undefined;
/**
* Get whether the Autocomplete widget should only return those places that are inside the bounds of the Autocomplete widget at the time the query is sent.
*
* @returns {boolean}
*/
getStrictBounds(): boolean;
/**
* Get the types of predictions to be returned.
*
* @returns {string[] | undefined}
*/
getTypes(): string[] | undefined;
/**
* Initialize the places search box object
*
* This must be called in order for the places search box to work.
*
* @returns {Promise}
*/
init(): Promise;
/**
* Returns whether the places search box object has been initialized
*
* @returns {boolean}
*/
isInitialized(): boolean;
/**
* @inheritdoc
*/
hasListener(type: AutocompleteSearchBoxEvent, callback?: AutocompleteSearchBoxEventCallback): boolean;
/**
* @inheritdoc
*/
off(type?: AutocompleteSearchBoxEvent, callback?: AutocompleteSearchBoxEventCallback, options?: EventListenerOptions): void;
/**
* @inheritdoc
*/
on(type: AutocompleteSearchBoxEvent, callback: AutocompleteSearchBoxEventCallback, config?: EventConfig): void;
/**
* @inheritdoc
*/
onImmediate(type: AutocompleteSearchBoxEvent, callback: AutocompleteSearchBoxEventCallback, config?: EventConfig): void;
/**
* Listen for the place changed event
*
* @example
* autocompleteSearchBox.onPlaceChanged((place, bounds) => {
* console.log('Place: ', place);
* console.log('Bounds: ', bounds);
* });
* @param {(place: google.maps.places.PlaceResult, bounds: LatLngBounds) => void} callback The callback function
* @returns {void}
*/
onPlaceChanged(callback: (place: google.maps.places.PlaceResult, bounds: LatLngBounds) => void): void;
/**
* @inheritdoc
*/
once(type: AutocompleteSearchBoxEvent, callback?: AutocompleteSearchBoxEventCallback, config?: EventConfig): void;
/**
* @inheritdoc
*/
onceImmediate(type: AutocompleteSearchBoxEvent, callback?: AutocompleteSearchBoxEventCallback, config?: EventConfig): void;
/**
* @inheritdoc
*/
only(type: AutocompleteSearchBoxEvent, callback: AutocompleteSearchBoxEventCallback, config?: EventConfig): void;
/**
* @inheritdoc
*/
onlyOnce(type: AutocompleteSearchBoxEvent, callback: AutocompleteSearchBoxEventCallback, config?: EventConfig): void;
/**
* Sets the region to use for biasing query predictions.
*
* Results will only be biased towards this area and not be completely restricted to it.
*
* @param {LatLngBoundsValue} value The bounds to set
* @returns {AutocompleteSearchBox}
*/
setBounds(value: LatLngBoundsValue): AutocompleteSearchBox;
/**
* Sets the country or countries to use for biasing query predictions.
*
* @param {string|string[]|null} value The country restriction to set
* @returns {AutocompleteSearchBox}
*/
setCountryRestriction(value: string | string[] | null): AutocompleteSearchBox;
/**
* Set the fields to be included for the Place in the details response when the details are successfully retrieved.
*
* @param {string|string[]} value The fields to set
* @returns {AutocompleteSearchBox}
*/
setFields(value: string | string[]): AutocompleteSearchBox;
/**
* Set the input reference
*
* @param {string|HTMLInputElement} input The input HTMLInputElement or the selector for the input element
* @returns {AutocompleteSearchBox}
*/
setInput(input: string | HTMLInputElement): AutocompleteSearchBox;
/**
* Set the places search box options
*
* @param {AutocompleteSearchBoxOptions} options The options to set
* @returns {AutocompleteSearchBox}
*/
setOptions(options: AutocompleteSearchBoxOptions): AutocompleteSearchBox;
/**
* Set whether 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.
*
* @param {boolean} value The value to set
* @returns {AutocompleteSearchBox}
*/
setStrictBounds(value: boolean): AutocompleteSearchBox;
/**
* Set the types of predictions to be returned.
*
* To clear the types set it to null.
*
* @param {string | string[] | null} value The types to set
* @returns {AutocompleteSearchBox}
*/
setTypes(value: null | string | string[]): AutocompleteSearchBox;
}
type AutocompleteSearchBoxValue = HTMLInputElement | string | AutocompleteSearchBox | AutocompleteSearchBoxOptions;
/**
* Helper function to set up the places search box object
*
* @param {AutocompleteSearchBoxValue} [input] The input reference or the options
* @param {AutocompleteSearchBoxOptions} [options] The places search box options
* @returns {AutocompleteSearchBox}
*/
declare const autocompleteSearchBox: (input?: AutocompleteSearchBoxValue, options?: AutocompleteSearchBoxOptions) => AutocompleteSearchBox;
type SizeObject = {
height: number | string;
width: number | string;
};
type WidthSize = number | number[] | string | string[] | SizeObject;
/**
* The Size class to set up and manage width and height values for an element
*/
declare class Size extends Base {
#private;
/**
* Constructor
*
* @param {WidthSize|Size} [width] The X value
* @param {number|string} [height] The Y value
*/
constructor(width?: WidthSize | Size, height?: number | string);
/**
* Get the height value
*
* @returns {number}
*/
get height(): number;
/**
* Set the height value
*
* @param {number|string} height The height value. Ideally it's a number but it could be a number string
*/
set height(height: number | string);
/**
* Get the width value
*
* @returns {number}
*/
get width(): number;
/**
* Set the width value
*
* @param {number|string} width The width value. Ideally it's a number but it could be a number string
*/
set width(width: number | string);
/**
* Returns a new copy of the size
*
* @returns {Size}
*/
clone(): Size;
/**
* Get the height value
*
* @returns {number}
*/
getHeight(): number;
/**
* Get the width value
*
* @returns {number}
*/
getWidth(): number;
/**
* Returns whether the width/height pair are valid values
*
* @returns {boolean}
*/
isValid(): boolean;
/**
* Set the width/height values
*
* @param {WidthSize|Size} width The width value, or the Size object, or an arraheight of [width, height] pairs, or a {width, height} object
* @param {number|string} height The height value
* @returns {Size}
*/
set(width: WidthSize | Size, height?: number | string): Size;
/**
* Set the height value
*
* @param {number|string} height The height value. Ideally it's a number but it could be a number string
* @returns {Size}
*/
setHeight(height: number | string): Size;
/**
* Set the width value
*
* @param {number|string} width The width value. Ideally it's a number but it could be a number string
* @returns {Size}
*/
setWidth(width: number | string): Size;
/**
* Returns the Google maps size object
*
* https://developers.google.com/maps/documentation/javascript/reference/coordinates#Size
*
* @returns {google.maps.Size|null}
*/
toGoogle(): google.maps.Size | null;
}
type SizeValue = Size | number | number[] | string | string[] | SizeObject;
/**
* Helper function to set up the size object
*
* @param {WidthSize} [width] The width value
* @param {number|string} [height] The height value
* @returns {Size}
*/
declare const size: (width?: SizeValue, height?: number | string) => Size;
type IconOptions = {
anchor?: PointValue;
labelOrigin?: PointValue;
origin?: PointValue;
scaledSize?: SizeValue;
size?: SizeValue;
url?: string;
};
/**
* Icon class to set up an icon options for a marker
*/
declare class Icon extends Base {
#private;
/**
* Constructor
*
* @param {string | IconOptions} [url] The URL for the icon or the icon options
* @param {IconOptions} [options] The icon options
*/
constructor(url?: string | IconOptions, options?: IconOptions);
/**
* Set the icon options
*
* @param {IconOptions} options The icon options
* @returns {Icon}
*/
setOptions(options: IconOptions): Icon;
/**
* Set the position at which to anchor an image in correspondence to the location of the marker on the map.
* Use this if for some reason you didn't pass the anchor in the icon options.
*
* By default, the anchor is located along the center point of the bottom of the image.
*
* const icon = G.icon({
* url: 'https://mywebsite.com/images/marker.png',
* });
* icon.setAnchor([10, 32]);
*
* Valid values are:
* icon.setAnchor([10, 32]);
* icon.setAnchor({x: 10, y: 32});
* icon.setAnchor(pointClassInstance);
*
* @param {PointValue} anchor The anchor point value
* @returns {Icon}
*/
setAnchor(anchor: PointValue): Icon;
/**
* Set the origin of the label relative to the top-left corner of the icon image, if a label is supplied by the marker.
* Use this if for some reason you didn't pass the label origin in the icon options.
*
* By default, the origin is located in the center point of the image.
*
* const icon = G.icon({
* url: 'https://mywebsite.com/images/marker.png',
* });
* icon.setLabelOrigin([10, 32]);
*
* Valid values are:
* icon.setLabelOrigin([10, 32]);
* icon.setLabelOrigin({x: 10, y: 32});
* icon.setLabelOrigin(pointClassInstance);
*
* @param {PointValue} origin The label origin point value
* @returns {Icon}
*/
setLabelOrigin(origin: PointValue): Icon;
/**
* Set 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).
* Use this if for some reason you didn't pass the origin in the icon options.
*
* const icon = G.icon({
* url: 'https://mywebsite.com/images/marker.png',
* });
* icon.setOrigin([10, 32]);
*
* Valid values are:
* icon.setOrigin([10, 32]);
* icon.setOrigin({x: 10, y: 32});
* icon.setOrigin(pointClassInstance);
*
* @param {PointValue} origin The origin point value
* @returns {Icon}
*/
setOrigin(origin: PointValue): Icon;
/**
* Set the scaled size of the icon. Use this if for some reason you didn't pass the scaled size in the icon options.
*
* The size of the entire image after scaling, if any. Use this property to stretch/shrink an image or a sprite.
*
* const icon = G.icon({
* url: 'https://mywebsite.com/images/marker.png',
* });
* icon.setSize([40, 64]).setScaledSize([20, 32]));
*
* Valid values are:
* icon.setScaledSize([10, 32]);
* icon.setScaledSize({x: 10, y: 32});
* icon.setScaledSize(sizeClassInstance);
*
* @param {SizeValue} sizeValue The size value
* @returns {Icon}
*/
setScaledSize(sizeValue: SizeValue): Icon;
/**
* Set the size of the icon. Use this if for some reason you didn't pass the size in the icon options.
*
* When using sprites, you must specify the sprite size. If the size is not provided, it will be set when the image loads.
*
* const icon = G.icon({
* url: 'https://mywebsite.com/images/marker.png',
* });
* icon.setSize([20, 32]);
*
* Valid values are:
* icon.setSize([10, 32]);
* icon.setSize({x: 10, y: 32});
* icon.setSize(sizeClassInstance);
*
* If you're using an SVG you should set a size if the desired size is different from the height and width attributes of the SVG.
*
* @param {SizeValue} sizeValue The size value
* @returns {Icon}
*/
setSize(sizeValue: SizeValue): Icon;
/**
* Set the icon URL
*
* @param {string} url The icon URL
* @returns {Icon}
*/
setUrl(url: string): Icon;
/**
* Get the icon options
*
* @returns {google.maps.Icon}
*/
toGoogle(): google.maps.Icon;
}
type IconValue = Icon | string | IconOptions;
/**
* Helper function to set up the icon object
*
* @param {IconValue} [url] The URL for the icon, the icon object, or the icon options
* @param {IconOptions} [options] The options for the icon
* @returns {Icon}
*/
declare const icon: (url?: IconValue, options?: IconOptions) => Icon;
type FullscreenControlOptions = {
enabled?: boolean;
position?: ControlPositionValue;
};
/**
* Fullscreen control class
*/
declare class FullscreenControl {
#private;
/**
* Class constructor
*
* @param {FullscreenControlOptions | boolean} [options] Either the FullscreenControl options or a boolean value to disable the control.
*/
constructor(options?: FullscreenControlOptions | boolean);
/**
* Get whether the Fullscreen control is enabled.
*
* @returns {boolean}
*/
get enabled(): boolean;
/**
* Set whether the Fullscreen control is enabled.
*
* @param {boolean} value The enabled/disabled state
*/
set enabled(value: boolean);
/**
* Get the fullscreen control position
*
* @returns {ControlPosition}
*/
get position(): ControlPositionValue;
/**
* Set the fullscreen control position
*
* @param {ControlPosition} value The position of the control
*/
set position(value: ControlPositionValue);
/**
* Disable the Fullscreen control
*
* @returns {FullscreenControl}
*/
disable(): FullscreenControl;
/**
* Enable the Fullscreen control
*
* @returns {FullscreenControl}
*/
enable(): FullscreenControl;
/**
* Set the position of the control
* https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
*
* @param {ControlPositionValue} position The position of the control
* @returns {FullscreenControl}
*/
setPosition(position: ControlPositionValue): FullscreenControl;
/**
* Get the Fullscreen Control options Google Maps object
*
* @returns {Promise}
*/
toGoogle(): Promise;
}
type FullscreenControlValue = FullscreenControlOptions | boolean | FullscreenControl;
/**
* Helper function to set up the FullscreenControl object
*
* @param {FullscreenControlValue} options The FullscreenControl options, a boolean value to disable the control, or a FullscreenControl object.
* @returns {FullscreenControl}
*/
declare const fullscreenControl: (options?: FullscreenControlValue) => FullscreenControl;
type MapRestrictionOptions = {
enabled?: boolean;
latLngBounds?: LatLngBoundsValue;
strictBounds?: boolean;
};
/**
* MapRestriction class
*/
declare class MapRestriction {
#private;
/**
* Class constructor
*
* @param {MapRestrictionOptions | LatLngBoundsValue | boolean} [options] Either the MapRestriction options just the LatLng bounds value.
*/
constructor(options?: MapRestrictionOptions | LatLngBoundsValue | boolean);
/**
* Get whether the MapRestriction object is enabled
*
* @returns {boolean}
*/
get enabled(): boolean;
/**
* Set whether the MapRestriction object is enabled
*
* @param {boolean} value Whether the MapRestriction object is enabled
*/
set enabled(value: boolean);
/**
* Get the existing latitude/longitude bounds
*
* @returns {LatLngBounds | undefined}
*/
get latLngBounds(): LatLngBounds;
/**
* Set the latitude/longitude bounds
*
* @param {LatLngBoundsValue} value The lat/lng bounds value
*/
set latLngBounds(value: LatLngBoundsValue);
/**
* Get whether the bounds are strict
*
* @returns {boolean}
*/
get strictBounds(): boolean;
/**
* Set whether the bounds are strict
*
* @param {boolean} value Whether the bounds are strict
*/
set strictBounds(value: boolean);
/**
* Disable the map restriction
*
* @returns {MapRestriction}
*/
disable(): MapRestriction;
/**
* Enable the map restriction
*
* @returns {MapRestriction}
*/
enable(): MapRestriction;
/**
* Returns whether the MapRestriction object is enabled
*
* @returns {boolean}
*/
isEnabled(): boolean;
/**
* Returns if the MapRestriction object is valid
*
* @returns {boolean}
*/
isValid(): boolean;
/**
* Set the latitude/longitude bounds
*
* @param {LatLngBoundsValue} value The lat/lng bounds value
* @returns {MapRestriction}
*/
setLatLngBounds(value: LatLngBoundsValue): MapRestriction;
/**
* Set whether the bounds are strict
*
* @param {boolean} value Whether the bounds are strict
* @returns {MapRestriction}
*/
setStrictBounds(value: boolean): MapRestriction;
/**
* Get the MapRestriction Google Maps object
*
* @returns {Promise}
*/
toGoogle(): Promise;
}
type MapRestrictionValue = MapRestrictionOptions | LatLngBoundsValue | MapRestriction | boolean;
/**
* Helper function to set up the MapRestriction object
*
* @param {MapRestrictionValue} options The MapRestriction options, a LatLngBounds value, or a MapRestriction object.
* @returns {MapRestriction}
*/
declare const mapRestriction: (options?: MapRestrictionValue) => MapRestriction;
type MapTypeControlOptions = {
enabled?: boolean;
mapTypeIds?: MapTypeIdValue[];
position?: ControlPositionValue;
style?: MapTypeControlStyleValue;
};
/**
* Map Type control class
*/
declare class MapTypeControl {
#private;
/**
* Class constructor
*
* @param {MapTypeControlOptions | boolean} [options] Either the MapTypeControl options or a boolean value to disable the control.
*/
constructor(options?: MapTypeControlOptions | boolean);
/**
* Get whether the Map Type control is enabled.
*
* @returns {boolean}
*/
get enabled(): boolean;
/**
* Set whether the Map Type control is enabled.
*
* @param {boolean} value The enabled/disabled state
*/
set enabled(value: boolean);
/**
* Get whether the hybrid map type is enabled
*
* @returns {boolean}
*/
get hybrid(): boolean;
/**
* Set whether the hybrid map type is enabled
*
* @param {boolean} value The enabled/disabled state
*/
set hybrid(value: boolean);
/**
* Get the map type control position
*
* @returns {ControlPosition}
*/
get position(): ControlPositionValue;
/**
* Set the map type control position
*
* @param {ControlPosition} value The position of the control
*/
set position(value: ControlPositionValue);
/**
* Get whether the roadmap map type is enabled
*
* @returns {boolean}
*/
get roadmap(): boolean;
/**
* Set whether the roadmap map type is enabled
*
* @param {boolean} value The enabled/disabled state
*/
set roadmap(value: boolean);
/**
* Get whether the satellite map type is enabled
*
* @returns {boolean}
*/
get satellite(): boolean;
/**
* Set whether the satellite map type is enabled
*
* @param {boolean} value The enabled/disabled state
*/
set satellite(value: boolean);
/**
* Get the map type control style
*
* @returns {MapTypeControlStyle}
*/
get style(): MapTypeControlStyleValue;
/**
* Set the map type control style
*
* @param {MapTypeControlStyleValue} value The style of the control
*/
set style(value: MapTypeControlStyleValue);
/**
* Get whether the terrain map type is enabled
*
* @returns {boolean}
*/
get terrain(): boolean;
/**
* Set whether the terrain map type is enabled
*
* @param {boolean} value The enabled/disabled state
*/
set terrain(value: boolean);
/**
* Disable the Map Type control
*
* @returns {MapTypeControl}
*/
disable(): MapTypeControl;
/**
* Enable the Map Type control
*
* @returns {MapTypeControl}
*/
enable(): MapTypeControl;
/**
* Returns whether the Map Type control is using the map type id
*
* @param {MapTypeIdValue} mapTypeId The map type id to check
* @returns {boolean}
*/
hasMapType(mapTypeId: MapTypeIdValue): boolean;
/**
* Set the map type ids to include in the control
*
* @param {MapTypeIdValue[]} mapTypeIds The map type ids to include in the control
* @returns {MapTypeControl}
*/
setMapTypeIds(mapTypeIds: MapTypeIdValue[]): MapTypeControl;
/**
* Set the position of the control
* https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
*
* @param {ControlPositionValue} position The position of the control
* @returns {MapTypeControl}
*/
setPosition(position: ControlPositionValue): MapTypeControl;
/**
* Set the style of the control
* https://developers.google.com/maps/documentation/javascript/reference/control#MapTypeControlStyle
*
* @param {MapTypeControlStyleValue} style The style of the control
* @returns {MapTypeControl}
*/
setStyle(style: MapTypeControlStyleValue): MapTypeControl;
/**
* Get the MapTypeControl options Google Maps object
*
* @returns {Promise}
*/
toGoogle(): Promise;
}
type MapTypeControlValue = MapTypeControlOptions | boolean | MapTypeControl;
/**
* Helper function to set up the MapTypeControl object
*
* @param {MapTypeControlValue} options The MapTypeControl options, a boolean value to disable the control, or a MapTypeControl object.
* @returns {MapTypeControl}
*/
declare const mapTypeControl: (options?: MapTypeControlValue) => MapTypeControl;
type Style = {
[key: string]: string | number;
};
type MapStyleOptions = {
elementType?: string;
featureType?: string;
styles?: Style[];
};
/**
* MapStyle class
*/
declare class MapStyle {
#private;
/**
* Class constructor
*
* @param {MapStyleOptions | Style | Style[]} [options] Either the MapStyle options, a single style, or an array of styles
*/
constructor(options?: MapStyleOptions | Style | Style[]);
/**
* Get the element type to apply styles to
*
* @returns {string}
*/
get elementType(): string;
/**
* Set the element type to apply styles to
*
* @param {string} value The element type to apply values to
*/
set elementType(value: string);
/**
* Get the feature type to apply styles to
*
* @returns {string}
*/
get featureType(): string;
/**
* Set the feature type to apply styles to
*
* @param {string} value The feature type to apply values to
*/
set featureType(value: string);
/**
* Get the styles to apply to the map
*
* @returns {Style[]}
*/
get styles(): Style[];
/**
* Set the styles to apply to the map
*
* @param {Style | Style[]} value The style or styles to apply to the map
*/
set styles(value: Style | Style[]);
/**
* Add a style to the list of styles to apply
*
* Example:
* styles.addStyle('color', 'red');
* styles.addStyle('weight', 2);
*
* @param {string} property The style property.
* @param {string | number} value The style value.
* @returns {MapStyle}
*/
addStyle(property: string, value: string | number): MapStyle;
/**
* Set the element type to apply styles to
*
* @param {string} value The element type to apply values to
* @returns {MapStyle}
*/
setElementType(value: string): MapStyle;
/**
* Set the feature type to apply styles to
*
* @param {string} value The feature type to apply values to
* @returns {MapStyle}
*/
setFeatureType(value: string): MapStyle;
/**
* Set the styles to apply to the map
*
* @param { Style|Style[]} value The style or styles to apply to the map
* @returns {MapStyle}
*/
setStyles(value: Style | Style[]): MapStyle;
/**
* Get the MapTypeStyle Google Maps object
*
* @returns {google.maps.MapTypeStyle}
*/
toGoogle(): google.maps.MapTypeStyle;
}
type MapStyleValue = MapStyleOptions | Style | Style[] | MapStyle;
/**
* Helper function to set up the MapStyle object
*
* @param {MapStyleValue} options The MapStyle options, a single style object, an array of styles, or a MapStyle object.
* @returns {MapStyle}
*/
declare const mapStyle: (options?: MapStyleValue) => MapStyle;
type RotateControlOptions = {
enabled?: boolean;
position?: ControlPositionValue;
};
/**
* Rotate control class
*/
declare class RotateControl {
#private;
/**
* Class constructor
*
* @param {RotateControlOptions | boolean} [options] Either the RotateControl options or a boolean value to disable the control.
*/
constructor(options?: RotateControlOptions | boolean);
/**
* Get whether the Rotate control is enabled.
*
* @returns {boolean}
*/
get enabled(): boolean;
/**
* Set whether the Rotate control is enabled.
*
* @param {boolean} value The enabled/disabled state
*/
set enabled(value: boolean);
/**
* Get the rotate control position
*
* @returns {ControlPosition}
*/
get position(): ControlPositionValue;
/**
* Set the rotate control position
*
* @param {ControlPosition} value The position of the control
*/
set position(value: ControlPositionValue);
/**
* Disable the Rotate control
*
* @returns {RotateControl}
*/
disable(): RotateControl;
/**
* Enable the Rotate control
*
* @returns {RotateControl}
*/
enable(): RotateControl;
/**
* Set the position of the control
* https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
*
* @param {ControlPositionValue} position The position of the control
* @returns {RotateControl}
*/
setPosition(position: ControlPositionValue): RotateControl;
/**
* Get the Rotate Control options Google Maps object
*
* @returns {Promise}
*/
toGoogle(): Promise;
}
type RotateControlValue = RotateControlOptions | boolean | RotateControl;
/**
* Helper function to set up the RotateControl object
*
* @param {RotateControlValue} options The RotateControl options, a boolean value to disable the control, or a RotateControl object.
* @returns {RotateControl}
*/
declare const rotateControl: (options?: RotateControlValue) => RotateControl;
type ScaleControlOptions = {
enabled?: boolean;
};
/**
* Scale control class
*/
declare class ScaleControl {
#private;
/**
* Class constructor
*
* @param {ScaleControlOptions | boolean} [options] Either the ScaleControl options or a boolean value to disable the control.
*/
constructor(options?: ScaleControlOptions | boolean);
/**
* Get whether the Scale control is enabled.
*
* @returns {boolean}
*/
get enabled(): boolean;
/**
* Set whether the Scale control is enabled.
*
* @param {boolean} value The enabled/disabled state
*/
set enabled(value: boolean);
/**
* Disable the Scale control
*
* @returns {ScaleControl}
*/
disable(): ScaleControl;
/**
* Enable the Scale control
*
* @returns {ScaleControl}
*/
enable(): ScaleControl;
/**
* Get the Scale Control options Google Maps object
*
* @returns {Promise}
*/
toGoogle(): Promise;
}
type ScaleControlValue = ScaleControlOptions | boolean | ScaleControl;
/**
* Helper function to set up the ScaleControl object
*
* @param {ScaleControlValue} options The ScaleControl options, a boolean value to disable the control, or a ScaleControl object.
* @returns {ScaleControl}
*/
declare const scaleControl: (options?: ScaleControlValue) => ScaleControl;
type StreetViewControlOptions = {
enabled?: boolean;
position?: ControlPositionValue;
sources?: StreetViewSourceValue | StreetViewSourceValue[];
};
/**
* StreetView control class
*/
declare class StreetViewControl {
#private;
/**
* Class constructor
*
* @param {StreetViewControlOptions | boolean} [options] Either the StreetViewControl options or a boolean value to disable the control.
*/
constructor(options?: StreetViewControlOptions | boolean);
/**
* Get whether the StreetView control is enabled.
*
* @returns {boolean}
*/
get enabled(): boolean;
/**
* Set whether the StreetView control is enabled.
*
* @param {boolean} value The enabled/disabled state
*/
set enabled(value: boolean);
/**
* Get the street view control position
*
* @returns {ControlPosition}
*/
get position(): ControlPositionValue;
/**
* Set the street view control position
*
* @param {ControlPosition} value The position of the control
*/
set position(value: ControlPositionValue);
/**
* Get the sources of the street view control
*
* @returns {StreetViewSourceValue[]}
*/
get sources(): StreetViewSourceValue[];
/**
* Set the sources of the street view control
*
* @param {StreetViewSourceValue | StreetViewSourceValue[]} value The source or sources of the street view control
*/
set sources(value: StreetViewSourceValue | StreetViewSourceValue[]);
/**
* Disable the StreetView control
*
* @returns {StreetViewControl}
*/
disable(): StreetViewControl;
/**
* Enable the StreetView control
*
* @returns {StreetViewControl}
*/
enable(): StreetViewControl;
/**
* Set the position of the control
* https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
*
* @param {ControlPositionValue} position The position of the control
* @returns {StreetViewControl}
*/
setPosition(position: ControlPositionValue): StreetViewControl;
/**
* Set the sources of the street view control
*
* @param {StreetViewSourceValue | StreetViewSourceValue[]} sources The source or sources of the street view control
* @returns {StreetViewControl}
*/
setSources(sources: StreetViewSourceValue | StreetViewSourceValue[]): StreetViewControl;
/**
* Get the StreetView Control options Google Maps object
*
* @returns {Promise}
*/
toGoogle(): Promise;
}
type StreetViewControlValue = StreetViewControlOptions | boolean | StreetViewControl;
/**
* Helper function to set up the StreetViewControl object
*
* @param {StreetViewControlValue} options The StreetViewControl options, a boolean value to disable the control, or a StreetViewControl object.
* @returns {StreetViewControl}
*/
declare const streetViewControl: (options?: StreetViewControlValue) => StreetViewControl;
type ZoomControlOptions = {
enabled?: boolean;
position?: ControlPositionValue;
};
/**
* Zoom control class
*/
declare class ZoomControl {
#private;
/**
* Class constructor
*
* @param {ZoomControlOptions | boolean} [options] Either the ZoomControl options or a boolean value to disable the control.
*/
constructor(options?: ZoomControlOptions | boolean);
/**
* Get whether the Zoom control is enabled.
*
* @returns {boolean}
*/
get enabled(): boolean;
/**
* Set whether the Zoom control is enabled.
*
* @param {boolean} value The enabled/disabled state
*/
set enabled(value: boolean);
/**
* Get the zoom control position
*
* @returns {ControlPosition}
*/
get position(): ControlPositionValue;
/**
* Set the zoom control position
*
* @param {ControlPosition} value The position of the control
*/
set position(value: ControlPositionValue);
/**
* Disable the Zoom control
*
* @returns {ZoomControl}
*/
disable(): ZoomControl;
/**
* Enable the Zoom control
*
* @returns {ZoomControl}
*/
enable(): ZoomControl;
/**
* Set the position of the control
* https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
*
* @param {ControlPositionValue} position The position of the control
* @returns {ZoomControl}
*/
setPosition(position: ControlPositionValue): ZoomControl;
/**
* Get the Zoom Control options Google Maps object
*
* @returns {Promise}
*/
toGoogle(): Promise;
}
type ZoomControlValue = ZoomControlOptions | boolean | ZoomControl;
/**
* Helper function to set up the ZoomControl object
*
* @param {ZoomControlValue} options The ZoomControl options, a boolean value to disable the control, or a ZoomControl object.
* @returns {ZoomControl}
*/
declare const zoomControl: (options?: ZoomControlValue) => ZoomControl;
type MapOptions = {
apiKey?: string;
backgroundColor?: string;
center?: LatLngValue;
clickableIcons?: boolean;
colorScheme?: string;
controlSize?: number;
disableDefaultUI?: boolean;
draggableCursor?: string;
draggingCursor?: string;
fullscreenControl?: boolean | FullscreenControl;
gestureHandling?: string;
heading?: number;
headingInteractionEnabled?: boolean;
isFractionalZoomEnabled?: boolean;
keyboardShortcuts?: boolean;
lat?: number | string;
latitude?: number | string;
libraries?: Libraries;
lng?: number | string;
longitude?: number | string;
mapId?: string;
mapTypeControl?: boolean | MapTypeControl;
mapTypeId?: MapTypeIdValue | string;
maxFitBoundsZoom?: number;
maxZoom?: number;
minFitBoundsZoom?: number;
minZoom?: number;
noClear?: boolean;
renderingType?: RenderingTypeValue;
restriction?: MapRestrictionValue;
rotateControl?: boolean | RotateControlValue;
scaleControl?: boolean | ScaleControlValue;
scrollwheel?: boolean;
streetView?: google.maps.StreetViewPanorama;
streetViewControl?: boolean | StreetViewControl;
styles?: MapStyleValue;
tilt?: number;
tiltInteractionEnabled?: boolean;
version?: string;
zoom?: number | string;
zoomControl?: boolean | ZoomControl;
};
type LocateOptions = {
enableHighAccuracy?: boolean;
maximumAge?: number;
timeout?: number;
watch?: boolean;
};
type LocationPosition = {
accuracy?: number;
altitude?: number;
altitudeAccuracy?: number;
heading?: number;
latitude: number;
latLng: LatLng;
longitude: number;
speed?: number;
timestamp: number;
};
type LocationOnSuccess = (position: LocationPosition) => void;
type MapType = 'hybrid' | 'roadmap' | 'satellite' | 'terrain';
type InternalEvent = 'locationerror' | 'locationfound' | 'ready';
type GMEvent = 'bounds_changed' | 'center_changed' | 'click' | 'contextmenu' | 'dblclick' | 'drag' | 'dragend' | 'dragstart' | 'heading_changed' | 'idle' | 'isfractionalzoomenabled_changed' | 'mapcapabilities_changed' | 'maptypeid_changed' | 'mousemove' | 'mouseout' | 'mouseover' | 'projection_changed' | 'renderingtype_changed' | 'tilesloaded' | 'tilt_changed' | 'zoom_changed';
type MapEvent = GMEvent | InternalEvent;
/**
* The map class
*/
declare class Map extends Evented {
#private;
/**
* Class constructor
*
* @param {string|HTMLElement} selector The selector of the element that the map will be rendered in. Or the HTMLElement that the map will be rendered in.
* The selector can be any valid selector for document.querySelector() can be used. Or, it can be an HTML element
* @param {MapOptions} [options] The options object for the map
*/
constructor(selector: string | HTMLElement, options?: MapOptions);
/**
* Get the center point for the map
*
* @returns {LatLng}
*/
get center(): LatLng;
/**
* Set the center point for the map
*
* @param {LatLngValue} value The center point for the map
*/
set center(value: LatLngValue);
/**
* Get whether the default UI is disabled
*
* @returns {boolean}
*/
get disableDefaultUI(): boolean;
/**
* Set whether the default UI is disabled
*
* @param {boolean} value Whether the default UI is disabled
*/
set disableDefaultUI(value: boolean);
/**
* Get the fullscreen control object
*
* @returns {FullscreenControl}
*/
get fullscreenControl(): FullscreenControl;
/**
* Set the fullscreen control object, or whether to display the fullscreen control
*
* @param {boolean|FullscreenControl} value The fullscreen control option
*/
set fullscreenControl(value: boolean | FullscreenControl);
/**
* Get the latitude value for the center point
*
* @returns {number}
*/
get latitude(): number;
/**
* Set the latitude value for the center point
*
* @param {string|number} value The latitude value
*/
set latitude(value: string | number);
/**
* Get the longitude value for the center point
*
* @returns {number}
*/
get longitude(): number;
/**
* Set the longitude value for the center point
*
* @param {string|number} value The longitude value
*/
set longitude(value: string | number);
/**
* Get the map type control object
*
* @returns {MapTypeControl}
*/
get mapTypeControl(): MapTypeControl;
/**
* Set the map type control object, or whether to display the map type control
*
* @param {boolean|MapTypeControl} value The map type control option
*/
set mapTypeControl(value: boolean | MapTypeControl);
/**
* Get the map type ID
*
* @returns {string}
*/
get mapTypeId(): string;
/**
* Set the map type ID
*
* @param {string} value The map type ID
*/
set mapTypeId(value: string);
/**
* Get the maximum zoom level for the map when fitting to bounds
*
* @returns {null|number}
*/
get maxFitBoundsZoom(): null | number;
/**
* Set the maximum zoom level for the map when fitting to bounds
*
* @param {null|number} value The maximum zoom level
*/
set maxFitBoundsZoom(value: null | number);
/**
* Get the maximum zoom level for the map
*
* @returns {null|number}
*/
get maxZoom(): null | number;
/**
* Set the maximum zoom level for the map
*
* @param {null|number} value The maximum zoom level
*/
set maxZoom(value: null | number);
/**
* Get the minimum zoom level for the map when fitting to bounds
*
* @returns {null|number}
*/
get minFitBoundsZoom(): null | number;
/**
* Set the minimum zoom level for the map when fitting to bounds
*
* @param {null|number} value The minimum zoom level
*/
set minFitBoundsZoom(value: null | number);
/**
* Get the minimum zoom level for the map
*
* @returns {null|number}
*/
get minZoom(): null | number;
/**
* Set the minimum zoom level for the map
*
* @param {null|number} value The minimum zoom level
*/
set minZoom(value: null | number);
/**
* Get the MapRestriction object if it's been set
*
* @returns {MapRestriction|undefined}
*/
get restriction(): MapRestriction | undefined;
/**
* Set the MapRestriction value
*
* @param {MapRestrictionValue} value The MapRestriction value
*/
set restriction(value: MapRestrictionValue);
/**
* Get the rotate control object
*
* @returns {RotateControl}
*/
get rotateControl(): RotateControl;
/**
* Set the rotate control object, or whether to display the rotate control
*
* @param {boolean|RotateControl} value The rotate control option
*/
set rotateControl(value: boolean | RotateControl);
/**
* Get the scale control object
*
* @returns {ScaleControl}
*/
get scaleControl(): ScaleControl;
/**
* Set the scale control object, or whether to display the scale control
*
* @param {boolean|ScaleControl} value The scale control option
*/
set scaleControl(value: boolean | ScaleControl);
/**
* Get the street view control object
*
* @returns {StreetViewControl}
*/
get streetViewControl(): StreetViewControl;
/**
* Set the street view control object, or whether to display the scale control
*
* @param {boolean|StreetViewControl} value The scale control option
*/
set streetViewControl(value: boolean | StreetViewControl);
/**
* Get the zoom level for the map
*
* @returns {number}
*/
get zoom(): number;
/**
* Set the zoom level for the map
*
* @param {number|string} value The zoom level
*/
set zoom(value: number | string);
/**
* Get the zoom control object
*
* @returns {ZoomControl}
*/
get zoomControl(): ZoomControl;
/**
* Set the zoom control object, or whether to display the zoom control
*
* @param {boolean|ZoomControl} value The zoom control option
*/
set zoomControl(value: boolean | ZoomControl);
/**
* Adds a custom control to the map
*
* @param {ControlPositionValue} position The position to add the custom control
* @param {HTMLElement} element The HTML element for the custom control
* @returns {Map}
*/
addCustomControl(position: ControlPositionValue, element: HTMLElement): Map;
/**
* Add a value to the map bounds
*
* @param {LatLngValue | LatLngValue[]} value The latitude/longitude value to add to the bounds
* @returns {Map}
*/
addToBounds(value: LatLngValue | LatLngValue[]): Map;
/**
* Clear the existing bounds
*
* @returns {Map}
*/
clearBounds(): Map;
/**
* Enable the default UI
*
* @returns {Map}
*/
enableDefaultUI(): Map;
/**
* Disable the default UI
*
* @returns {Map}
*/
doDisableDefaultUI(): Map;
/**
* Show the map
*
* Alias to show()
*
* @param {Function} callback The callback function to call after the map loads
* @returns {Promise