terriajs icon indicating copy to clipboard operation
terriajs copied to clipboard

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

Open sidneygijzen opened this issue 5 months ago • 1 comments

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:

  • clicks 'explore map data'
  • selects 'test' and then 'af250m_nutrient dataset and
  • adds map layer 'Africa SoilGrids nutrients - Extractable Aluminium (Al)'

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

  • [x] There are unit tests to verify my changes are correct
  • [ ] I've updated relevant documentation in doc/.
  • [x] I've updated CHANGES.md with what I changed.
  • [x] I've provided instructions in the PR description on how to test this PR.

sidneygijzen avatar Aug 28 '24 15:08 sidneygijzen