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

If a layer has minZoom/maxZoom set, change CSS color based on map current view zoom #248

Closed
lubojr opened this issue Sep 19, 2023 · 3 comments · Fixed by #407
Closed

If a layer has minZoom/maxZoom set, change CSS color based on map current view zoom #248

lubojr opened this issue Sep 19, 2023 · 3 comments · Fixed by #407
Labels
enhancement New feature or request good first issue Good for newcomers layercontrol

Comments

@lubojr
Copy link
Member

lubojr commented Sep 19, 2023

If layer is currently not seen on the map view due to maxZoom/minZoom, this should be ideally reflected in the layercontrol by a different style/color for example.

@lubojr lubojr added enhancement New feature or request layercontrol labels Sep 19, 2023
@santilland
Copy link
Member

Cool idea! Maybe like a warning sign and when you hover over it, it shows a message? Something like... "This layer can't be shown on the current zoom level" ?

@lubojr
Copy link
Member Author

lubojr commented Sep 19, 2023

The official (vanilla) OL layer control used I think disabling of the input field + grey color, which sounds more mobile friendly to me, but at the same time disabling the field completely might be too limiting (if user wants to disable the layer before zooming towards it for whatever reason)

@silvester-pari silvester-pari added the good first issue Good for newcomers label Oct 23, 2023
silvester-pari pushed a commit that referenced this issue Nov 14, 2023
* added zoom layer state in stories

* added state to layer

* added state check to helper

* clean code a bit

* arg fix in stories

* added opacity also to look it like hidden

* prettier

* re render fix

* CHANGELOG prettier fix

* update example for zoom layer state

* added  to layer control

* set default zoom level to 1

* test added to zoom state layer

* fix comment typo

* fix title typo

* fix id for docs

implements #248
@silvester-pari
Copy link
Collaborator

Implemented in 09f5288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers layercontrol
Projects
None yet
3 participants