I'm trying to include pictures in my leaflet popups, but the popup-size doesn't adjust to the picture size. I found a solution to this on github:
https://github.com/Leaflet/Leaflet/issues/724
While that solution fixes the size of the popup, the result is shifted and the popup doesn't show up centered over the icon/marker... Any way to change that?
.leaflet-popup-content {
width:auto !important;
}
Also the other proposed solution (setting the maxWidth on the popup) doesn't help in my case. The popup width keeps on being the default width of 300px...
function pop_Fotos(feature, layer) {
var popupContent = '<img style="max-height:500px;max-width:500px;" src="...");
layer.bindPopup(popupContent, {maxWidth: 500, closeOnClick: true});
}