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

LayerSwitcher: hidden layers #147

Closed
computerchemist opened this issue Aug 9, 2018 · 2 comments
Closed

LayerSwitcher: hidden layers #147

computerchemist opened this issue Aug 9, 2018 · 2 comments
Labels

Comments

@computerchemist
Copy link

computerchemist commented Aug 9, 2018

Hidden layers which are hidden - "greyed out" - with maxResolution are un-hidden when any mouse interaction takes place within the layer switcher, e.g. ticking a box of a non-hidden or hidden layer.
The layer switcher is only refreshed correctly on a pan or zoom change.
I have put a hack in place by adding "this.viewchange();" to the last line of ol.control.LayerSwitcher.prototype.drawPanel_ which forces a redraw after interaction ensuring hidden group layers stay hidden, however I am sure there is a more elegant way of solving this.
Using ol-ext 3.0.0 with ol4.6.5 on firefox.

You can replicate this effect when "pirate map" is hidden on the demo - https://viglino.github.io/ol-ext/examples/control/map.switcher.html - just click anywhere else on another item and "pirate map" is suddenly un-hidden, until a pan or zoom.

@Viglino
Copy link
Owner

Viglino commented Aug 10, 2018

Yes the hidden attribute should be computed when the list is redraw!

@Viglino
Copy link
Owner

Viglino commented Aug 12, 2018

Integrated in the v3.0.1 npm version

@Viglino Viglino closed this as completed Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants