2

I am using QGIS v3.2 "Bonn".

I currently have symbols that have labels and call-out lines created using the geometry generator. I can make the labels follow scale dependent visibility rules, and would like to have the call-out lines follow the same rules but haven't found a way to do so.

Is there a way to set scale dependent visibility for such objects? Below is the geometry generator interface.

Geometry generator interface

3
  • 1
    What about using an if statement in your expression which only generates the objects if they're within a certain map scale threshold: e.g. if(@map_scale < 10000, make_line(...), None) – Joseph Aug 9 '19 at 14:17
  • 1
    @Joseph Thanks, that worked for me! Should I create an answer with that code? – Fragilaria Aug 9 '19 at 16:41
  • 1
    It would be great if you did! :) – Joseph Aug 12 '19 at 13:04
2

Thanks to Joseph for the suggestion, by adding an if statement to the code I was able to accomplish what I was trying to do.

Code for the geometry generator is as follows:

if(@map_scale < 200000, 
  make_line(
    make_point($x, $y),
    make_point(("auxiliary_storage_labeling_positionx"), ("auxiliary_storage_labeling_positiony"))
  ),
None
)

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.