Bug report #16899

Updated by Giovanni Manghi over 4 years ago

It was ok until at least 2.14.16

This has direct effect on how map legends can be printed using QGIS Server and a GetPrint request.

The problem is:
how do I get a printed map via GetPrint where the legend is *fixed* regardless the layers listed in the request (that are the layers that are then visible within the map object)?

Well the solution was this "none" value for the "map" option for any legend object. In this way the legend was "unlinked" from any map object and as a result it was always printed as defined in the print composer options (of course with the "auto update" and the "filter" not enabled).

So with a request like


where just 1 layer is requested to be visible in the map, we could get the legend also for all the other layers (defined in the layout composer in QGIS):


When instead of "none" the legend is associated to a map object like "map0" then the result is different, only the symbology synbols/classes for requested layers are added to the legend:


In QGIS 2.18.10 the value "none" is no more available, not allowing to get anymore the first result presented above (again, this affect only the maps printed via QGIS Server with GetPrint)

Both the above examples are obtained using QGIS Server 2.18.10 on a project saved in 2.14.16, this shows the issue in QGIS Desktop print composer rather then the Server.

Moreover if instead the project is saved with QGIS Desktop 2.18.10, the result of the above request is different and looks wrong, with "?" shown instead of (at least) the layer names, as in the second case above linked: