[Qgis-user] trigger action in qgis2web

Stephen Sacks ssacks456 at gmail.com
Sat Dec 2 09:51:18 PST 2023


In my desktop QGIS I have a short Python script that opens an HTML page 
including arguments (attributes of the selected feature).  When I use 
QGIS2web to put the  project on the web, I would like the user to 
trigger that action when he/she clicks on a feature.  I would be 
grateful for advice on how to do that.
=========================
#This is the script for Action "showPhoto"
import webbrowser
host = "promPics.rf.gd"
cName = "[%"common name"%]"
lName = "[%"latin name"%]"
picture = "[%"picture"%]"
theURL = "http://" + host + "/?"
theURL = theURL + "cName=" + cName + "&"
theURL = theURL + "lName=" + lName + "&"
theURL = theURL + "photo=" + picture
webbrowser.open(theURL)
=====================
If you're interested, you can see an older, two-click, approach at
            BrooklynProm.epizy.com
     [Garden B only]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231202/e4e4a638/attachment.htm>


More information about the QGIS-User mailing list