[Qgis-user] Web client background layer printing
Bernhard Ströbl
bernhard.stroebl at jena.de
Fri May 23 00:21:43 PDT 2014
Am 23.05.2014 08:56, schrieb Luca Manganelli:
> On Thu, May 22, 2014 at 3:29 PM, Bernhard Ströbl
> <bernhard.stroebl at jena.de> wrote:
>> of course, but only if the user sets both visible. As I described in my last
>> post I did some scripting to prevent this.
>
> To address this, I've now put a pull request to call
> customAfterPrint(), see here:
>
> https://github.com/qgis/QGIS-Web-Client/pull/93
>
> Thanks to this function you can restore the original state:
>
> function customAfterPrint() {
> if (myCheckedBackgroundLayer != "") {
> toggleThematicBackgroundLayer(myCheckedBackgroundLayer, false);
> }
> }
>
> Note that the myCheckedBackgroundLayer is now a global variable, not a local.
>
> Furthermore, I've hidden the WMS background layers (in the QGIS
> project I've created a group for them, called 'sfondi') , add it to
> customAfterMapInit:
>
> // Hide the "background" wms theme
> layerTree.root.childNodes[0].cascade(
> function (n) {
> if (n.text == "sfondi") { // change name "sfondi" to the
> name of your group in the qgis project
> n.getUI().hide();
> return false; // exit loop
> }
> }
> );
I see, well in my case they are not in the same group but in a group
with others, so you cannot assume your setting to be the same
everywhere. What we could do is to hide all _layers_ with the same name
as the background layers. Would that make sense?
Bernhard
__________ Information from ESET Mail Security, version of virus signature database 9837 (20140522) __________
The message was checked by ESET Mail Security.
http://www.eset.com
More information about the Qgis-user
mailing list