[QGIS-Developer] two issues in QGIS (Server and print composer) 2.18.10(?)

Giovanni Manghi giovanni.manghi at gmail.com
Thu Jul 20 15:38:31 PDT 2017


Hi Nyall,



> It'll be https://github.com/qgis/QGIS/commit/1b4bd47076103e931e642c9c2b6a363f14b20a45
> which removed the None option.
>
> ...HOWEVER...
>
> I'm having a lot of trouble trying to understand what the correct
> server logic is here. Is it:
>
> - if a getprint request is made without any layers specified then all
> layers are shown in both the map and legend

as far as I remember if no layers are specified in the request then no
layers are shown in the map (not sure about the legend)



> - if layers are specified then:
>   - legend set to a map: ONLY those layers should be shown in the map and legend

yes, actually as you may have seen form my examples, for layers that
are not listed in the request their name shows anyway in the legend
(without the ssymbology symbols or classes).


>   - legend set to None: only shown those layers in the map, but
> EVERYTHING in the legend
> ?

yes



The latter has/had a clear purpose, be able to to print via getprint a
map + a fixed legend, regardless
of the enabled/disabled layers, exactly as it happens when you print
from QGIS Desktop.



> If so, I'd say that's unpredictable, opaque behavior and needs to be
> fixed in the UI.
>
> Possible options would be:
>
> 1. adding a server settings section to the legend properties, with a
> checkbox "always show all layers (Regardless of requested layers)" (or
> betterly worded!)
>
> 2. Taking advantage of the existing "filter legend by map" option to
> handle this use case (which should already be supported in 2.x - it
> just needs that setting switched on in your projects). The only
> downside here is that if a layer is requested but has no features
> visible in the extent then it won't be shown in the legend. (That's
> arguably the correct cartographic behaviour though!)
>
> I don't think the "none" option should be brought back, as it makes
> legend behaviour unpredictable in itself. E.g. what scale should the
> legend use for symbols with map unit sizes? What preset style should
> it use?



option 1 seems good to me, anyway whatever the solution this should be
treated as a priority/bad regression as it broke a very basic
necessity when we do (for example) webgis with QWC or Lizmap.



thanks in advance and for understanding


cheers!

-- G --


More information about the QGIS-Developer mailing list