I am trying to generate a one-page PDF document containing the following items:

1) On the left half, a full state map (say, New York State).

2) On the top right quadrant, a map that zooms in to one part of the map in item (1). For example, the Manhattan area.

3) On the bottom right quadrant, a table with text and some data.

I could generate all items individually but couldn't put both 1) and 2) on the same page at once. Both item 1) and 2) come from the same layer but rendered based on different extent. If I'm not mistaken, QgsComposition only takes in one instance of QgsMapRenderer at a time so only one extent is possible?

Any clue on what I should do? This is for a standalone PyQGIS app. I am using QGIS 2.4.0 on Ubuntu 12.04.

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Aug 30 '15 at 8:35

It's definitely possible. While QgsComposition takes only a single QgsMapSettings instance, it is not used for defining the extent of map items. Instead, use QgsComposerMap.setNewExtent for each map item to individually alter their visible extent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.