[Qgis-user] Web client background layer printing

Luca Manganelli luca76 at gmail.com
Thu May 22 23:56:53 PDT 2014


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
            }
        }
  );



More information about the Qgis-user mailing list