Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Popup

Hierarchy

Implements

Index

Constructors

constructor

  • Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers.

    Parameters

    Returns Popup

Methods

addTo

  • Adds the popup to the map.

    Parameters

    Returns Popup

getContent

  • getContent(): HTMLElement
  • Returns the content of the popup.

    Returns HTMLElement

getLatLng

  • Returns the geographical point of popup.

    Returns LatLng

onAdd

  • onAdd(map: Map): void
  • Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).

    Parameters

    Returns void

onRemove

  • onRemove(map: Map): void
  • Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).

    Parameters

    Returns void

openOn

  • Adds the popup to the map and closes the previous one. The same as map.openPopup(popup).

    Parameters

    Returns Popup

setContent

  • setContent(html: string): Popup
  • setContent(el: HTMLElement): Popup
  • Sets the HTML content of the popup.

    Parameters

    • html: string

    Returns Popup

  • Sets the HTML content of the popup.

    Parameters

    • el: HTMLElement

    Returns Popup

setLatLng

  • Sets the geographical point where the popup will open.

    Parameters

    Returns Popup

update

  • Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded.

    Returns Popup

Static addInitHook

  • addInitHook(methodName: string, ...args: any[]): void
  • You can also use the following shortcut when you just need to make one additional method call.

    Parameters

    • methodName: string
    • Rest ...args: any[]

    Returns void

Static extend

  • You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it.

    Parameters

    Returns any