Skip to contents

This function constructs a legend for a WMS layer overlay by sending a GetLegendGraphic request to a WMS server.

Usage

map_legend_wms_overlayer(wms_params)

Arguments

wms_params

A list containing the following parameters for the WMS layer overlay:

  • language (character): The language to use for the legend.

  • version (character): The version of the WMS service.

  • service (character): The WMS service type (e.g., "WMS").

  • sld_version (character): The SLD (Styled Layer Descriptor) version.

  • layer (character): The name of the WMS layer for which the legend is generated.

  • format (character): The desired format of the legend image (e.g., "image/png").

  • style (character): The style to use for rendering the legend.

  • url (character): The URL of the WMS server.

Value

An HTML div element containing an img tag representing the legend for the specified WMS layer overlay.

Examples

# Define WMS parameters for a layer overlay like
wms_params <- params_wms()$inondation

# Generate and display the legend for the WMS layer overlay
legend <- map_legend_wms_overlayer(wms_params)
print(legend)
#> <div style="display: flex; align-items: center;">
#>   <img src="https://georisques.gouv.fr/services?LANGUAGE=fre&amp;VERSION=1.3.0&amp;SERVICE=WMS&amp;REQUEST=GetLegendGraphic&amp;SLD_VERSION=1.1.0&amp;LAYER=ALEA_SYNT_01_02MOY_FXX&amp;FORMAT=image%2Fpng&amp;STYLE=inspire_common%3ADEFAULT" responsive="width: 100%; height: auto;" class="responsive"></img>
#> </div>