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 Geometry Generator

Use the Geometry Generator tool 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


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

  • Following this howto I was able to create labels with lines pointing from the original position to the offset position. Problem is that I need this for an SVG marker. The first part make_point($x,$y) works, but I need to replace the "auxiliary_storage_labeling_positionx" and "auxiliary_storage_labeling_positiony" with the marker offset. How do I access the offset values (x,y) for a SVG marker? – Asen Christov Feb 15 '20 at 18:50

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.