Opened 12 years ago
Last modified 12 years ago
#4124 new enhancement
annotation type layer with points
Reported by: | zanollim | Owned by: | tbonfort |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Renderer API | Version: | 6.0 |
Severity: | normal | Keywords: | |
Cc: | sdlime |
Description
I have a layer of points defined as TYPE ANNOTATION in my mapfile.
In the LABEL section I have POSITION auto, so MapServer calculates a label position that will not interfere with other labels.
The "problem" is that the default position with POSITION auto is "ul". I think that this is correct if the layer is of TYPE POINT, but if the layer is of TYPE ANNOTATION, the default position would be "cc" (like for polygons?)
If I tell explicitly mapserver to use POSITION cc, the labels are correctly drawn centered on their point, but overlapping labels are not managed.
Is my suggestion correct? Am I worng? Thanks a lot.
Attachments (3)
Change History (6)
comment:1 by , 12 years ago
Cc: | added |
---|
comment:2 by , 12 years ago
by , 12 years ago
Attachment: | overlapping_labels_force_true.png added |
---|
by , 12 years ago
Attachment: | overlapping_labels_force_false.png added |
---|
by , 12 years ago
Attachment: | overlapping_labels_position_auto.png added |
---|
comment:3 by , 12 years ago
Steve, thanks a lot for your answer.
I have the following test case. The layer is a point layer. If the points are < 10 meters near, the labels are drawn overlapping. If I set FORCE FALSE, then only the first label is drawn, the other overlapping labels are missing.
Finally, if I set POSITION auto, the overlapping labels are correctly managed, but for all non overlapping labels the text is not placed centered on the point, but upper left (and this is not my wish)
Note that I use TYPE ANNOTATION because I do not want to see the points on the map, but only the texts.
See the png attached.
LAYER NAME "zone_labels_08op_b_approv" [..] TYPE ANNOTATION STATUS OFF TEMPLATE void LABELITEM 'label' LABELMAXSCALEDENOM 15001 MINSCALEDENOM 50 SIZEUNITS meters METADATA "wms_enable_request" "GetCapabilities !GetFeatureInfo" END CLASS LABEL TYPE TRUETYPE ANTIALIAS TRUE FONT arial-narrow-bold POSITION cc SIZE [size] MINSIZE 6 FORCE TRUE COLOR 0 0 0 END END END
The behavior you're seeing is intended, that is, the markers are always drawn centered on the computed label point. The only way to get the label to overlap the marker is to set POSITION CC. The AUTO placement doesn't use the CC at all. This is because I felt that if you want the overlap then you'd be explicit and set CC.
When you say overlapping labels are not managed with POSITION CC should not be the case. I use this config all the time when labeling lines with shields and road numbers. Do you have a specific test case that shows the error?
Sorry if I'm not following you correctly... Steve