Monday, 9 April 2018

How to manage two map items in a QGIS composition with python?


I need to manage two different map items in the same map composition, with a stand alone python script.


Each composer map has been referenced like this:


composerMap1 = composition.getComposerMapById(0)
composerMap2 = composition.getComposerMapById(1)

Then, I suppose that I should alternatively set to True and False the keepLayerSet variable, using the function setKeepLayerSet(), and each time I should add a new layerset to the Map Renderer, with the function setLayerSet(layerlist).


At least, that's what I think... seen that this is the procedure for the desktop QGIS software. But it does not work properly: in the exported image there is always an empty map, while the other display the same set of layers. Has anybody tried to do the same thing, and has some hint to share? Thanks!





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...