GetLegendGraphic Request |
The parameters of a GetLegendGraphic request are listed in Table 1 below.
Table 1 The Parameters of a GetLegendGraphic Request
| Request parameters | O/M /Optional | Description |
| VERSION=version |
R |
Request version. |
| REQUEST=GetLegendGraphic |
R |
Request name. Ruquests the GetLegendGraphic operation, and the request name should be set as "GetLegendGraphic". |
|
LAYER=layer |
R |
The layer for generating the legend, with the layer name defined as the value of the <Layer><Name> element in the service metadata. |
| STYLE=style |
O |
The layer style for generating the legend. If not specified, the default style is used. |
| SLD |
O |
Used to specify the SLD document that describes the layer style. |
| SLD_BODY |
O |
Used to directly include the SLD information that describes the layer style in the request. |
| WIDTH=output_width |
O |
The pixel width of the legend image. The default is 16. |
| HEIGHT=output_height |
O |
The pixel height of the legend image. The default is 16. |
|
FORMAT=output_format |
R |
The output format of the legend, supporting pplication/json and image/png. Note: when choosing to use PNG as output format, only single-layer legends are supported. Legend items in layer groups or thematic maps will not be returned. |
| EXCEPTIONS=exception_format |
O |
The format in which exceptions are to be reported by the WMS (default=application/vnd.ogc.se_xml). |
Note: The case of parameters is not mandatory, and request parameters can be arranged in an arbitrary order.
Request methods of the GetLegendGraphic operation are as follows:
<ServiceRoot>?VERSION=version&REQUEST=GetLegendGraphic& LAYER=layer&FORMAT=output_format&STYLE=&SLD=&WIDTH=&HEIGHT=&EXCEPTIONS=
ServiceRoot is the service URI root directory. Please see Setting the Service URI.
For example, after the local SuperMap iServer WMS 1.1.1 service is started successfully, the URI of accessing the GetLegendGraphic operation is: http://localhost:8090/iserver/services/map-China/wms111/China?VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=0.2&WIDTH=80&HEIGHT=80&FORMAT=application/json.