Class ImageOverlay

L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented.

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(imageUrl: string, bounds: LatLngBounds, options?: ImageOverlayOptions): ImageOverlay

Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.

Parameters

Returns

ImageOverlay

Methods

public addTo(map: Map): ImageOverlay

Adds the overlay to the map.

Parameters

Returns

ImageOverlay

public bringToBack(): ImageOverlay

Brings the layer to the bottom of all overlays.

Returns

ImageOverlay

public bringToFront(): ImageOverlay

Brings the layer to the top of all overlays.

Returns

ImageOverlay

public onAdd(map: Map)

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

public onRemove(map: Map)

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

public setOpacity(opacity: number): ImageOverlay

Sets the opacity of the overlay.

Parameters

  • opacity: number

Returns

ImageOverlay