umbe1987 / shire

A WebGIS portal made with open source projects.
MIT License
2 stars 0 forks source link

Grey out layers in the toc if not visible due to scale #13

Open umbe1987 opened 6 years ago

umbe1987 commented 6 years ago

According to the official OGC WMS 1.3.0 specification:

The <MinScaleDenominator> and <MaxScaleDenominator> elements define the range of scales for which it is appropriate to generate a map of a Layer.

It would be nice to grey out layers in the toc if layers are not visible due to scale. Use this to get current scale with OL and compare it with WMS capabilities.

umbe1987 commented 6 years ago

Implemented as of df646eb6c8a903c6276256e18eb3c0cba5e733f9. At present, seems to work fine for desktop monitors but not for smaler devices (i.e. smartphones).

The symptom: layers get greyed out in the ToC although they're still visible in the view. For possible solution, see this link and try to make adjustments in https://github.com/umbe1987/shire/blob/master/js/get_scale.js.