-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX][QGIS-Server] Add all layers for fixed legend in GetPrint
If a legend is not linked to a map, it's a fixed legend and does not depend on layers parameter. This bugfix loads all layers needed by legend and update it.
- Loading branch information
Showing
1 changed file
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7c73521
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi René-Luc, thanks for this fix. I gave it a try and does work indeed! There is one problem yet (maybe it is a consequence of the fix): if in the "LAYERS" parameter are not listed all the layers that are actually in the legend (when the legend is configured as "map=none") then the GetPrint request hangs.
7c73521
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see also 3liz/lizmap-web-client#165 (comment)
7c73521
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gioman
I have tested with empty layers parameter and it works. I have all the fixed legend with an empty map. And it is the purpose of this fixe, it's to always have the legend even if the layer are not in the layers parameter.
7c73521
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rldhont ok, let me check it, I may have overlooked something. cheers!
7c73521
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rldhont Hi, see this two services
http://193.136.216.94/lm211_tests/lizmap/www/index.php/view/
http://193.136.217.85/lm211_tests_master/lizmap/www/index.php/view/
the first uses qgis server 2.8.2 the second master. Both contain two copies of the same project, one has a layout with a legend set to map=map0 and the other set to map=none. On qgis server master when printing the project that has the layout with the legend set to map=none the pdf creation hangs if you don't have all the layers active (so if you don't pass in the url LAYER parameter the complete list of layers that are in the composer legend). Try:
http://193.136.217.85/lm211_tests_master/lizmap/www/index.php/lizmap/service/?repository=montpellier&project=prj290&SERVICE=WMS&VERSION=1.3&REQUEST=GetPrint&FORMAT=pdf&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:3763&DPI=300&TEMPLATE=test_layout_legend_map_none&map0:extent=-239795.308000505,-389632.89329657354,132713.64979690503,-9623.755140826455&map0:scale=2500000&map0:grid_interval_x=50000&map0:grid_interval_y=50000&map0:LAYERS=layer1&LAYERS=layer1
compared to:
http://193.136.217.85/lm211_tests_master/lizmap/www/index.php/lizmap/service/?repository=montpellier&project=prj290&SERVICE=WMS&VERSION=1.3&REQUEST=GetPrint&FORMAT=pdf&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:3763&DPI=300&TEMPLATE=test_layout_legend_map_none&map0:extent=-239795.308000505,-389632.89329657354,132713.64979690503,-9623.755140826455&map0:scale=2500000&map0:grid_interval_x=50000&map0:grid_interval_y=50000&map0:LAYERS=layer1,layer2&LAYERS=layer1,layer2
7c73521
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rldhont desperate to troubleshoot I have tested on qgis server on Windows (yikes) and as a matter of fact it works (but the request has to be done twice because the first time it crashes, only happens when map=none). Now I just need to understand why on Ubuntu server does not. Ideas?