[mapserver-dev] Labeling enhancements not related to justification
Stephen Woodbridge
woodbri at swoodbridge.com
Tue May 6 15:53:17 EDT 2008
Thomas,
The one request I get a lot from users is for an arrow label based on an
axillary label placement point. This would be like how google labels the
small states on the US Eastern seaboard with the label in the ocean and
an arrow pointing to where the object label point is.
I would propose a syntax like this into implement this, but something
else might be better if anyone has any ideas.
LABEL
....
AUXPOINT [label_x] [label_y]
....
END
Where the [label_x], [label_y] are column references and this point
would be used to place the label text and then an arrow would be
constructed back to the objects label point from this AUXPOINT. If
[label_x],[label_y] is equal to 0,0 then default labeling behavior would
apply and the AUXPOINT would be ignored.
One could also set up FILTERs to select label_x != 0 to separate
AUXPOINT labels from standard labels if they wanted to.
You could also add an optional arrowhead style and size fields, like:
[ah_style] and [ah_size]:
AUXPOINT [label_x] [label_y] [ah_style] [ah_size]
which could be used to determine what style of arrow to use. Like:
[ah_style]:
plain - simple line
arrow - line with arrowhead
dot - line with dot instead of arrowhead
[ah_size] controls the size of the arrowhead or dot
[label_x] [label_y] [ah_style] [ah_size] can be constants or column
substitutions.
LabelCache processing would look at the bbox for the label text, not the
arrow, or if looking at the arrow also would only look at the arrow path
not the arrow's bbox. Maybe some more thought needs to go into this part
of the proposal.
-Steve W.
More information about the mapserver-dev
mailing list