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

0.73: Allow fractional zoom stopping with Map.TouchZoom and fix CRS.scale calc with fractional zoom #3325

Closed
wants to merge 1 commit into from

Conversation

adriankb
Copy link

Hi.

I believe that I have found a fix to allow touch/pinch fractional zoom support (when using plain Leaflet object and or GeoJson objects). But I could not comment as to if this will break any map with tiles. We currently don't use tiles, so I don't have expertise.

This Pull is for stable (sorry if this is the wrong destination), I will create a second for master #3326 (as the code is different). I believe work has been done in master for version 1.0 to support better zooming so if this Pull is ignored in favour of the master pull then at least this code might serve as a reference for others using 0.7.

The underlying issue being solved is the "jump" in the map when stopping a touch/pinch zoom whilst the map snaps to a whole number zoom level. Our users on iPad's and Android were finding this very obvious and it was very hard for them to zoom in/out to the level of detail that they wanted.

Changes to Map.TouchZoom support stopping the zoom level exactly where the user has stopped the pinch.

The secondary issue uncovered is that the built in CRS.scale calculation also does not support fractional zoom. The side-affect of this is that when touch/pinch zooming, the percent with which the map is grown or shrunk does not reflect the final size that the map will be drawn at. Thus this means that there is still a "jump" in the map when stopping a touch/pinch zoom, even with the first fix in place.

The commit to CRS.js supports Scale calculation for fractional zoom levels.

Please refer to these related issues:
kartena/Proj4Leaflet#57
kartena/Proj4Leaflet#73
#426
#1309
http://stackoverflow.com/questions/24151177/fractional-zoom-levels
#2382
#2558

…cale calculation with fractional zoom level
@adriankb adriankb changed the title Allow fractional zoom stopping with Map.TouchZoom and fix CRS.scale calc with fractional zoom 0.73: Allow fractional zoom stopping with Map.TouchZoom and fix CRS.scale calc with fractional zoom Mar 25, 2015
@mourner
Copy link
Member

mourner commented Mar 25, 2015

This will break a lot of apps, especially ones that use tiles (which is 99% of Leaflet apps). So I don't want to merge it into stable — lets continue discussion on the master changes.

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.

2 participants