Open metron-ag opened 2 years ago
@metron-ag What geographic server do you use? In Mapserver for instance, it is possible to style legends a little bit and to put line returns on it
@maltaesousa We use qgis server
I've not found a way to wrap or style legends on qgis server or to give some basic styling to it but I'm not familiar with qgis server.
Another workaround would be to use a static legend:
static/images/
folderlegendImage
metadata with an URL like static:///images/my_custom_legend.png
I've not found a way to wrap or style legends on qgis server or to give some basic styling to it but I'm not familiar with qgis server.
You can use some style parameters in the legendImage
metadata, something like:
config://local/mapserv_proxy?ogcserver=qgis%2Fxxx&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=yyy&SCALE=1000&BOXSPACE=0&SYMBOLSPACE=1&SYMBOLWIDTH=5&LAYERTITLE=FALSE&ITEMFONTFAMILY=Arial&ITEMFONTSIZE=8
See QGIS Server documentation for all possiblities.
@metron-ag Did you try one of both workarounds?
Legends in HTML are not possible because it's not an OGC standard. Also, dynamically styling image legends depending on layer tree width is not supported as there's no standard to ask for a max width with a GetLegendGraphic request. Finally, qgis server and geoserver can handle FORMAT=application/json
for a legend but not mapserver and I'm pretty sure each server will answer its own schema because there's no standard. For these reasons, I think implementing a css customizable legend will be expensive to develop.
Tell us if the workaround fulfill your needs or if you would like another solution.
Who requested this new feature?
Problem & Solution