Hi all,
I’d like to get your thoughts on a potential improvement to the GeoServer Style Editor—specifically the Legend Preview functionality.
At the moment, the legend preview renders fixed 20x20 symbols. While this works for simple styles, it becomes limiting when working with more complex styles that include multiple symbolizers, custom fonts, or are intended for use in applications that request legends with specific parameters.
In my day-to-day work, I often design styles that are consumed by clients using the GetLegendGraphic request with custom parameters (e.g. size, font, layout). In those cases, the current preview doesn’t reflect how the legend will actually appear in the application.
My idea is to extend the Legend Preview UI with additional controls, such as:
-
Adjustable width and height
-
Font settings
-
Potentially other GetLegendGraphic parameters
This would allow users to preview the legend more accurately as it would be rendered in their application, directly from within the GeoServer UI.
I believe this could significantly improve the workflow when designing and testing more advanced styles.
Looking at the source (StyleAdminPanel in the WMS web module), it seems relatively straightforward to expose additional parameters in the UI. Since the preview ultimately relies on the existing GetLegendGraphic request, the backend support is already there—we would mainly need to extend the UI to allow users to specify parameters like WIDTH, HEIGHT, and font-related options.
I’m interested in hearing:
-
Whether this is something others have run into
-
If there are existing approaches or workarounds I may have missed
-
Any thoughts on how this could best be implemented (UI or backend considerations)
If this seems like a useful direction, I’d be happy to explore contributing to it.
Thanks in advance for any feedback!



