Does anyone know if it is possible to add hyperlinks to image fields etc. in the pop-up windows of Qgis2web?
I've had a look in the layers javascript file, but the image source path isn't rendered using html, so I can't simply append to it.
The image is coming in via the usual method of having a field that contains the path of the image file.
I'd like to achieve linking of the image, like in the example below. Alternatively, I could just populate the 'more info' field with the URL, but if I did that I'd like to avoid just doing it by having a field that contains the entire URL, as some may be quite long (these will only be internal links).
Answer
You can show an image in popup window by adding field of type text, select the number of characters to be long, for example 100 characters, and add the following in the Image_Field
:
where:
../images
: The folder that contains the images located outside the leaflet folder that you saved qgis2web
output data.
After creating the link to every image under the Image_Field
in the attribute table, then you need to export to leaflet again using qgis2web
plugin.
Here is a sample output:
No comments:
Post a Comment