[mapserver-users] Usage of Vendor Option

David Alda Fernandez de Lezea dalda at ikt.es
Thu Nov 19 23:49:00 PST 2009


Hi,
 
I've got a SLD that I apply to a polygon layer and I want to add a label to identify those polygons. I manage to add the the labels but my problem is that the labels are repeated a lot of times into the polygons and furthermore they don't appear on the centroif of my polygon. Here is my TextSymbolizer tag:
 
<TextSymbolizer>
        <sld:MinScaleDenominator>3000</sld:MinScaleDenominator>
        <sld:MaxScaleDenominator>5000</sld:MaxScaleDenominator>
        <Label>
         <ogc:PropertyName>MUNICIPIO</ogc:PropertyName>         
        </Label> 
        <Font> 
         <CssParameter name="font-family">Arial</CssParameter> 
         <CssParameter name="font-weight">bold</CssParameter> 
         <CssParameter name="font-size">8</CssParameter> 
        </Font> 
        <!-- this centers the label on the polygon's centroid-->
        <LabelPlacement>
          <PointPlacement> 
          <AnchorPoint>
            <AnchorPointX>0.5</AnchorPointX>
            <AnchorPointY>0.5</AnchorPointY>
          </AnchorPoint>
          </PointPlacement>         
        </LabelPlacement>
         <!--  make the label easy to read-->
        <Halo>        
           <Radius>
           <ogc:Literal>2</ogc:Literal>
           </Radius>
           <Fill>
          <CssParameter name="fill">#FFFFFF</CssParameter>
          <CssParameter name="fill-opacity">0.85</CssParameter>    
           </Fill>
        </Halo>
        <Fill>
         <CssParameter name="fill">#000000</CssParameter>  
        </Fill>
        <!-- This labels each name only once, not every shape with that name -->
        <VendorOption name="group">true</VendorOption>
  </TextSymbolizer>
 

 

 

Un saludo,

 

··················································································


David Alda Fernández de Lezea

Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad

 

IKT

Granja Modelo s/n · 01192 · Arkaute (Araba)


··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: dalda at ikt.es                                web: www.ikt.es <http://www.ikt.es/> 
··················································································

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091120/b8847520/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.gif
Type: image/gif
Size: 790 bytes
Desc: logo.gif
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091120/b8847520/attachment.gif>


More information about the MapServer-users mailing list