[mapserver-users] scaling labels

Steve Lime steve.lime at dnr.state.mn.us
Wed Jul 10 17:24:18 EDT 2002


I'm not sure what you're asking in 1. A shape belongs to the first class
it matches, period. I think you'll need to draw the shapefile in
question (perhaps once as an annotation layer) to get the effect you're
after.

On 2. you've neglected to define a SIZE for the label. Default it
probably a GD constant for bitmap fonts (1 or something like that). Also
note that you won't get any scaling unless you define a value for
SYMBOLSCALE.

Steve

Stephen Lime
Data & Applications Manager

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

>>> Alexander Shostko <shostko at ureach.com> 07/09/02 11:49PM >>>
Dear Mapserver Users!

Thanks in advance for reading this message and for all possible 
hints and suggestions.

1. how can I make the class transparent (so other classes can 
set the color on the same shapes)in the same layer ?

e.g.

class
   expression( [level] lt 3.0 )
   # should be transparent, but allow other class to set the 
color. Only labels should be defined
   label

   end
end
class
   expression ( [perimeter] > 3.0 )
   color 23 23 23 
   outlinecolor 0 0 0 
end 

2. I use labeling based on the attributes (mapserver v 3.6 GIF 
version) and use CGI only.  However it uses
bitmap fonts and they do not scale at all. If I put 'type 
truetype, then no labels is shown at all.  What can be 
the possible reason.

The layer looks like:

  layer
    classitem 'STATE'
    data "statesp020"
    group "statesp020"
    labelcache on
    labelitem 'STATE'
    name "statesp020"
    postlabelcache true
    status on
    type polygon
  # red
    class
     EXPRESSION (  [LEVEL] ge 9.0 ) 
     color 255 0 0
     outlinecolor 72 61 139
     TEXT( [STATE] )
     label
       position auto
       font arial
       minsize 10
       maxsize 30
       mindistance 100
       buffer 100
       force true
       color 0 0 0 
    end
   end
    # 1 class statesp020_1
   class
     EXPRESSION ( [LEVEL] lt 2.0  )
     color 128 128 128
     outlinecolor 72 61 139
   end
  # green
   class
     EXPRESSION ( [LEVEL] ge 2.0 and [LEVEL] lt 4.0 ) 
     color 32 178 170
     outlinecolor 72 61 139
     TEXT( [STATE] )
     label
       type truetype
       position auto
       font arial
       minsize 10
       maxsize 30
       mindistance 100
       buffer 100
       force true
       color 0 0 0
    end
   end
end 



Thanks again for your time reading this message

Alexander Shostko






More information about the mapserver-users mailing list