1

I created with the QGIS Geometry Generator some symbols for water-management. But somehow in the legend symbols are rendered "too large" when I have as "Unit" - "Map Units" set: enter image description here

When I change the Units to "Pixels" for example, i get a nice legend symbol, but the symbol on the map is way too small!

enter image description here

The symbol on the map need to be fixed in size and should not change when the zoom level is changed. How can i get a fixed-sized symbol on the map and still get a recognizable legend symbol?

Edit: After again playing around and using SVG icons, the same problem occurs. If a fixed size in the map is desired, the legend symbol (in the layer panel as well as in a print layout) is unusable. Is this a bug worth reporting?

2
  • 1
    Just some idea, but did you try to : set the symbol size as "meter at scale" rather than "map unit" if you're using a meter based CRS it should look the same ; going to Settings>Options>Canvas&Legend and adjust the value for minimum and maximum legend symbol size ; not using the geometry generator to generate the symbol (in your exemple the symbol should be easily recreated using simple marker or an SVG symbol)
    – J.R
    Commented Feb 8 at 11:55
  • playing around with those settings did unfortunately not change anything.. I'm more or less coming from SVGs, but wanted to get rid of them as i use that layer styling in many projects, and having to embed all svg manually is work i wanted to avoid in future..
    – sn1ks
    Commented Feb 8 at 12:01

1 Answer 1

2

Looking at your expression, as JGH commented, I think you might be using the wrong approach. It appears you just want to show a symbol with concentric circles, not that the actual size of the centroid buffers or their difference is geometrically meaningful.

Instead of using Geometry Generator, consider using the Centroid Fill symbol type and then customising the marker symbol to have multiple symbol layers, to build the look you want (refer to documentation for example and screenshots).

As for getting the symbol to remain the same size regardless of zooming in or out, change the units to Map Units if using a projected CRS for your project, or Meters at Scale if not.

If using Map Units you can click on the spanner icon to Adjust Scale Range and configure a minimum and maximum scale beyond which the symbol size does scale for visibility purposes. (Refer to documentation on units)

You change the units for all elements of the symbol - symbol size, stroke width, offset, etc. - in one go by clicking on the very top of the symbol tree (Fill, in your screenshots) and changing the units there.

It should show up properly in the legend too but if not you can use a custom symbol override in the legend item to get around it.

2
  • Just a note: while custom symbol override solves the problem when using print composer, it's not available for legend items in the Layers panel. My experience is that the Layers panel is extremely quirky (bordering on useless) when it comes to complex symbology. What I do is to make symbology as I want to see it on the map, use custom symbols for layouts, and don't care about Layers panel, using longer/more descriptive legend text instead. Commented Feb 9 at 10:45
  • hmm, maybe i chose a bad example symbol. i have far more "sophisticated" symbols as well (created as SVG or w/ geometry generator) - no matter what, it is (imo) a weird behavior that the legend symbol zooms in accordance to the map interface. I opened a GitHub Issue on that, if you have an opinion about that behaviour, maybe this would be the place to speak out? github.com/qgis/QGIS/issues/56263
    – sn1ks
    Commented Feb 14 at 8:59

Your Answer

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

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