-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Default minzoom of -2 prevents NavigationControl button from being disabled #9172
Comments
Good catch. This is a little tricky. As of #9028, the map's default I can think of a couple ways to solve this:
|
Hi @ryanhamley Thanks a lot for such a detail explanation. So, there are no methods to disable the zoom out button when your rich min zoom? From my point zoom out button should have the same behavior as zoom in. It is confusing users when you click on it and nothing happens. |
The zoom out button does behave the same as the zoom in button. The problem is that it's not always (or even usually) possible to actually reach the map's |
Hi, @ryanhamley I see. Thanks for clarification. What about boundaries? Will the bug be the same when we rich the limits of the area? |
Setting a boundary area wouldn't automatically change the behavior of the zoom buttons. mapbox-gl-js/src/ui/control/navigation_control.js Lines 77 to 81 in 74b1573
This is the code in question. You can see that the only determining factor in disabling the buttons is whether or not the current map zoom equals the map's In general, the bug you've shown here only exhibits itself if the |
Hi, guys.
On the example, https://docs.mapbox.com/mapbox-gl-js/example/navigation/ disable state is stetted on the zoom-in button when you rich the limit https://prnt.sc/qlwb9i but when you zoom out https://prnt.sc/qlwby0 nothing happened with zoom out button. So, how we can disable the zoom out button?
The text was updated successfully, but these errors were encountered: