2

I have QGIS version 3.4.2-Madeira and I'm still a beginner with this software.

I have created a web mapping service that actually is hosted by a QGIS server. In order to do this, I've used the Qgis2web plugin and I'm feeling confident with it now. First I've created some CSV files with points coordinates and other features in them and then I've loaded these files as a delimited text layer.

What I want to do now, is to add something that allow me to have a feedback from the map. In other words, when a point on the map is clicked, I want to trigger a Python script that can receive and elaborate the feature related to the clicked point.

I've tried to give a look at the actions provided by the properties tool, but it seems that these actions cannot be exported with qgis2web.

closed as off-topic by Andre Silva, Vince, nmtoken, MaryBeth, ThingumaBob Dec 30 '18 at 2:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – Andre Silva, Vince, nmtoken, MaryBeth, ThingumaBob
If this question can be reworded to fit the rules in the help center, please edit the question.

0

This is how I solved my problem but it will work only if you are using popups in your map. First change var doHover = true; Then delete the if control at the beginning of var onSingleClick = function(evt). After the popup creation, before the end of that function, you can access the variable that you are interest in through Autolinker.link(String(currentFeature.get(currentFeatureKeys[n]))) where n is the position in the popup of your variable. Finally you can make a POST request and send it to a python script and elaborate it.

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