[mapserver-users] Problems with labels

woodbri at swoodbridge.com woodbri at swoodbridge.com
Mon Sep 30 08:10:04 EDT 2002


On 30 Sep 2002 at 12:46, James Anderson wrote:

> Hi,
> 
> The dbf file of this layer has 1000s of labels in it.  If I have to
> manually setup each label, that will be a lot of work

I'm not sure what you are thinking about, but if you just want to 
display the labels mapserver will do it just like polygons.

Here is an example, that places a red circle on the map at the label 
location and labels it. You need to read up on the mapfile reference 
for other options that you might want to change.

-Steve

LAYER
TYPE POINT
LABELITEM "NAME"    <--- put name of dbf field that has label text
CLASS
   SYMBOL 'circle'
   SIZE 4
   COLOR 255 0 0    # make it a red circle of size 4
   LABEL
     SIZE 'small'
     TYPE 'bitmap'
     BUFFER 3
     POSITION 'auto'
   END
  END
END

> Regards,
> 
> James.
> 
> ----- Original Message -----
> From: <woodbri at swoodbridge.com>
> To: "James Anderson" <james at danisat.net>;
> <mapserver-users at lists.gis.umn.edu>
> Sent: Friday, September 27, 2002 1:58 PM
> Subject: Re: [mapserver-users] Problems with labels
> 
> 
> | James,
> |
> | You can do one of two things to get labels.
> |
> | 1) if you want the point marker and the label then leave the TYPE as
> | POINT but you need to add LABELITEM "dbf field name" to the LAYER
> and | add a LABEL block to your CLASS block inside the LAYER block. |
> | 2) if you only want the label and not the point mark, then declare |
> the TYPE as ANNOTATION and do the same as above. | | -Steve | | On 27
> Sep 2002 at 10:30, James Anderson wrote: | | > | > | > Hi, | > | > I
> am a Mapserver Newbie. I have a mapinfo map with text labels. I have |
> > exported the mapinfo.tab file to shape files. I get a files like | >
> lt_text.shp and lt_polyline.shp | > | > When I display the
> lt_polyline.shp in mapserver it displays fine. I | > use the line
> type. When I display the lt_text.shp in mapserver it | > draws points
> where the text would be. I am using the point type. | > | > I need to
> be able to get mapserver to actually display the text | > labels. How
> can I do this ?? I have tried various types for the | > text shp file,
> but it either does not display the text or it makes an | > error and
> does not diplay the map.The dbf file that is alongside the | > shp
> file has all the labels in it. Can anyone help ?? | > | > Thanks, | >
> | > James. | > |
> 
> 





More information about the mapserver-users mailing list