[Qgis-developer] QGIS Server GetFeatureInfo custom CSS (or better: templates!)
Alessandro Pasotti
apasotti at gmail.com
Mon Apr 20 00:29:28 PDT 2015
2015-04-20 9:15 GMT+02:00 Carles Vico Blanco <carles.vico at geografos.org>:
> Thanks a lot for your work Alessandro! Simple filter for a big
> problem! Finally we have apply our styles to the GetFeatureInfo response
> with your GetFeatureInfoCSSFilter.py, where we have directly insert the
> CSS parameters (without templates).
> Now, we need to increase the control about this GetFeatureInfo response in
> two ways:
>
> The first case is that, the attributes of my layers who are URL (http://...)
> can be understood as links for the QGIS Server and displayed with
> linkstyles that I've been included in the GetFeatureInfoCSSFilter.
>
> The second is that, the response of my GetFeatureInfo request, for now
> show me all the layers of my QGSProject, included the layers with NO INFO
> values at the point of my request (show me only the header of the atributte
> table, without info). How can I do that the response hide the headers of
> the attribute table layers with NO INFO values?
>
> Any Filter? Templates?
>
> I have seen that in the Web Client you can modify the globaloptions.js to
> setup some of this, but I'm not sure they take effect in the QGIS Server
> response, outside Web Client.
>
>
>
Hello Carles,
No, the globaloptions.js are the options for QGIS Web Client (that is an
HTML/Javascript WEB GIS for the browser) and not for QGIS server.
You can decide to manipulate the GetFeatureInfo response in the client or
in the server.
In the first case, you will use the options given in QGIS Web Client (and
IIRC there is one to show URLs as links), in the latter you will use a QGIS
Server Python plugin.
In my article [1] you can find a working example of server side filtering,
for a very simple REGEXP substitution (string injection) but also a final
hint about further and more complex output filtering. From that point it's
up to you but there is basically nothing left in QGIS domain: it's
everything pretty standard text manipulation or XML
templating/transformation. As long as you have your XML parsed into an
object you can also check for the presence of results in a layer and
decide what to do in you final output.
[1] http://www.itopen.it/qgis-server-getfeatureinfo-with-style/
--
Alessandro Pasotti
w3: www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150420/23c06b69/attachment.html>
More information about the Qgis-developer
mailing list