I am setting the SLD Body of a WMS layer on the client side. I set the style in JSON and I have some functions that convert the JSON to SLD (OpenLayers functions). It works fine for displaying the layer with all its colors.
But when I use a legend (GetLegendGraphic from GeoServer), I have a limit in the size of the SLD Body. The limit of characters is about 20.000. When I perform the GetLegendGraphic request and the url is longer than (about) 20.000 characters, an error occurs and the legend is not displayed. BUT the layer is still correctly displayed (as you can see in the images below).
Below the 20.000 characters, the legend works fine.
I find it strange that the layer is correctly displayed and the legend isn't. Both are fetched via GeoServer requests.
Could you help me solve this?
I wanted a way to accept long strings in the GetLegendGraphic or a way to compress the string with the SLD body (so that it has fewer characters).
EXAMPLES:
SLD Body with 18006 characters (this shows a correct legend)
SLD Body with 24245 characters (this does not show the legend, still draws the layer correctly)