[mapserver-users] label sizes not scaling

Steve Lime Steve.Lime at dnr.state.mn.us
Wed Jun 24 09:13:17 PDT 2009


You need to set a SYMBOLSCALE at the layer level. That's the scale denominator (e.g. 100000) at
which a label SIZE will be equal to what you set in the mapfile. As you move away from that value
the labels will get larger or smaller.

Steve

>>> On 6/24/2009 at 3:44 AM, in message
<8FD90A8C-99C0-4602-AAD0-9D2C35584B31 at remoteinformation.com.au>, Ben Madin
<ben at remoteinformation.com.au> wrote:
> G'day all,
> 
> using mapserver 5.4 as a WMS server (to an openlayers application) I  
> don't seem to be able to get any scaling of labels.
> 
> If I set SIZE 10, they are 10 pixel. If I don't set any size params,  
> they are 4. If I set minsize, they are minsize (but the ALIGN is  
> poor). if I set minsize 8 and size 10, they are size 10 and the ALIGN  
> is pretty good.
> 
> I'm actually projecting a network graph, so it would be good to be  
> able to see the priority labels when zoomed out, and the others when  
> zoomed in, but at a legible (and sensible) size.
> 
> I'm not sure where to start - is it MapServer, WMS, OpenLayers, or a  
> false sense I had that this was how it should work...
> 
> cheers
> 
> Ben
> 
> (Mapfile layer (it's postgis):
> 
>          NAME "titles"
>          DEBUG 2
>          GROUP "Nodes"
>          SIZEUNITS PIXELS
>          METADATA
>              layer_title "titles"
>              layer_order "1"
> 			"wms_title" "titles"
> 			"wms_srs"             "EPSG:4326"
> 			"wms_group_title" "Nodes"
>          END
>          DATA "polys FROM (
>          		SELECT n.id, n.title, n.description, colourhex, n.geom,  
> n.rating,
>          		setsrid(n.polygeom, 4326) as polys
>          		FROM nodes n
>          		LEFT OUTER JOIN categories c
>          		ON n.category::int = c.id
>          		AND c.del = 0
>          		WHERE n.del = 0
> 				AND n.graphid = %GRAPHID%
>          ) AS foo USING UNIQUE id USING srid=4326"
>          TYPE ANNOTATION
>          STATUS ON
>          LABELITEM "title"
>          LABELCACHE ON
>          CLASS
>              LABEL
>              	MAXLENGTH 7
>              	WRAP " "
>              	ALIGN center
>              	BUFFER 5
>              	MINSIZE 8
>              	SIZE 10
>              	MAXSIZE 24
>                  COLOR		0 40 0
>                  PRIORITY [rating]
>                  PARTIALS	FALSE
>                  TYPE		TRUETYPE
>                  FONT		lucida
>              END
>           END
> )




More information about the MapServer-users mailing list