Can anyone explain me how I can include a legend within the layer control for any individual WMS layers in leaflet?
The wms service works fine. I just want assign the symbol label to each layer of the group.
This is an example of my app:
My code is similar to the leaflet groupedlayercontrol plugin: https://github.com/ismyrnow/Leaflet.groupedlayercontrol
Best Answer
There may be other options at your disposal, however I will mention two options that you can explore to add a legend to your WMS on Geoserver.
You could always utilize the request
GetMap
which will allow you to make modification/changes to your layout properties. You can read more on the Geoserver webapage hereAnother option I came across is github user: kartoza webpage were he provides a simple WMS legend plugin to use.