[mapserver-users] label symbol size vs. label font size

Stephen Lime steve.lime at dnr.state.mn.us
Mon Aug 20 12:27:12 EDT 2001


If the shields are images then they can't be scaled and size is ignored. The label size and symbol
size are not tied together in anyway. The best way to deal with 3 digits would be to have 2 versions
of the symbol (i.e. 2 gifs) and then use the length operator in an expression. You could also change
font size based on length. For example:

CLASS
  # class for 2 digit labels
  EXPRESSION (length('[HWYNUM]') eq 2)
  ...
END
CLASS
  # class for 2+ digit labels (note: no expression)
  ...
END

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Chad Nielsen" <cnielsen at co.tillamook.or.us> 08/16/01 01:20PM >>>
I'm having trouble adjusting the size of my highway shield symbols relative
to the label font size. Seems I can only make the highway shields bigger if
I make the font bigger, i.e. by increasing the SIZE attribute of the LABEL
object. Problem is I have 3-digit highway numbers which makes the text go
outside the shield boundary. If I increase the SIZE attribute of the CLASS
object nothing happens. How can I make the shield bigger without making the
label font bigger? Or, is there some other trick to getting 3-digits to fit
inside a shield? here is what I have in my map file:

LAYER
      NAME highwayshields
      DATA 'e:\gisweb\data\transportation\shapes\nwohwy'
      STATUS ON
      TYPE ANNOTATION
      LABELITEM "HWYNUM"
       CLASS
	   COLOR 0 0 0
	   SIZE 18
         SYMBOL 3
         OUTLINECOLOR 0 0 0
         LABEL
            SIZE 10
            MINDISTANCE 200
	      COLOR 0 0 0
	      BACKGROUNDCOLOR -1 -1 -1
	      TYPE TRUETYPE
	      FONT verdana-bold
	      POSITION CC
	    END #LABEL
       END # CLASS
END # LAYER

TIA,
Chad

Chad M. Nielsen, GIS Programmer/Analyst
Tillamook County Performance Partnership (TCPP)
Tillamook Coastal Watershed Resource Center (TCWRC)

  GIS:   http://gisweb.co.tillamook.or.us 
 TCPP:   http://www.co.tillamook.or.us/gov/Estuary/homepage.htm 
TCWRC:   http://www.tcwrc.org 






More information about the mapserver-users mailing list