Skip to content

Commit

Permalink
append image to popup content if already present. #14
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-salabim committed May 1, 2021
1 parent d478fa8 commit 1c68195
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inst/htmlwidgets/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ LeafletWidget.methods.imagePopup = function(image, group, width, height, src, na
wdth = width[imgid];
hght = height[imgid];
if (imgid <= image.length) {
pop = "<image src='" + img[imgid] + "'" + " height=" + hght + " width=" + wdth + ">";
popimg = "<image src='" + img[imgid] + "'" + " height=" + hght + " width=" + wdth + ">";
poporig = layer.getPopup();
if (poporig === undefined) {
pop = popimg
} else {
pop = poporig._content + popimg
}

if (tooltip === true) {
layer.bindTooltip(pop, dotlist); //{ maxWidth: 2000 });
} else {
Expand Down

0 comments on commit 1c68195

Please sign in to comment.