Set multi-page print layouts to current map view

Hello,

I have an issue with multi-page print layouts in QField.

Describe the issue

When I’m working with print layouts which contain only one page, QField sets the map extent in the print layout to the map extent currently shown in the application.
In a multi-page print layout though, only the first map on the first page shows the extent that the main window was set to. All other pages show the extent which was active in the map view, when the print layout was initially created in QGIS.

I’m trying to implement a two-paged print layout in order to split a larger map onto two pages when printing. So actually, it’s the same map twice, with the left part on the first page and the right part on the second page and a small overlap in the middle. I used a larger map frame than the page size. That way I get the same “mosaic” with fixed map-parts and - in theory - I can print any chosen map extent with this layout. In the print composer it looks like this:

My problem is: The whole layout should follow the map extent currently selected in QField. For the first page this works as expected, but I can’t get the second page to behave the same way.

For example If I zoom in in QField and then print with the layout shown above, it responds like this (the second page stays the same while the first map responds and zooms in):

(I used a screenshot of the print composer here to show what my problem is, because I think it’s more clear than when I included the printed pdf).

Expected behavior

The expected result for the example above should look like this:

QGIS

  • QGIS Version 3.34.11.
  • QFieldSync Version 4.9.1

QField

  • Device: IPad
  • QField version: 3.4.3

Additional information

  • Problem started happening recently, didn’t happen in an older version of QField: No
  • Problem can be reliably reproduced, doesn’t happen randomly: Yes, It also happens whenever you use more than one map canvas in a print layout in QField.
  • Problem happens with all files and projects, not only some files or projects: Yes

Thanks a lot for any help!


Imported from GitHub discussion by @Rinn37 on 2024-10-22T13:19:36Z

Rinn37 , QField will only change the extent of the layout’s reference map set here:

If we would be to arbitrarily change the extent of all map items, you can imagine we would rapidly mess up with static overview map items, etc.

What you can do is use data-defined properties to set the x min y min x max and y max of your second map item by fetching the map extent of the map QField modifies. You can do that using item_variables( 'Map 1')['map_extent'] where ‘Map 1’ is the ID of the reference map used by QField to change the extent.

Here are the 4 values you’d need:

format('x min: %1 y min: %2 x max: %3 y max: %4',
  x_at(item_variables( 'Map 1')['map_extent'],0),
  y_at(item_variables( 'Map 1')['map_extent'],0),
  x_at(item_variables( 'Map 1')['map_extent'],2),
  y_at(item_variables( 'Map 1')['map_extent'],2)
)

Imported from GitHub comment by @nirvn on 2024-10-30T03:18:12Z

nirvn Thank you very much for your response. The solution worked perfectly!


Imported from GitHub comment by @Rinn37 on 2024-11-04T19:59:02Z