I have an arrow marker (svg) that I use for photo location and direction on maps.
Under the arrow I want a label that is the number of the photo (photos by number are located elsewhere in a report). The number will have a white circle background. I can achieve this using Offset from Point and defining the quadrant and y value. Works for the arrow always pointing north. 🙂
The problem is that I cannot identify how to make the label rotate with the arrow marker/symbol such that it is always "under" the arrow (yet still oriented correctly as text).
As you can see, the arrow for image 2 points east but the label has not changed its position to still be inside the chevron.
"Use data defined properties for rotation with the same field on both marker and label"
Any online guide that explains this process?
I don't even understand the terms you are using.
Subsequent to the answer with examples:
After inputing the parameters you suggested (cutting and pasting your coding) it gave the message "Result of the expression is not a geometry."
And the result was that the circle and number disappear altogether.
project (make_point ($x,$y), 1, radians(45)) version below
Best Answer
Use Geometry Generator for label placement with
Offset from point
and use this expression (see below for variants A)if the solution should fit different map scales and B) if the labels itself should also be rotated):The red dot indicates the actual point geometry; the value of 2500 in the above expression is the distance from this point:
If you zoom in and out, a fixed distance is not ideal as the label moves too far away from or comes too close to the arrow. To fit different scales, use a small distance value and multiply it with the variable
@map_scale
:If you want to rotate the labels as well, go down to
Data defined
and set a data driven override forRotation
, where you just set the attribute that contains the rotation angle (the same you used for the arrows).