-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Don't bounce near zoom limits on touch zoom #2072
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
Conversation
|
Thanks! Perhaps we wouldn't want this to be the default behavior, and the original issue suggested this as an option. Now we need to come up with a good option name... |
|
Sounds good. In my personal opinion this makes sense as the default for the option because it more closely mimics the behavior of the native mobile map SDKs, but either way as long as it is an available option that works for me. Maybe a boolean like "touchZoomLimits" or "touchZoomScaleLimits". |
|
Or maybe the other way around, something like |
|
@danzel what do you think? |
|
Yeah, Sounds good. bounceAtZoomLimits sounds good. |
|
@danzel you meant to say, why do they have the bounce-back now? It was always like that — I didn't limit movement during touch zoom, only brought it back after touchend... |
|
Sorry, what I meant was that I opened google maps and apple maps and neither of them have bounce back, they both limit zooming at the bottom. After using leaflet for so long I assumed they'd do it :) |
|
I'm not sure what's the best default behavior though, I like the bouncing, although I admit I initially implemented it because it was easier than hard limit :) |
|
Added the bounceAtZoomLimits map option that defaults to true. Let me know if there are any additional updates to make or if that is sufficient for the pull. |
Don't bounce near zoom limits on touch zoom
|
Looks good! |
Fixes #1864 by disabling scaling below minZoom and above maxZoom for touch zoom actions.