TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.19k stars 363 forks source link

support custom URL parameters in a GetLegendGraphic request for a layer without a style configured #7263

Open sidneygijzen opened 3 months ago

sidneygijzen commented 3 months ago

What this PR does

Fixes #7198

This PR addresses aforementioned issue by reusing an existing constant QUERY_PARAMETERS_TO_REMOVE to create a base URL for a legendGraphic request. I've added a new getter on WebMapServiceCatalogItem so the getter can be reused in the future.

Test me

A unit test is added to test this behaviour. The new test was failing before I applied the proposed change.

Manual testing:

The 'before' situation can be viewed with this ci.terria.io link. If one:

After adding the layer, the legendGraphic fails to load in the 'before' situation.

This gist can be used in testing the 'after' situation. When adding aforementioned layer, the legend graphic should be visible. I've tried to prepare an 'after' test by using ci.terria.io, but I think I can only use this method with branches existing on the official terriajs repo? If not, I would love to know how to create a ci.terria.io link with a branch from a forked repo.

Checklist

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.