Options
All
  • Public
  • Public/Protected
  • All
Menu

An overlay that looks like a bubble and is often connected to a marker.

Access by calling const {InfoWindow} = await google.maps.importLibrary("maps") or const {InfoWindow} = await google.maps.importLibrary("streetView"). See https://developers.google.com/maps/documentation/javascript/libraries.

Hierarchy

Index

Constructors

Methods

  • Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with google.maps.event.removeListener.

    Parameters

    • eventName: string
    • handler: Function

    Returns MapsEventListener

  • bindTo(key: string, target: MVCObject, targetKey?: null | string, noNotify?: boolean): void
  • Binds a View to a Model.

    Parameters

    • key: string
    • target: MVCObject
    • Optional targetKey: null | string
    • Optional noNotify: boolean

    Returns void

  • close(): void
  • Closes this InfoWindow by removing it from the DOM structure.

    Returns void

  • focus(): void
  • Sets focus on this InfoWindow. You may wish to consider using this method along with a visible event to make sure that InfoWindow is visible before setting focus on it. An InfoWindow that is not visible cannot be focused.

    Returns void

  • get(key: string): any
  • Gets a value.

    Parameters

    • key: string

    Returns any

  • getContent(): undefined | null | string | Element | Text
  • Returns undefined | null | string | Element | Text

  • getPosition(): undefined | null | LatLng
  • Returns undefined | null | LatLng

  • getZIndex(): number
  • Returns number

  • notify(key: string): void
  • Notify all observers of a change on this property. This notifies both objects that are bound to the object's property as well as the object that it is bound to.

    Parameters

    • key: string

    Returns void

  • Opens this InfoWindow on the given map. Optionally, an InfoWindow can be associated with an anchor. In the core API, the only anchor is the Marker class. However, an anchor can be any MVCObject that exposes a LatLng position property and optionally a Point anchorPoint property for calculating the pixelOffset (see InfoWindowOptions). The anchorPoint is the offset from the anchor's position to the tip of the InfoWindow. It is recommended to use the google.maps.InfoWindowOpenOptions interface as the single argument for this method. To prevent changing browser focus on open, set google.maps.InfoWindowOpenOptions.shouldFocus to false.

    Parameters

    • Optional options: null | Map | StreetViewPanorama | InfoWindowOpenOptions

      Either an InfoWindowOpenOptions object (recommended) or the map|panorama on which to render this InfoWindow.

    • Optional anchor: null | MVCObject | AdvancedMarkerElement

      The anchor to which this InfoWindow will be positioned. If the anchor is non-null, the InfoWindow will be positioned at the top-center of the anchor. The InfoWindow will be rendered on the same map or panorama as the anchor (when available).

    Returns void

  • set(key: string, value: unknown): void
  • Sets a value.

    Parameters

    • key: string
    • value: unknown

    Returns void

  • setContent(content?: null | string | Element | Text): void
  • Parameters

    • Optional content: null | string | Element | Text

      The content to be displayed by this InfoWindow.

    Returns void

  • Parameters

    • Optional position: null | LatLng | LatLngLiteral

      The LatLng position at which to display this InfoWindow.

    Returns void

  • setValues(values?: null | object): void
  • Sets a collection of key-value pairs.

    Parameters

    • Optional values: null | object

    Returns void

  • setZIndex(zIndex: number): void
  • Parameters

    • zIndex: number

      The z-index for this InfoWindow. An InfoWindow with a greater z-index will be displayed in front of all other InfoWindows with a lower z-index.

    Returns void

  • unbind(key: string): void
  • Removes a binding. Unbinding will set the unbound property to the current value. The object will not be notified, as the value has not changed.

    Parameters

    • key: string

    Returns void

  • unbindAll(): void

Generated using TypeDoc