Opened 14 years ago
Closed 12 years ago
#3335 closed defect (fixed)
Label style support
Reported by: | sdlime | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | MapServer C Library | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | dmorissette, aboudreault, havatv |
Description
Ticket to track add styleObj's to label objects. This allows you to draw, for example, road symbology and road shields at the same time. (yeah!)
Steve
Change History (10)
comment:1 by , 14 years ago
Cc: | added |
---|
comment:2 by , 14 years ago
Status: | new → assigned |
---|
comment:4 by , 13 years ago
Cc: | added |
---|
comment:5 by , 13 years ago
Cc: | added |
---|
I have discovered that LABEL STYLE OFFSET
, at least when used with GEOMTRANSFORM 'labelpoly'
does not work as expected when SYMBOLSCALEDENOM
is specified for the layer. If someone is interested in testing, use shp2img with the following map file (FONTSET
will probably have to be changed). If SYMBOLSCALEDENOM
is commented out, behaviour is as expected. When SYMBOLSCALEDENOM
is in effect, the offset will be scaled. Documentation says that OFFSET
is given in pixels.
MAP SIZE 200 200 EXTENT 0 0 100 100 UNITS meters IMAGETYPE png FONTSET /usr/share/fonts/truetype/font.list SYMBOL NAME "circle" TYPE ellipse FILLED true POINTS 1 1 END END LAYER NAME "feature" STATUS DEFAULT TYPE POINT SYMBOLSCALEDENOM 25000 FEATURE TEXT "Label" POINTS 50 50 END END CLASS STYLE # black filled circle SYMBOL 'circle' MINSIZE 4 SIZE 4 MAXSIZE 4 COLOR 0 0 0 END LABEL STYLE # ------ Gray Box (shadow) ------ GEOMTRANSFORM labelpoly COLOR 102 102 102 OFFSET 2 2 END STYLE # ------ Red Box ------ GEOMTRANSFORM labelpoly COLOR 255 0 0 END FONT "arial" TYPE TRUETYPE POSITION UR MINSIZE 12 SIZE 12 MAXSIZE 12 COLOR 0 0 0 END END END # point END # Map file
I have tested with 6.0 and trunk.
Should this be filed as a separate ticket?
comment:6 by , 13 years ago
I'd like to track as a separate issue. It gets confusing otherwise. If the docs have been updated then let's close this ticket.
Steve
comment:7 by , 13 years ago
I think documentation is OK for the mapfile section (added in r11453), but nothing seems to be documented for mapscript. Who will do the mapscript documentation?
comment:8 by , 13 years ago
Steve, please only close this ticket when the ticket's purpose has been accomplished:
"Ticket to track add styleObj's to label objects"
I would love it if you added "Layer" objects to that purpose as well.
As far as I can find out, this is not yet implemented, and hence has not been implemented in the C# wrapper of MapScript, which is what I'm waiting for.
comment:9 by , 13 years ago
Alan B has clarified a misleading statement in the migration guide for me. Please ignore my comment about adding to the Layer object.
Initial implementation committed in r9859. Two types of styles are supported and are differentiated by their GEOMTRANSFORM: labelpnt (default) and labelpoly.
To draw a marker under a label, simply do:
To draw a background block and shadow do:
Todo's:
Steve