is it possible to set value in QGIS Print Composer based on HTTP request param?

For example i want to add table in composer with something like "value = $requestedvalue", and $requested value should be in http request: serveraddress?map=...&SERVICE=WMS&REQUEST=GetPrint&...&$requestedvalue=something


It is possible - at least, if you want to display text, allthough it doesn't seem to be too well documented. In your print composer template add a label as a placeholder for each parameterized text and make sure, that you enter a unique Id for the label.This id is the name of the GET or POST parameter to be used in yout GetPrint call.

You can even make your webclient responsive to the id-"alized" labels in your composer templates, because the ids of labels are listed in the ComposerTemplates section of the response of GetProjectSettings-request, like:

    <ComposerTemplate width="100" height="200" name="myTemplate">
        <ComposerMap width="90" height="190" name="map0"/>
        <ComposerLabel name="myLabel1"/>
        <ComposerLabel name="myLabel2"/>

where myLabel1 and myLabel2 are the ids of your composer labels.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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