Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does
This PR proposes an approach for implementing the WMS layer limit. One of the goals is trying to mitigate the resource-intensive requests - as reported in #6866 and #7320 - by enabling a WMS server administrator to make use of the WMS layer limit.
My initial thought was to modify the
WebMapServiceCatalogItem
validLayers
getter, but during manual testing the styles URL param went awry. From what I can tell it is because theWebMapServiceCatalogItem
layersArray
is used in theWebMapServiceCapabilitiesStratum
legends
getter. Therefore I chose to check for a layer limit in thelayersArray
.A note on the modified XML test files; during the implementation a couple of unrelated tests errored out. A small number of xml files contained a
<LayerLimit>1</LayerLimit>
. I have opted to remove the<LayerLimit>1</LayerLimit>
elements from the XML file instead of adjusting the tests.Finally, I am not sure if it fully addresses #5267, because I haven't looked at the MagdaReference model.
Test me
Aside from the added unit test, I tested this manually by configuring a wms-group as a wms. Please see this gist for a test config. With this "wrong" config I try to simulate what is happening in #7320, which is that the CswCatalogGroup currently has no knowledge of the concept of a WMS-group. The WMS below has a WMS layer limit defined, so only one wms layer is requested in this case.
Checklist
- [ ] I've updated relevant documentation indoc/
.