Tuesday 27 January 2015

openlayers - Adding hyperlinks to pop-up data in qgis2web?


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).


enter image description here



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:


Alias Name

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:


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...