0

I have a point shapefile layer, that I added into it a hyperlinks row. Each hyperlink is for a image, all in me dropbox. When I identify a point, I see the selected image. However, when I export it to web map with QGIS2WEB plugin, I see only the hyperlink not the image. When I click on the hyperlink the image is open in a different window. I like to see the image directly, can it be done?

Here are the steps I made:

In the layer properties I selected "Attachment" in the "Widget Type", I click on the "Use a hyperlink for document path (read-only)" and set the "Integrated Document Viewer" on Image type.

enter image description here

enter image description here

At this point I was able to create a hyperlink from the attribute table. enter image description here

On QGIS the image is visible, using identify feature enter image description here

As I wrote, when I use the QGIS2WEB plugin, I see only the link and not the image. enter image description here

How can see these image directly?

3

If you export your map with qgis2web as Leaflet map, you can easily adapt the popup content in the index.html as you want to.

enter image description here

Open the exported index.html and look for var popupContent =
At this point, the popup content is defined as HTML table.

Just add another row at the bottom of the table in your popup-content definition and insert an <img>-Tag:

var popupContent = 
[...]
    <td><img src="' + (feature.properties['URL-attribute'] !== null ? Autolinker.link(String(feature.properties['URL-attribute'])) : '') + '" height="100px"></td>\
[...]

"URL-attribute" would correspond to your attribute with the imagepath inside.

  • Can you add some print screen? I am not sure what do you mean. Thanks – Nitzan Matan Jan 14 at 13:45
  • 1
    I've edited my answer. I suggest you are using OpenLayers, right? Would it be an option using Leafleat? In my opinion it's much more user-friendly and easier to understand for beginners. – pascatl Jan 14 at 15:26
  • I am using Leafleat by the QGIS2WEB plugin, I will look at what you wrote. – Nitzan Matan Jan 14 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.