GIF labeling
Chip Taylor
work at XWB.COM
Wed Sep 28 15:26:52 PDT 2005
I am now attempting to do something similar to Kumar with one difference.
Instead of the shield with the number overlayed I need to have the shield on
the Interstate line in one position and the name of the interstate in
another position something like:
=====||========= Interstate 90 =======||======
Where the || is the shield symbol. The annotation text is in a field called
"NAME" and the Feature name is in a field called "FEATURE". I have the
following code in my map file (that works but not like I want it to - the
text overlays the symbol):
****************** start of code *********************
#---------------------------------------------
# Interstate layer
#
LAYER
NAME "interstate1"
GROUP "roads"
DATA "roadtrl020"
STATUS on
TYPE line
LABELCACHE on
LABELITEM "NAME"
CLASSITEM "FEATURE"
#MINSCALE 7500001
CLASS
NAME "Interstate Hwy"
EXPRESSION /Limited Access*/
STYLE
SYMBOL "BigLine"
SIZE 1
COLOR 241 151 91
END
LABEL
TYPE truetype
FONT "arial"
SIZE 8
OUTLINECOLOR 255 255 255
COLOR 0 0 0
MINDISTANCE 200
POSITION auto
ANGLE auto
MINFEATURESIZE 50
END
END
END
#---------------------------------------------
# Shield layer
#
LAYER
NAME "InterstateShield"
Group "roads"
STATUS on
DATA "roadtrl020"
TYPE ANNOTATION
CLASSITEM "NAME"
#LABELITEM 'NAME'
CLASS
EXPRESSION /Interstate*/
COLOR 0 0 0
SYMBOL 'shield.gif'
SIZE 15
LABEL
END
END
END
*************** end of code *******************
I have been able to fake it by setting the label color to 255 255 255 (same
color as the background, the size to 0, and an offst of 100 100 to get the
label out of the way. Is there a better way to do this? Thanks for your
help.
Chip Taylor
Prepares Response, Inc
> -----Original Message-----
> From: UMN MapServer Users List
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Steve Lime
> Sent: Thursday, September 22, 2005 9:41 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] GIF labeling
>
> Sure they can. Use an annotation layer. Here's a snippet from
> our rec compass mapfile, specifically the county highway shields:
>
> LAYER
> NAME road_counln3_anno
> MAXSCALE 200000
> STATUS DEFAULT
> DATA 'data/gen/state/mn/road_counln3'
> TYPE ANNOTATION
> LABELITEM 'road_num'
> CLASS
> COLOR 0 0 0 # dummy color
> SYMBOL '/usr/local/mapserver/symbols/ctyhwy.png'
> LABEL
> MINFEATURESIZE 50
> MINDISTANCE 150
> SIZE TINY
> COLOR 0 0 0
> PARTIALS FALSE
> END
> END
> END
>
> You cannot draw the line, the shield and the number at the
> same time though.
>
> Steve
>
> >>> Kumar <kumar at NEWFIELDS.COM> 09/22/05 9:49 AM >>>
> That would just give me the symbol with the shield without
> line symbol. I need the symbol as a line and the label with shield.
>
> I was wondering if labels can be overlapped using GIF image and label.
>
> - kumar
>
>
> > -----Original Message-----
> > From: UMN MapServer Users List
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]
> > On Behalf Of Kumar
> > Sent: Wednesday, September 21, 2005 9:17 PM
> > To: MAPSERVER-USERS at LISTS.UMN.EDU
> > Subject: [UMN_MAPSERVER-USERS] GIF labeling
> >
> > Hi all,
> >
> > Is it possible to label using gif's?. For example I want to
> label the
> > interstate with the interstate shield symbol with the number
> > inbetween. Is there any way to do this??.
> >
> >
> >
> > Thanks,
> >
> > - kumar
> >
> >
>
>
More information about the MapServer-users
mailing list