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/Le
I had a similar issue with a Leaflet based map in Drupal where I needed to update the popup after loading the images and I managed to solve this based on @frankieandshadow 's answer.
Here is the code I came up with:
$(function() {
var mymap = Drupal.settings.leaflet[0].lMap;
mymap.on("popupopen", function(e) {
$(".leaflet-popup-content img:last").one("load", function() {
e.popup.update();
});
});
});