Legacy
Mapbox.js is no longer in active development. To learn more about our newer mapping tools see Mapbox GL JS.
ImageOverlay
Used to load and display a single image over specific bounds of the map, implements ILayer interface.
Usage example
var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
L.imageOverlay(imageUrl, imageBounds).addTo(map);
Creation
Factory | Description |
---|---|
L.ImageOverlay(
|
Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to. |
Options
Option | Type | Default | Description |
---|---|---|---|
opacity |
Number |
1.0 |
The opacity of the image overlay. |
attribution |
String |
'' |
The attribution text of the image overlay. |
Methods
Method | Returns | Description |
---|---|---|
addTo(
|
this |
Adds the overlay to the map. |
setOpacity(
|
this |
Sets the opacity of the overlay. |
setUrl(
|
this |
Changes the URL of the image. |
bringToFront() |
this |
Brings the layer to the top of all overlays. |
bringToBack() |
this |
Brings the layer to the bottom of all overlays. |