[mapserver-users] label sizes not scaling

2009-06-24 Thread Ben Madin

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]
PARTIALSFALSE
TYPETRUETYPE
FONTlucida
END
 END
)

--

Ben Madin
REMOTE INFORMATION

t : +61 8 9192 5455
f : +61 8 9192 5535
m : 0448 887 220
Broome   WA   6725

b...@remoteinformation.com.au



Out here, it pays to 
know...


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] label sizes not scaling

2009-06-24 Thread Steve Lime
You need to set a SYMBOLSCALE at the layer level. That's the scale denominator 
(e.g. 10) 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-9d2c35584...@remoteinformation.com.au>, Ben Madin
 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
>  COLOR0 40 0
>  PRIORITY [rating]
>  PARTIALS FALSE
>  TYPE TRUETYPE
>  FONT lucida
>  END
>   END
> )

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] label sizes not scaling

2009-06-24 Thread Ben Madin

Thanks Steve,

I can now go back to about 20 different map files floating around the  
internet and get this working. For some reason after nearly five years  
of using MapServer I'd never worked this out!


I might trac this for addition to the docs -

cheers

Ben


On 25/06/2009, at 12:13 AM, Steve Lime wrote:

You need to set a SYMBOLSCALE at the layer level. That's the scale  
denominator (e.g. 10) 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-9d2c35584...@remoteinformation.com.au>, Ben  
Madin

 wrote:


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.


--

Ben Madin
REMOTE INFORMATION

t : +61 8 9192 5455
f : +61 8 9192 5535
m : 0448 887 220
Broome   WA   6725

b...@remoteinformation.com.au



Out here, it pays to 
know...


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users