Opened 18 years ago
Last modified 13 years ago
#1592 new enhancement
Improved Label Position Capabilities — at Initial Version
Reported by: | Owned by: | sdlime | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapServer C Library | Version: | unspecified |
Severity: | minor | Keywords: | tbonfort |
Cc: | tbonfort, woodbri@… |
Description
We need to have improved control over label positioning. Currently OFFSETs are only in image space. I and Bob Basques, may be others, would like to be able to add house number range labels to road polylines. This could easily be done with the features described below which also would faciliate numerous other label capabilities like placing a directional marker at a given percentage along the line. Requirements: 1. positional selection of label point at percentage (0.0-1.0) along a line 2. offsetX would always be to the left of the line relative to direction of line 3. offsetY would always be along the direction of travel 4. negative offsets would have the opposite sense 5. (0,0) is the label point, either defined as today or via the percentage above 6. the label point should be effected by POSITION so the label can be positioned above, below, on the line and justified right, left or center. 7. ANGLE AUTO with lines will align the label with the angle of the line at the label point in the case of a polyline 8. For polygons, offsetX will be outside the polygon and -X will be inside the polygon, while offsetY will be along the polygon boundary. This will allow labeling polygons along their boundary without the label flipping to the outside of the bounday. Not sure what to do with multiple parts. 9. For polygons, it might be nice to have a MAXDISTANCE that will allow multiple labels to be generated along a boundary that are spaced at approximately MAXDISTANCE apart. Here is an example of adding address ranges to a road segment along with the road name. LAYER TYPE LINE STATUS DEFAULT DATA ... CLASS COLOR 0 0 0 SYMBOL 'circle' SIZE 3 LABEL PERCENTAGE 0.0 # position at start of line POSITION LL ANGLE AUTO OFFSET 5 5 # 5 pixels to the left, 5 pixels along direction of the line LABELITEM [LEFT_ADDR_FROM] END LABEL PERCENTAGE 0.0 POSITION UL ANGLE AUTO OFFSET -5 5 # 5 pixels to the right, 5 pixels along direction of the line LABELITEM [RIGHT_ADDR_FROM] END LABEL PERCENTAGE 1.0 POSITION LR ANGLE AUTO OFFSET 5 -5 # 5 pixels to the left, and 5 pixel before the end of line LABELITEM [LEFT_ADDR_TO] END LABEL PERCENTAGE 1.0 POSITION UR ANGLE AUTO OFFSET -5 -5 # 5 pixels to the right, and 5 pixel before the end LABELITEM [RIGHT_ADDR_TO] END LABEL PERCENTAGE 0.5 MINDISTANCE 200 POSITION UC ANGLE AUTO LABELITEM [ROAD_NAME] END END END
Note:
See TracTickets
for help on using tickets.