[Qgis-user] QGIS Server GetFeatureInfo custom CSS (or better: templates!)
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. Thanks Carles Vico 2015-04-10 12:47 GMT+02:00 Alessandro Pasotti : > Hi, > > there have been some requests in the past about custom CSS for html > GetFeatureInfo responses from QGIS Server. > > Currently, the HTML response template is hardcoded and there is no way > to customize it, the Python plugin support introduced with the latest > version of QGIS Server provide some easy ways to add some custom CSS > rules or even provide custom templates. > > To get you started, I've added a new filter to my example HelloServer > plugin: > > > https://github.com/elpaso/qgis-helloserver/blob/master/filters/GetFeatureInfoCSSFilter.py > > This filter is pretty simple, if the request is a WMS GetFeatureInfo > with HTML format, it injects a STYLE tag into the HTML HEAD. > > As an exercise left to the reader, you can also intercept the call in > requestReady(self), change the INFO_FORMAT to text/xml and then do > some real templating, for example by using XSLT or pasrsing the XML > and injecting the values into a custom template. > > > > -- > Alessandro Pasotti > w3: www.itopen.it > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-user > ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Format GETFEATUREINFO request from QGISwebserver
Hi,qgis-users, in the same way of my last question, about how format the GetFeatureInfo request in QGISServer, some people tells me that QGIS Server runs in a Mapserver architecture (its true?) If that's true, Mapserver format the getfeatureinfo request with a *.map file that includes a TEMPLATE option with HTML styles. This option is easier (for me I'm not a programmer) than the Python coding solution Now, my problem is that, when I search in QGISServer, I can not find any *.map file related about this. Someone knows where is this *.map file? Or how works QGISServer to call the mapserver .map file? Thanks a lot! Carles Vico 2015-03-20 12:21 GMT+01:00 Alessandro Pasotti : > 2015-03-20 12:08 GMT+01:00 Carles Vico Blanco : > > Thank you very much for the reply, but I have a question of your answer. > > When you say: "The latest release", I understand the QGIS 2.8, that's > > correct? And then, I need to install the QGIS Server Python plugin on > QGIS > > Server, as you say here > > http://www.itopen.it/qgis-server-python-plugins-ubuntu-setup/ , or It's > no > > necessary from the latest release of QGIS Desktop? > > > > I'll try it and I tell you my result! > > > > Thanks a lot! > > > > The article describe the setup to install the example HelloServer > plugin and let it run on Ubuntu 14.04 server edition, you might find > that useful to get started, you can also read the other 2 articles in > the QGIS section of my website > http://www.itopen.it/category/gis/qgis/qgis-server/ > > You need to write a custom filter to modifiy GETFEATUREINFO request, > if you examine the example plugin's code you will probably get some > inspiration. > > Python plugins for QGIS Server are available with QGIS >= 2.8 > > One of my tasks for the next HF is to add a "Server" section to the > plugins official repository, if you develop something re-usable, don't > forget to upload the plugin when it's done. > > > Happy coding :) > > -- > Alessandro Pasotti > w3: www.itopen.it > ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Fwd: Format GETFEATUREINFO request from QGISwebserver
Hi Frank I've seen that but firstly I'm not sure that this option takes effect in the Getfeatureinfo response (are you sure of this?) and then, I don't tried it because I think in this way, you need to add an html code everytime for each layer (I'have a lot of layers in my projects) and I prefer to apply a way where I can setup the getfeatureinfo response format from a single file. Thanks for your reply! 2015-03-20 10:52 GMT+01:00 Frank Sokolic : > Hi Carles, > > Have you tried experimenting with the map tip display tip in QGIS? In QGIS > go to the layer properties, select "Display" and then enable "HTML". You > can then add html code to display the attribute values which should affect > the format of your GetFeatureInfo request. > > Frank. > > On 20/03/2015 11:26, Carles Vico Blanco wrote: > >> >> > > Hi, I'm new in Qgis-user List. >> > > >> > > I wonder if it is possible to customize the html response to the >> request "GetFeatureInfo" held by QGIS Web Server in the same way as is >> done in GeoServer, MapServer or ArcGIS server with a template, css ... >> > > >> > > For now, the result of my GETFEATUREINFO request takes certain html >> styles if displayed in the QGIS Web Client, but not shown in styles if >> displayed in another mapviewer. To do so it, I need to act on the html >> file styles but I have not found. I dont know if it is possible in QGIS >> Server? >> > > >> > > Thank you very much!!! >> > > >> > > Carles Vico >> > > >> >> >> >> ___ >> Qgis-user mailing list >> Qgis-user@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/qgis-user >> >> > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-user > ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Format GETFEATUREINFO request from QGISwebserver
Thank you very much for the reply, but I have a question of your answer. When you say: "The latest release", I understand the QGIS 2.8, that's correct? And then, I need to install the QGIS Server Python plugin on QGIS Server, as you say here http://www.itopen.it/qgis-server-python-plugins-ubuntu-setup/ , or It's no necessary from the latest release of QGIS Desktop? I'll try it and I tell you my result! Thanks a lot! Carles 2015-03-20 10:47 GMT+01:00 Alessandro Pasotti : > 2015-03-20 10:26 GMT+01:00 Carles Vico Blanco : > > > >> > Hi, I'm new in Qgis-user List. > >> > > >> > I wonder if it is possible to customize the html response to the > request > >> > "GetFeatureInfo" held by QGIS Web Server in the same way as is done in > >> > GeoServer, MapServer or ArcGIS server with a template, css ... > >> > > >> > For now, the result of my GETFEATUREINFO request takes certain html > >> > styles if displayed in the QGIS Web Client, but not shown in styles if > >> > displayed in another mapviewer. To do so it, I need to act on the > html file > >> > styles but I have not found. I dont know if it is possible in QGIS > Server? > >> > > >> > Thank you very much!!! > >> > > > > With the latest release you should be able to alter GETFEATUREINFO > response quite easily by writing a custom QGIS Server Python plugin. > > I would try with a simple regexp to inject the URL that points to your > custom CSS. > > > -- > Alessandro Pasotti > w3: www.itopen.it > ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Format GETFEATUREINFO request from QGISwebserver
> > Hi, I'm new in Qgis-user List. > > > > I wonder if it is possible to customize the html response to the request "GetFeatureInfo" held by QGIS Web Server in the same way as is done in GeoServer, MapServer or ArcGIS server with a template, css ... > > > > For now, the result of my GETFEATUREINFO request takes certain html styles if displayed in the QGIS Web Client, but not shown in styles if displayed in another mapviewer. To do so it, I need to act on the html file styles but I have not found. I dont know if it is possible in QGIS Server? > > > > Thank you very much!!! > > > > Carles Vico > > ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user