I'm drawing a track where I want to place icons (point symbols), but with an offset so that the line is fully visible. Here is an example: track with offset icons

The origin is exactly on the track, therefore when zooming in and out the icons stay in a reasonable position. So far,so good.

What I need, though, is to connect the edge of the icon to the original point on the track using a line or arrow. I need this to indicate where exactly is the danger point (that is what the exclamation mark icon stands for)


Use the Geometry Generator with the following expression:

make_line(make_point($x,$y),make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony"))

Then you can freely move your labels around.

Geometry Generator

Explanation: one end of the line will stick to the coordinates of the original point (the make_point($x,$y) part of the generator), while the other end will be drawn at the coordinates of the moved label (i.e. at the ( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony") coordinates).

enter image description here

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.