Skip to main content
added example
Source Link
Ian Turton
  • 83.2k
  • 6
  • 89
  • 189

You can specify the optional RULE parameter in your request to specify the rule you want the legend for (see documentation)

You must have a Rule with a Name set, so if you modify the default population style:

 <Rule>
      <Name>top</Name>
      <Title>&gt; 4M</Title>
      
      <!-- like a linesymbolizer but with a fill too -->

You can make a request like:

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

You can specify the optional RULE parameter in your request to specify the rule you want the legend for (see documentation)

You can specify the optional RULE parameter in your request to specify the rule you want the legend for (see documentation)

You must have a Rule with a Name set, so if you modify the default population style:

 <Rule>
      <Name>top</Name>
      <Title>&gt; 4M</Title>
      
      <!-- like a linesymbolizer but with a fill too -->

You can make a request like:

http://localhost:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=topp:states&RULE=top 
Source Link
Ian Turton
  • 83.2k
  • 6
  • 89
  • 189

You can specify the optional RULE parameter in your request to specify the rule you want the legend for (see documentation)