Print plugin – pinting ofbackground layers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Print plugin – pinting ofbackground layers

Sascha Picard
Hello,

first of all: Thanks for this awesome project!
I hope to find help in a comprehension question´:

I am currently playing around witth the sample app.
I set up a QGIS server that serves a QGS-Project that contains some WMS layers as well as a couple of composer templates.

When I use the print plugin in the adapted sample app, it generates a corrupted PDF file.
I looked into the POST request formulated by qwc2\QWC2Components\Plugins\Print.jsx and noticed,
that the query param LAYERS also contains the name of the currently displayed background layer.
If I leave that name out of the request, my pdf gets printed.

I then noticed that the WMS example in the sample app also serves those backround layers (osm_grau, osm_hell etc.):
   http://qwc2.sourcepole.ch/wms/wolfsburg/qwc2_demo?SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings

Does that really mean that I have to add the background layers, which are used in the client, as services to the qgs-file served by QGIS-Server
– respectively always use a copy of a project binding these services as a base for the configuration of a theme in QGIS? That would be a bit inconvenient.
Or am I missing point here?


Regards
Sascha

_______________________________________________
qgis-qwc2 mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/qgis-qwc2
Reply | Threaded
Open this post in threaded view
|

Re: Print plugin – pinting ofbackground layers

Sandro Mani

Hi Sascha

There is a difference between background layers which are part of the QGIS project and background layers you configure in the themes configuration. The approach should be:

- Background layers used in the viewer need to be defined in the backgroundLayers section of the themes configuration, not in the QGIS project.

- If you want to have a background when printing, you can add an equivalent layer to the QGIS project and specify it as "printLayer" for the respective backgroundLayer in the themes configuration. The idea behind this is that you can use a fast WMTS for the viewer and an equivalent high-quality WMS for printing. Layers in the QGIS project marked as printLayer in the themes configuration are not added to the QWC2 layer tree.

Note that background layers added to the QGIS project which are not marked as printLayer are treated as normal layers, since there is no way to know whether a raster layer is a background layer or something else.

So in short: define your background layers in the themesConfig, remove them from the QGIS project, except for those you want to use as print layers and mark as printLayer in the themesConfig.

Hope this helps
Sandro



On 07.03.2017 13:40, Sascha Picard wrote:
Hello,

first of all: Thanks for this awesome project!
I hope to find help in a comprehension question´:

I am currently playing around witth the sample app.
I set up a QGIS server that serves a QGS-Project that contains some WMS layers as well as a couple of composer templates.

When I use the print plugin in the adapted sample app, it generates a corrupted PDF file.
I looked into the POST request formulated by qwc2\QWC2Components\Plugins\Print.jsx and noticed,
that the query param LAYERS also contains the name of the currently displayed background layer.
If I leave that name out of the request, my pdf gets printed.

I then noticed that the WMS example in the sample app also serves those backround layers (osm_grau, osm_hell etc.):
   http://qwc2.sourcepole.ch/wms/wolfsburg/qwc2_demo?SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings

Does that really mean that I have to add the background layers, which are used in the client, as services to the qgs-file served by QGIS-Server
– respectively always use a copy of a project binding these services as a base for the configuration of a theme in QGIS? That would be a bit inconvenient.
Or am I missing point here?


Regards
Sascha


_______________________________________________
qgis-qwc2 mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/qgis-qwc2


_______________________________________________
qgis-qwc2 mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/qgis-qwc2