Skip to content

Conversation

trevorpowell
Copy link
Contributor

Fixes #1864 by disabling scaling below minZoom and above maxZoom for touch zoom actions.

@mourner
Copy link
Member

mourner commented Oct 6, 2013

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...

@trevorpowell
Copy link
Contributor Author

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".

@mourner
Copy link
Member

mourner commented Oct 9, 2013

Or maybe the other way around, something like bounceAtZoomLimits that's enabled by default.

@mourner
Copy link
Member

mourner commented Oct 9, 2013

@danzel what do you think?

@danzel
Copy link
Member

danzel commented Oct 10, 2013

Yeah, Sounds good.
I thought the mobile maps had the bounce back, but after testing it, I see they don't. Did they used to? Where did the behaviour come from?

bounceAtZoomLimits sounds good.

@mourner
Copy link
Member

mourner commented Oct 10, 2013

@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...

@danzel
Copy link
Member

danzel commented Oct 10, 2013

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 :)

@mourner
Copy link
Member

mourner commented Oct 10, 2013

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 :)

@trevorpowell
Copy link
Contributor Author

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.

mourner added a commit that referenced this pull request Oct 24, 2013
Don't bounce near zoom limits on touch zoom
@mourner mourner merged commit 1aba51b into Leaflet:master Oct 24, 2013
@mourner
Copy link
Member

mourner commented Oct 24, 2013

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to disable zoom effect when reached max or min zoom level
3 participants