0

I'm trying to add an image (a colorbar) to my map at a particular position. When the image zooms inward or outward (or to a separate location), I wish to have the image remain in the same position (similar to the zoom buttons, scale, etc.).


var colorbarBounds = [[-80, 160], [-90, -160]];
    colorbar = L.imageOverlay('colorbar.png', colorbarBounds, {pane: 'labelsPane'}).addTo(mymap);

The colorbarBounds are the location where I wish to have them start at for default.

Image: Image Map

Chen
  • 29
  • 5
  • 2
    Consider having it as a control instead, see https://leafletjs.com/examples/extending/extending-3-controls.html – IvanSanchez Jun 28 '19 at 13:55
  • Alongside IvanSanchez's suggestion, see also https://stackoverflow.com/questions/33614912/how-to-locate-leaflet-zoom-control-in-a-desired-position/33621034?r=SearchResults#33621034 – ghybs Jun 28 '19 at 17:11

0 Answers0