4

In QGIS 2.14, how can I create a semi-transparent "map collar" (white space around the outside of the page) in Composer?

I imagine the map collar would be some sort of graphic shape (not a feature) that is maybe 1 inch wide and covers the current data map. Think of it like a donut: white space that is semi-transparent white, while the interior is transparent. The end goal is to create a "masking" effect that would focus the users eye on the interior of the map, but still allow them to see features around the edge of the map (and "hidden" under the collar).

A couple of ideas I had but cannot figure out a way to implement:

  1. Buffer the map frame (to the outside only)
  2. Create a graphic shape and "cut out" the interior
6

You can create a collar using data frame or map frame within the layout view, as follows

  1. Set the data map position for both X and Y to 0 (Zero)
  2. Increase the thickness of the frame to desired value (I used 20 mm), The thickness increased from the center of the line (both outside and inside of the line), that is why I set the X and Y position to 0 to exclude the outside from being shown when exporting the map to an image or a PDF.
  3. Choose the desired color, and set the opacity to 50% or 60%.

    The result is shown below:

enter image description here

If you want to exclude the yellow color in the right side of the frame you can add a rectangle to hide that color and lock the layer to become a space to put some legend and other information, and the result will be like this:

enter image description here

The output when you save the layout as image is like this:

enter image description here

Also, there is another option to create a collar using rectangle object, but a lens-like shape, using the following steps:

  1. Create a rectangle shape that covers map frame completely. The extent of the rectangle is same as the extent of the map frame.
  2. Under Items -> select the new rectangle -> Style and click on Change
  3. Change the style from simple fill to shapeburst fill, and change the settings as shown below:

enter image description here

  1. You will get an output a focus lense-like shape, as shown below:

enter image description here

Update

Using also @RyanDalton's method, it is better to change the transparency of the rectangle (collar) itself rather than the map frame to keep the map frame very clear. Also, changing the "Blend mode" to 'Soft light' OR 'Overlay' can some effects, but it is still a personal preference, as shown below:

(1) Blending mode: Soft light

enter image description here

(2) Blending mode: Overlay with 25% transparency

enter image description here

  • While not quite as flexible (you cannot snap other composer features to the boundary of the "buffer") this method does accomplish the task at hand. I'll continue to look for a way to either create a "donut" shape or maybe use an outline fill with negative buffer. – RyanKDalton Jul 20 '16 at 15:52
2

Thanks to the answer by @ahmadhanb, it led me in the right direction to find what I was looking for.

Step-by-Step instructions:

  1. Add a rectangle shape that represents the "frame" that you want your map to sit within.
  2. The default will be a polygon with simple fill. Change its style to transparent fill and dark border. Adjust border width and style as needed.
  3. Add an additional fill type of "Outline: Simple line". This will be your "collar".
  4. Change the color to the outline fill to the color of your collar. Set the pen width large enough to go off the page (I used 20mm), and set the Offset to negative half of the pen width (I used -10mm). Save the style.

Symbol Selector

  1. Back on the Composer>Item Properties, set the transparency of the map frame/collar to desired transparency (I chose 25%).

Composer Transparency

Even though the collar fill runs off the map canvas, only map canvas area will be exported to file. You can see the result leave the outer edge slightly shaded, but semi-transparent.

Collar Result

  • 1
    I think it is better to change the transparency of the rectangle (collar) itself rather than the map frame to keep the map frame very clear. Also, you can change the "Blend mode" to 'Soft light' OR 'Overlay' for some effects. I will update my answer to show these effects. – ahmadhanb Jul 21 '16 at 1:52
  • @ahmadhanb, I haven't played with the Blend modes, I will check that out. I didn't adjust the transparency of the map, but rather created the interior outline as a separate object that lays over the top of the map. Good point though... avoid adjusting the transparency of the map itself. – RyanKDalton Jul 21 '16 at 18:30
0

I don't think you can make a "donut hole" in a graphic like you can in a feature. One way would be to create 4 graphic rectangles of equal transparency (transparency is under Item Properties > Rendering) and use them to build a frame around the edge of your layout. Here I used 2 red ones on the bottom and right and 2 white ones along the top and left.

enter image description here

0

You can use Mask plugin. Create polygon layer over the space you want to show, then use Mask plugin on it. Should work

  • Since this is a Composer object, and not a data layer, I'm afraid this will not work. – RyanKDalton Jul 20 '16 at 15:51

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.