Skip to content

Set multi-page print layouts to current map view #5781

Closed Answered by nirvn
Rinn37 asked this question in Q&A
Discussion options

You must be logged in to vote

@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( 'M…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Rinn37
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5757 on October 30, 2024 03:09.