2
  1. is it possible to create popups with images via QGIS2web?
  2. if yes, what would be the workflow?

Couldn't it figure out yet.

2
  • I am new to this forum but have a decent amount of Qgis experience. I have tried using this method to add images to my popups in the qgis2web plugin with no success. By adding the html_exp column it means none of my other popups now show and the image is just representing itself as a small blank thumbnail even though my path directory is correct. I have added the column into the CSV file I have and then added it as a delimited layer if that makes any difference. Is there any other way you might be able to think of including an image in a popup of the attribute table at a point? Any ideas or he
    – user56996
    Aug 20, 2015 at 11:36
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. Aug 20, 2015 at 12:14

3 Answers 3

5

Please download the current master branch of qgis2web from Github:

https://github.com/tomchadwin/qgis2web

In Layer > Properties > Fields (I think), select an Image edit widget for a field. Select the images you want for each feature, and then run qgis2web. Set that layer's popups to that field or all fields, and export. The images should appear in your popups.

Try to make the images a suitable size, and do report any issues on Github. I'll release a new version including this functionality early next week, once I've updated the readme.

2
  • Hi Tom, your comments are very helpful. I tried the method described above and it worked like a charm. However, just wondering if there is a way to fix the size of the image. It doesn't reduce the size. Is there a way to achieve that without fiddling with the original image? Many thanks.
    – VGu
    Jul 12, 2016 at 23:49
  • @VGu No, there's no such method at the moment, I'm afraid. Do feel free to file an issue on Github, and it can be considered. I'm not sure it will be high priority, though. Jul 13, 2016 at 11:52
4
  1. yes it is possible, like what @TomChadwin said with

    <img src="path/to/image.jpg" />
    
  2. with a huge help from excel (using CSV file), i will explain in step:

    1.Load your data with the image hyperlink Column inside enter image description here

    2.Make a new column where your url picture inside img tag with this formula okok

enter image description here

  1. Then Copy those cells and Paste with Paste Special Values.

If you missing something, here is example for much clearer explanation, download it and open in spreadsheet like excel to see how it works. It supposed now you have Picture hyperlink that will pop up with Qgis2web.

here is the webmap : Endemic Animal of Indonesia Map

and here is the screen capture enter image description here

and

1

There was a method of doing this in qgis2leaf, but I have not tested it in qgis2web. Add a column to your table called html_exp. Put HTML in that field to call your image:

<img src="path/to/image.jpg" />

Choose this field in qgis2web's UI in the "Info popup content" drop-down for that layer.

You will then need to copy the images to the "path/to" folder in your output.

Let us know if that works. I'd like to work out a better way to do this, but that's the only possibly option at the moment.

3
  • Thanks for that help. What about if I want e.g two or more images in the popup? Not at the same time but more like a 'click next' to see the next image? Thanks again!
    – hoge6b01
    Jul 16, 2015 at 18:13
  • That would take a good bit or javascript work, I'm afraid. No simple way to achieve it that I can think of. Jul 17, 2015 at 12:43
  • After work by @geospark (Twitter nick) at the FOSS4GUK2016 qgis2web code sprint, a better solution is coming together, at least for Leaflet export. See recent commits and try downloading the master branch from github.com/tomchadwin/qgis2web. More development to come. Jun 18, 2016 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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