[qgis-qwc2] How to enable backgrounds in printouts of demo-app?

Roman Meier roman.meier at gismap.ch
Thu Jan 9 06:56:21 PST 2020


Hi Sandro,

I struggled to grasp the concept behind the "double" configuration in
themes and project.

"osm_farbig" isn't actually a valid qgis-Layer. Therefore it's resulting
in an error message when trying to print.

Since I can't modify the project file myself, I simply linked "mapnik" to
the existing qgis layer "Stadt- und Ortsteilgrenzen".

        "backgroundLayers": [
          {
            "name": "mapnik",
            "printLayer": "Stadt- und Ortsteilgrenzen",
            "visibility": true
          }
        ],

Now, anytime "mapnik" (Open Street Map) is selected "Stadt- und
Ortsteilgrenzen" shows.

Works like a charm!

Thanks!
Roman

> Hi
>
> You need to associate a layer in the QGIS project to a client side
> background-layer by specifying "printLayer" for the background layer in
> themesConfig.json, see [1] for example.
>
> Sandro
>
> [1]
> https://github.com/qgis/qwc2-demo-app/blob/master/themesConfig.json#L14
>
> On 09.01.20 12:28, Roman Meier wrote:
>> Hi folks,
>>
>> I'm still running the demo-app and I was wondering about the fact that
>> none of my printouts is showing any of the chosen backgrounds available
>> using the button at the bottom of the gui.
>>
>> It's only when I choose a background layer from within Layers & Legend
>> that it shows on the printout, which is not really what I'm looking for.
>>
>> Is this just a configuration issue? What am I missing here? WYSIWYG is
>> rather important for me and I wish the user gets what he actually sees
>> in
>> the gui. Looking at productive implementations like map.geo.gl.ch, this
>> can work well.
>>
>> There was a discussion in here before in "Print plugin – printing of
>> background layers" a while back. Unfortunately I'm still not getting it.
>>
>> Is there a way I can enable printout of background layers in the demo
>> version? How?
>>
>> Kind regards,
>> Roman
>>
>> _______________________________________________
>> qgis-qwc2 mailing list
>> qgis-qwc2 at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/qgis-qwc2
> _______________________________________________
> qgis-qwc2 mailing list
> qgis-qwc2 at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/qgis-qwc2
>




More information about the qgis-qwc2 mailing list