I have an image file that I am able to overlay perfectly fine onto my Leaflet map with this code:
var initLat = 38.9761; var initLon = -77.4875; var imageUrl = '/weather/nexrad/radar.png'; var imageBounds = [[initLat + 3, initLon + 3], [initLat - 3, initLon - 3]]; L.imageOverlay(imageUrl, imageBounds).addTo(map);
But as you can see, I have been trying to simulate a center point for that image overlay by just adding and subtracting
3 from my desired center point (
How can I create a Leaflet ImageOverlay using not two corner points, but a center point (in this case
38.9761, -77.4875), and having a zoom value as well to determine the size of that image overlay?
I am perfectly fine with using a bit of math to achieve this, but I haven't been able to figure out how I would use math in this scenario.