You certainly can have STYLEs inside labels. I use this to do shields on county 
roads:

  CLASS
    NAME 'County Road'
    STYLE
      COLOR 255 255 255
      WIDTH 1 MAXWIDTH 1.5 MINWIDTH .75
      OUTLINECOLOR 200 200 200
      OUTLINEWIDTH 1
    END
    LABEL
      STYLE # shield
        SYMBOL 'county_road'
        COLOR 255 255 255
        OUTLINECOLOR 146 146 146
        SIZE 13 MINSIZE 13 MAXSIZE 13
        WIDTH .5 MINWIDTH .5 MAXWIDTH .5
      END
      PRIORITY 1
      TYPE TRUETYPE
      FONT 'myriad_condensed_web'
      SIZE 5 MINSIZE 5 MAXSIZE 5
      COLOR 146 146 146
      MINDISTANCE 150
      ANTIALIAS TRUE
      PARTIALS FALSE
      MINFEATURESIZE 20
    END
  END

Where county_road is referencing a true type font glyph. I'm actually doing 
some other conversions to remove dependency on ANNOTATION layers and haven't 
run into any problems yet. Perhaps the problem isn't with the style placement 
in the label but rather the contents of the style. You'd get a parse error 
otherwise.

Steve


From: mapserver-users [mailto:[email protected]] On 
Behalf Of Mark Volz
Sent: Thursday, February 23, 2017 1:48 PM
To: [email protected]; [email protected]
Subject: Re: [mapserver-users] Road shields on Mapserver 7

Brent,

I think your right.   I was under the impression that STYLE could be within a 
LABEL object because since Mapserver 6.2 we could have multiple labels per 
class.

Anyways, how can I add road shields in Mapserver 7?  Apparently annotation 
layers have been removed.

Thanks!

Sincerely,
Mark Volz, GISP

From: Brent Fraser [mailto:[email protected]]
Sent: Thursday, February 23, 2017 1:39 PM
To: [email protected]<mailto:[email protected]>; 
Mark Volz <[email protected]<mailto:[email protected]>>
Subject: RE: [mapserver-users] Road shields on Mapserver 7

I don't think you can put a STYLE inside a LABEL.  You could put it after the 
LABEL...



________________________________
From: "Mark Volz" <[email protected]<mailto:[email protected]>>
Sent: Thursday, February 23, 2017 12:32 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>, 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: RE: [mapserver-users] Road shields on Mapserver 7

Brent,

I am using Mapserver 7.0.4.

Sincerely,
Mark Volz, GISP

From: Brent Fraser [mailto:[email protected]]
Sent: Thursday, February 23, 2017 12:17 PM
To: [email protected]<mailto:[email protected]>; 
Mark Volz <[email protected]<mailto:[email protected]>>
Subject: re: [mapserver-users] Road shields on Mapserver 7

version of Mapserver?



________________________________
From: "Mark Volz" <[email protected]<mailto:[email protected]>>
Sent: Thursday, February 23, 2017 10:50 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [mapserver-users] Road shields on Mapserver 7

Hello,

I am having trouble adding road shields to my map.  The label (and for that 
matter the entire class) quits drawing as soon as I uncomment the STYLE block 
under label.  Please let me know What I can do to add road shields to my roads 
layer.

CLASS
NAME "U.S. Highway"
EXPRESSION "A10"
STYLE
WIDTH 5
COLOR 0 0 0
END #STYLE
STYLE
WIDTH 3
                                COLOR 227 159 2
                END #STYLE
                LABEL
TEXT '[ROADNUM]'
                                SIZE 10 #for AGG
                                FONT vera_sans  #for AGG
                                MINFEATURESIZE 25
                                MINDISTANCE 200
#STYLE   ###  Mapserver quits drawing this layer as soon as I uncomment this 
block
                                                #SYMBOL './symbols/USHWY.png'
                                #END STYLE
                END #label
END #class

P.S.  Eventually I will want to display both the road number shield and the 
road name as well.

Thank You
Sincerely,
Mark Volz, GISP

_______________________________________________
mapserver-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to