2

At QGIS 3.34.1, I have created a layout with two maps superimposed over each other. I need to sandwich a rectangle (using Add Item > Add Shape > Add Rectangle) between the two maps.

When I first add the rectangle, its default position is on top of the Item stack, and it is visible in the layout:

enter image description here

However, when I move the rectangle down in the Item stack so that it is positioned between the maps, the rectangle disappears. I expected the rectangle to draw outside the polygons because they are the only two features in that layer:

enter image description here

The screenshot below shows what I would like to accomplish with the rectangle. I created this by adding Polyline sections.

How can I create this "sandwiched" effect using a Rectangle shape?

enter image description here

0

1 Answer 1

3

Preliminary remark (solution below): I'm not sure what you intend to do, however, superimposing two maps in the layout does not seem to make sense to me and I have the impression it is not good practice. All you want to do could be much better achieved using layer visibility and map themes, with the rectangle you want to add as a separate polygon layer.

However, to still answer your question, make sure you have correctly set up the map that is on top of the layout: use a map theme that includes the polygons only, without the shaded relief background - check this by unchecking all other layout items and refresh the layout (press F5) to see if only the polygons are visible.

Then uncheck the box next to Background to get a transparent background where no polygons are. Now, your rectangle in the middle should be visible like this:

enter image description here

1
  • 1
    Yes, this works, and your idea to use themes is a more elegant approach than adding two maps to the layout. The question was inspired by a recent John Nelson video (youtube.com/watch?v=8vKKIlgEdes) where he sandwiches a neatline with Arc Pro. I was curious to see if the sandwich effect could be duplicated with QGIS.
    – Stu Smith
    Commented Dec 29, 2023 at 23:12

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