0

Is there a way to hide a specific "symbol layer" when in the layout window?

I have a point layer where the points are marked with two "symbology layers":

  • symbology layer 1: single lined inner circle
  • symbology layer 2: dotted lined outer circle

I need symbology layer 2 during the editing of the point layer. Therefor it shall be always shown when in the main QGIS-window (and when the point layer is active). However in Layouts/Prints/Export symbology layer 2 it shall be hidden.

enter image description here

2 Answers 2

2

There are two way to get what you want.

First one :

Create two style for your layer, one for editing (with both symbology layer) and one with only symbology layer 1 for the composer (see QGIS docs for creating several style on the same layer).

Then create two different map theme, one for editing and one for print composer (set the appropriate symbology on each theme).

Then in the print composer set the map element to follow the right theme (it's in map element properties>Layers>Follow map theme)

You can know have the canvas where you edit set to the editing theme with the editing symbology while the print composer will use the print theme with the appropriate symbology, you can even modify/create the editing theme to have a totally different map (different basemap, add references layer usefull for editing...) without impacting the print output.

enter image description here


Second one :

Set an expression to the symbology layer 2 to hide it in composer.

To do so select the symbology layer 2 in the layer styling window and use the data defined override of the "Enable symbol layer" checkbox (it's at the bottom of the window, under the symbol selection) with an expression that will hide the layer in the context of the print composer. For a map element called "Map1" you may use this expression :

CASE
    WHEN  @map_id  = 'Map1' THEN 0
    ELSE 1
END

enter image description here

0

You could perhaps make use of the Lock styles for layers option in the Item Properties of the map in your layout.

Uncheck the symbol layer in the symbology pane in the main QGIS window

enter image description here

Then in then layout window, check the Lock layers and then the Lock styles for layers checkboxes.

enter image description here

You can then re-enable the symbol layer in the QGIS main window and it will not appear in your layout.

Admittedly this does reduce some flexibility regarding layers shown in the map, but you can also set a theme (shown with red arrow above).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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