Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing user to alter WebMapServiceCatalogItem parameters #10

Open
jiwalker-usgs opened this issue Jun 28, 2016 · 3 comments
Open

Allowing user to alter WebMapServiceCatalogItem parameters #10

jiwalker-usgs opened this issue Jun 28, 2016 · 3 comments

Comments

@jiwalker-usgs
Copy link

For the map COLORSCALERANGE feature I've added a widget to change the min and max range that is placed into the parameters field on WebMapServiceCatalogItem. In changing these values I cannot determine the appropriate way to reload the CatalogItem to use the new parameters (the ImageryProvider is already setup with what appears to be a fixed parameters list). I've gotten around this by toggling the isShown property, but this has undesired effects.

@kring what would you recommend for changing the parameters and getting them to apply to GetMap and GetLegendGraphic requests when changing parameters like COLORSCALERANGE?

@kring
Copy link
Member

kring commented Jun 29, 2016

@jiwalker-usgs this is a bit tricky. If you can point me to the branch with your work so far, I can add that bit and show you how I did it.

@jiwalker-usgs
Copy link
Author

@kring I've got my changes here jiwalker-usgs/terriajs@a995577 and it works if I manually toggle the item off and on. I'm missing the programmatic way of doing this, and the legend seems to be somewhat static.

@kring
Copy link
Member

kring commented Jun 30, 2016

Ok I've made the changes:
https://github.com/TerriaJS/terriajs/compare/newui...colorScaleRange?expand=1

Basically we need to do two things:

  • Update the legendUrl, which will make the UI automatically display the new legend.
  • disable and then re-enable the layer so that the new parameters get picked up. This is a little ugly, but it's our best option right now as Cesium doesn't support changing the parameters to a WMS after it is created. We do the same thing for time-dynamic layers.

I also changed the UI to call a refresh function that triggers these two actions when the color range changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants