qgis / qwc2-demo-app

QWC2 demo application
Other
243 stars 155 forks source link

using internal wms layers as background for printing and raster export #416

Closed danceb closed 1 year ago

danceb commented 1 year ago

I have several wms layers configured as background layers in the tenantConfig.json. In the config.json the parameter printExternalLayers is true. If the parameter url of the background layer points on a address with protocol (https://something.com/wms/background) the background layer is printed or exported as raster file as expected.

What I want now, is to use internal layers as background layers instead. So I have configured them with "wmsOnly": true within the tenantConfig.json and set them as background layers with the relative url /ows/abackgroundlayer. As a different approach the files are provided via a mapproxy, here the relative url is /mapproxy/wms in my case.

The layers are shown as background layers as expected. But while raster export or printing the background layers are not shown in the result. Via debugging I recognized that the print service is trying to get the layer from the relative url /ows/abackgroundlayer and does not know, that it have to load it from http://qwc-qgis-server/ows/abackgroundlayer. If I am setting this url in the background layer config, the layer is printed correctly, but now it is not shown as background layer in the map, because now the browser doesn't know the url.

So is there a chance, to get the printing an raster export using internal wms services and dissolving the url in a correct way as the mapviewer does?

danceb commented 1 year ago

Works now with ff936c1f9adf5f5668dab2fbb95d7244d29b3aba