Hi Jonathan, Thank you for your example SLD and the suggestion about the layer-group Title. I tried to add my layer to a layer group, but I could not manage to get the title on top of the legend. Should this title be added automatically when adding a layer that is stored in a layer group?
Thanks. Andreas 2014-08-08 17:31 GMT+02:00 Jonathan Moules < jonathanmou...@warwickshire.gov.uk>: > Hi Andreas, > I get this sort of functionality in some of my legends, i.e.: > > > http://maps.warwickshire.gov.uk/gs/ows?TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=OS_MasterMap_Group_Traditional_Style&FORMAT=image%2Fpng&SCALE=4999.999998423737 > > For which the SLD structure looks like: > > <?xml version="1.0" encoding="UTF-8"?> >> <StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc=" >> http://www.opengis.net/ogc" xmlns:xsi=" >> http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink=" >> http://www.w3.org/1999/xlink" xsi:schemaLocation=" >> http://www.opengis.net/sld >> http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se= >> "http://www.opengis.net/se"> >> <NamedLayer> >> <se:Name>Topographic Area - General Styling</se:Name> >> <UserStyle> >> <se:FeatureTypeStyle> >> >> <!-- Interim solution for not-filling properly --> >> <se:Rule> >> <se:Name>Green Stuff 1</se:Name> >> <ogc:Filter> >> <ogc:PropertyIsEqualTo> >> <ogc:Function name="in10"> >> <ogc:PropertyName>OSMMSTYLE_NAME</ogc:PropertyName> >> <ogc:Literal>nonconiferousTreesAndScatteredRocksPattern</ >> ogc:Literal> >> <ogc:Literal>roughGrassAndRocksPattern</ogc:Literal> >> <ogc:Literal>rocksRoughGrassAndBouldersPattern</ >> ogc:Literal> >> <ogc:Literal>coniferousTreesAndScatteredRocksPattern</ >> ogc:Literal> >> <ogc:Literal>roughGrassScatteredRocksAndHeathPattern</ >> ogc:Literal> >> <ogc:Literal>roughGrassScatteredRocksAndBouldersPattern</ >> ogc:Literal> >> <ogc:Literal>heathAndScatteredRocksPattern</ogc:Literal> >> <ogc:Literal>roughtGrassAndHeathPattern</ogc:Literal> >> <ogc:Literal>roughGrassAndScatteredRocksPattern</ >> ogc:Literal> >> <ogc:Literal>roughGrassScatteredRocksAndScatteredBoulders >> </ogc:Literal> >> </ogc:Function> >> <ogc:Literal>true</ogc:Literal> >> </ogc:PropertyIsEqualTo> >> </ogc:Filter> >> <se:MaxScaleDenominator>5100</se:MaxScaleDenominator> >> <se:PolygonSymbolizer> >> <se:Fill> >> <se:SvgParameter name="fill">#C2F2AA</se:SvgParameter> >> </se:Fill> >> </se:PolygonSymbolizer> >> </se:Rule> >> ... >> </se:FeatureTypeStyle> >> >> </UserStyle> >> </NamedLayer> >> </StyledLayerDescriptor> > > > > Note that the title you see at the top of the legend is actually the > layer-group "Title". It doesn't appear anywhere in the SLD. > > ===== > > Also, a suggestion - there is a PropertyIsBetween filter which you could > use instead of your lessthan / greaterthan option. > > http://docs.geoserver.org/latest/en/user/styling/sld-reference/filters.html#comparison-operators > > Cheers, > Jonathan > > > > On 8 August 2014 09:53, Andreas Forø Tollefsen <andrea...@gmail.com> > wrote: > >> I tried with AtlasStyler. It included a title tag i could change. >> However, the title does not show over the legend. >> Any suggestions or working examples? >> 8. aug. 2014 08:17 skrev "Andreas Forø Tollefsen" <andrea...@gmail.com> >> følgende: >> >> Hi, >>> >>> I have a SLD file generated by QGIS to visualize a WMS layer. >>> This works without any problem. >>> >>> However, when using GetLegendGraphics with attribution in OpenLayers, >>> the legend comes up as expected, but without a title. >>> I have understood that this is likely to be due to a missing <title> tag >>> in the SLD file. >>> However, when adding <title> to the SLD it is no longer possible to >>> validate the SLD code. >>> I have attached two files, working.sld and notworking.sld. >>> The only difference is the adding of the <title> tag. >>> >>> What is the issue here? I have seen a number of SLD files that has the >>> <title> inserted, and not reporting issues. >>> >>> Thanks. >>> >>> Andreas >>> >>> >> >> ------------------------------------------------------------------------------ >> Want fast and easy access to all the code in your enterprise? Index and >> search up to 200,000 lines of code with a free copy of Black Duck >> Code Sight - the same software that powers the world's largest code >> search on Ohloh, the Black Duck Open Hub! Try it now. >> http://p.sf.net/sfu/bds >> _______________________________________________ >> Geoserver-users mailing list >> Geoserver-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/geoserver-users >> >> > > This transmission is intended for the named addressee(s) only and may > contain confidential, sensitive or personal information and should be > handled accordingly. Unless you are the named addressee (or authorised to > receive it for the addressee) you may not copy or use it, or disclose it to > anyone else. If you have received this transmission in error please notify > the sender immediately. All email traffic sent to or from us, including > without limitation all GCSX traffic, may be subject to recording and/or > monitoring in accordance with relevant legislation.
------------------------------------------------------------------------------
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users
