You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The legend in the print view does not correctly handle WMS composite layers. If a WMS layer is a composite layer (server side, not Origo group layer) only the rules from the first layer is displayed but the images for those rules are missing.
To Reproduce
Steps to reproduce the behavior:
Set up a composite layer consisting of at least two layers with thematic styling on Geoserver
Configure origo to display the layer having hasThemeLegend (but not thematicStyling)
Go to print preview
Only the legend rules from the first layer is displayed but the legend images are the "image not found place holders".
Expected behavior
I would expect all rules from all layers to be displayed.
Screenshots
If applicable, add screenshots to help explain your problem. Image 1: The composite legend in map view with rules from both layers in composite layer
Image 2: The legend i print only displaying rules from first layer and browser's placeholder images
Mapserver
Geoserver 2.25.3
Additional context
The steps to reproduce above uses CSS styles, i.e. rules without names, which would explain why there are no images. If I change to SLD using named rules it instead squeezes in the entire group image on each rule. That seems to be some quirky bug in Geoserver that produces an image of the composite layer when the rule name matches a rule name in an underlying layer's style.
From what I have seen in the code, the problem is that print-legend only loops the rules in json.Legend[0] and does not use the correct layer name. It sends the composite layer name and the rule name for the underlying layer. It would probably have to loop the json.Legend[] array and make calls for all underlaying layers and rules, or just get the composite layer legend graphic like the map legend does. If it had been configured with thematicStyling getting the entire composite layer graphic may not be ideal if it supposed to only display visible rules.
The text was updated successfully, but these errors were encountered:
@JohanPihelAtWork is that really a composite layer or group layer or whatever it is called in Qgis server? I.e. a layer that is composed of two or more already existing layers? (Not that i don't trust you, just want to make sure you didn't miss the subtle "composite" part in the description). Your screenshots have checkboxes before every type, which indicates you don't have the same configuration as described in the issue. You've probably used thematicStyling, which I didn't, but thematicStyling didn't work with GeoServer either, but produced another error.
Anyhow, can you please post the json returned from print preview's request as I don't have access to a Qgis server. Or, if you can point me to a publicly accessible composite layer from a QGis server.
It is very likely that it differs between GeoServer and Qgis, as this functionality is probably a bit beyond standard, and it is a known issue that Geoserver don't name the rules when using CSS-styling, but that is easy to overcome by using SLD-styling.
Luckily for us, @Grammostola has successfully contributed a PR to Geoserver that will make it possible to name CSS-styling rules, which should be available in Geoserver 2.26.0 if I understood it correctly.
Describe the bug
The legend in the print view does not correctly handle WMS composite layers. If a WMS layer is a composite layer (server side, not Origo group layer) only the rules from the first layer is displayed but the images for those rules are missing.
To Reproduce
Steps to reproduce the behavior:
hasThemeLegend
(but not thematicStyling)Expected behavior
I would expect all rules from all layers to be displayed.
Screenshots
If applicable, add screenshots to help explain your problem.
Image 1: The composite legend in map view with rules from both layers in composite layer
Image 2: The legend i print only displaying rules from first layer and browser's placeholder images
Mapserver
Additional context
The steps to reproduce above uses CSS styles, i.e. rules without names, which would explain why there are no images. If I change to SLD using named rules it instead squeezes in the entire group image on each rule. That seems to be some quirky bug in Geoserver that produces an image of the composite layer when the rule name matches a rule name in an underlying layer's style.
From what I have seen in the code, the problem is that print-legend only loops the rules in
json.Legend[0]
and does not use the correct layer name. It sends the composite layer name and the rule name for the underlying layer. It would probably have to loop thejson.Legend[]
array and make calls for all underlaying layers and rules, or just get the composite layer legend graphic like the map legend does. If it had been configured withthematicStyling
getting the entire composite layer graphic may not be ideal if it supposed to only display visible rules.The text was updated successfully, but these errors were encountered: