Hi

I am trying to find the best way to show a legend in an openlayers map using 
the GetLegendGraphic facility

I am then putting the url below  in an image tag but I don't get any text

http://gistest:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=25&HEIGHT=25&LAYER=Geostore:Wards

Using one of the sld examples with topps :states and that has text

http://gistest:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=topp:states

the text is coming from the <Title>&lt; test</Title> tag

but when I add one to my sld I get no text


Can anyone shed aany light or maybe suggest a better way to get a legend from 
geoserver onto an openlayers map

PS - I also tried using the css legend in the layouts folder but didn't get 
anywhere with that either

Below is my sld:-

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld"; 
xmlns:ogc="http://www.opengis.net/ogc";
  xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:gml="http://www.opengis.net/gml";
  xsi:schemaLocation="http://www.opengis.net/sld 
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd";>
  <NamedLayer>
    <Name>Polygon with styled label</Name>
    <UserStyle>
      <Title>SLD Cook Book: Polygon with styled label</Title>
      <FeatureTypeStyle>
        <Rule>
        <Title>&lt; test title</Title>


          <PolygonSymbolizer>

            <Stroke>
              <CssParameter name="stroke">#800000</CssParameter>
              <CssParameter name="stroke-width">3</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
          <TextSymbolizer>
            <Label>
              <ogc:PropertyName>WardName</ogc:PropertyName>
            </Label>
            <Halo>
              <Radius>3</Radius>
              <Fill>
                <CssParameter name="fill">#FFFFFF</CssParameter>
              </Fill>
            </Halo>

            <Font>
              <CssParameter name="font-family">Comic Sans MS</CssParameter>
              <CssParameter name="font-size">11</CssParameter>
              <CssParameter name="font-style">normal</CssParameter>
              <CssParameter name="font-weight">bold</CssParameter>
            </Font>
            <LabelPlacement>
              <PointPlacement>
                <AnchorPoint>
                  <AnchorPointX>0.5</AnchorPointX>
                  <AnchorPointY>0.5</AnchorPointY>
                </AnchorPoint>
              </PointPlacement>
            </LabelPlacement>
            <Fill>
              <CssParameter name="fill">#000000</CssParameter>
            </Fill>
            <VendorOption name="autoWrap">60</VendorOption>
            <VendorOption name="maxDisplacement">150</VendorOption>
          </TextSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
This e-mail and any attachments are confidential. It may contain privileged 
information and is intended for the named recipient(s) only. It must not be 
distributed without consent. If you are not one of the intended recipients, 
please notify the sender immediately and do not disclose, distribute, or retain 
this email or any part of it and do not take any action based on it.

Unless expressly stated, opinions in this email are those of the individual 
sender, and not of Knowsley MBC. Legally binding obligations can only be 
created for, or be entered into on behalf of, Knowsley MBC by duly authorised 
officers or representatives.

Knowsley MBC excludes any liability whatsoever for any offence caused, any 
direct or consequential loss arising from the use, or reliance on, this e-mail 
or its contents. We believe but do not warrant that this e-mail and any 
attachments are virus free. You must therefore take full responsibility for 
virus checking and no responsibility is accepted for loss or damage arising 
from viruses or changes made to this message after it was sent. Knowsley MBC 
reserves the right to monitor and/or record all e-mail communications through 
its network in accordance with relevant legislation.

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to