walkermatt / ol-layerswitcher

Layer control for OpenLayers
MIT License
384 stars 176 forks source link

RFE: Add the `disabled` css class for out-of-zoom-range layer groups as well #488

Open cwassert opened 1 year ago

cwassert commented 1 year ago

Since a LayerGroup can also have a minResolution, maxResolution, minZoom and maxZoom, it makes sense to add this feature to layer groups as well.

walkermatt commented 1 year ago

Hi, Currently it's assumed that a layer has either min/max resolution or min/max zoom. I've not considered anyone using both on a single layer. It should be quite straightforward to update the current logic to take both into account. If you would like to implement the change I'd be happy to review a pull request.

gmerciel commented 1 year ago

I think @cwassert is referring to the fact that LayerGroups are not getting the disabled class when not shown because of its zoom or resolution, It has nothing to do with using both configurations (resolution and zoom).