Hiya,

Check out the interiorPoint function as discussed in this thread 
http://permalink.gmane.org/gmane.comp.gis.geoserver.user/33677. Thus, you 
explicitly define a point geometry to be used to position the graphic and the 
label.

Also, you can reference a graphic inside a TextSymbolizer, an approach 
typically used for creating highway shields:

<TextSymbolizer>
    <Label>
        <ogc:PropertyName>NAME</ogc:PropertyName>
    </Label>    
    <LabelPlacement>
        <PointPlacement>
            <AnchorPoint>
                <AnchorPointX>0.5</AnchorPointX>
                <AnchorPointY>1</AnchorPointY>
            </AnchorPoint>
            <Displacement>
                <DisplacementX>0</DisplacementX>
                <DisplacementY>-10</DisplacementY>
            </Displacement>
        </PointPlacement>
    </LabelPlacement>
    <Fill>
        <CssParameter name="fill">#000000</CssParameter>
    </Fill>
    <Graphic>
        <ExternalGraphic>
            <OnlineResource
                xlink:type="simple"
                 xlink:href="file:///C:/Subramanian/reficons/park.jpg"    />
            <Format>image/jpeg</Format>
         </ExternalGraphic>
     </Graphic>
</TextSymbolizer>

Regards,

Edward

Date: Sun, 28 Oct 2012 20:30:38 +0530
From: [email protected]
To: [email protected]
Subject: [Geoserver-users] Polygon label with graphic

Hi,
I have a polygon layer, which I want to label it WITH a jpg file. I am NOT able 
to display jpg file and label along with it. Label and jpg is appearing at 
different place on the map.Is it possible to label polygon with jpg file ?á

Following is the contents of sld file,
<PolygonSymbolizer>
á á á áá<Fill>
á á á á áá<CssParameteráname="fill">#c9dfaf</CssParameter>
á á á áá</Fill>
á á á áá<Stroke>
á á á á áá<CssParameteráname="stroke">#999999</CssParameter>
á á á á áá<CssParameteráname="stroke-width">0</CssParameter>
á á á áá</Stroke>
á á á</PolygonSymbolizer>á á á áá
á á á áá á á á áá<PointSymbolizer>
á áá<Graphic>
á áá<ExternalGraphic>
á á áá<OnlineResource
á á á ááxlink:type="simple"
á á á ááxlink:href="file:///C:/Subramanian/reficons/park.jpg"á/>
á á áá<Format>image/jpeg</Format>
á áá</ExternalGraphic>
á áá</Graphic>
á á á á á ááá á</PointSymbolizer>á á á á
á á á<TextSymbolizer>
á á á áá<Label>
á á á á á áá<ogc:PropertyName>NAME</ogc:PropertyName>
á á á áá</Label>
ááá á á á<LabelPlacement>
á á á á á á<PointPlacement>
á á á á á á á<AnchorPoint>
á á á á á á á á<AnchorPointX>0.5</AnchorPointX>
á á á á á á á á<AnchorPointY>1</AnchorPointY>
á á á á á á á</AnchorPoint>
á á á á á á á<Displacement>
á á á á á á á á<DisplacementX>0</DisplacementX>
á á á á á á á á<DisplacementY>-10</DisplacementY>
á á á á á á á</Displacement>
á á á á á á</PointPlacement>
á á á á á</LabelPlacement>
ááá á á á áá</TextSymbolizer>



------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users                    
                  
------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to