I am a novice in using leaflet, I exported my map layers from QGIS to a working Leaflet map. I am trying to modify the popup to use the attribute so as to get an image popup. i am however stuck as i have read documentation but still unsure. Any leads will help. Currently my popup does a get feature info to show the following.
function pop_dwelling(feature, layer) {
var popupContent = '<table><tr><th scope="row">house_numb</th><td>' + Autolinker.link(String(feature.properties.house_numb)) + '</td></tr><tr><th scope="row">photo</th><td>' + Autolinker.link(String(feature.properties.photo)) + '</td></tr><tr><th </td></tr></table>';
layer.bindPopup(popupContent);
}
where the photo is a column in the vector that has the path to the image
Best Answer
Does your column 'photo' contain just a filename? If so, this is what you'd have to do:
Change the popup code for the photo column from:
Autolinker.link(String(feature.properties.photo))
to
See if that does the trick.