perhaps the question is if the getLegendGraphic request supports a title
in the legend. i assumed that it would since the documentation for the
css plugin states "GeoServer uses the title in auto-generating legend
graphics".

i have tried adding a title element to several fields -- and have names
on them as well. i never get any sort title on my legend, below is the
url for the graphic, and the style is attached. am i perhaps missing a
parameter in the request?

http://sedac.ciesin.columbia.edu/geoserver/wms?request=GetLegendGraphic&format=image%2Fpng&layer=grump-v1-population-density_2010&style=legend-title-test&width=15&height=15&legend_options=border:false;mx:0.05;my:0.02;dx:0.2;dy:0.07;fontSize:11;bandInfo:false;
<http://sedac.ciesin.columbia.edu/geoserver/wms?request=GetLegendGraphic&format=image%2Fpng&layer=grump-v1-population-density_2010&style=legend-title-test&width=15&height=15&legend_options=border:false;mx:0.05;my:0.02;dx:0.2;dy:0.07;fontSize:11;bandInfo:false;>

-andrés
 [845.365.8986]


On 07/11/2012 05:21 PM, David Winslow wrote:
> This is the style that was used for the decorations example:
>
> https://github.com/geoserver/geoserver/blob/master/data/release/styles/popshade.sld
>
> The title used for the legend is the title of the style itself, not
> the title of any specific rule. (Rule titles are used for the
> individual swatches.)
>
> Legends might not work so well with CSS, the legend generation is
> pretty tightly based on the structure of SLD.  But I'm interested to
> hear about how it goes if you try this out.
>
> --
> David Winslow
> OpenGeo - http://opengeo.org/
>
> On Wed, Jul 11, 2012 at 4:58 PM, Andrés González
> <[email protected] <mailto:[email protected]>>
> wrote:
>
>     Hello All, hopefully someone has a quick and easy answer to this;
>
>     I'm looking to add title to our legends, but unable to get it working
>     properly. What is required for a legend to have a title like the
>     following:
>     http://docs.geoserver.org/latest/en/user/_images/decoration.png
>
>     how is "USA Population" added to the legend here?
>
>     according to this page, it should be in the <Title> tag within the
>     <Rule> tag:
>     
> http://docs.geoserver.org/latest/en/user/community/css/tutorial.html#setting-titles-for-the-legend
>
>     but it won't work... tried adding several title tags just in case, and
>     can't get any variation to display the title. any help will be
>     appreciated, thanks in advance.
>
>     --
>     -andrés
>      [845.365.8986 <tel:%5B845.365.8986>]
>
>
>     
> ------------------------------------------------------------------------------
>     Live Security Virtual Conference
>     Exclusive live event will cover all the ways today's security and
>     threat landscape has changed and how IT managers can respond.
>     Discussions
>     will include endpoint security, mobile security and the latest in
>     malware
>     threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>     _______________________________________________
>     Geoserver-users mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
 xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
 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";>
  <NamedLayer>
    <Name>grump-v1-population-density_2010</Name>
    <Title>HELLO! (namedLayer)</Title>
    <UserStyle>
      <Name>grump-v1-population-density_2010:default</Name>
      <Title>HELLO! (userStyle)</Title>
      <Abstract> This layer projects the estimated population density of 2010 by urban and rural extents.  Source: SEDAC </Abstract>
      <FeatureTypeStyle>
        <FeatureTypeName>Feature</FeatureTypeName>
        <Rule>
          <Title>HELLO! (rule)</Title>
          <RasterSymbolizer>
            <ColorMap type="values">
            <ColorMapEntry color="#FFFFFF" quantity="0" label="0" />
            <ColorMapEntry color="#FFFF80" quantity="1" label="1 - 5" />
            <ColorMapEntry color="#FCDF5D" quantity="2" label="6 - 25" />
            <ColorMapEntry color="#D68522" quantity="3" label="26 - 250" />
            <ColorMapEntry color="#9E4510" quantity="4" label="251 - 1,000" />
            <ColorMapEntry color="#6B0601" quantity="5" label="1,000 +" />
           </ColorMap>
          </RasterSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to