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

Master: Allow fractional zoom stopping with Map.TouchZoom and fix CRS.scale calc with fractional zoom #3326

Closed
wants to merge 1 commit into from

Conversation

adriankb
Copy link

Similar Pull to #3325, but different code for master.

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. I believe work has gone into master to support better fractional zoom levels, but in the latest master the problem described below still exists.

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
@mourner
Copy link
Member

mourner commented Mar 25, 2015

Please don't squash two unrelated changes into one pull request — they should be discussed separately.

@adriankb
Copy link
Author

Ok, my apologies. My thinking was that one goes with the other as a single fix for improved touch-zoom support? Let me know what you'd like me to do to help with it?

@mapmeld
Copy link

mapmeld commented Apr 24, 2015

@adriankb @mourner we are looking at using this in our Leaflet 0.8/1.0 map, too. Are the changes to CRS.js necessary? We are only using tiles and have no problems.

@adriankb
Copy link
Author

adriankb commented May 1, 2015

I haven't tested with tiles, but the CRS change affects the zoom calculation so both fixes should go together or else the map will still "jump" when you finish the touch event.

@mourner
Copy link
Member

mourner commented Jun 5, 2015

I'll make the touch zoom not snapping to integer zooms change separately — it should be an option, and also may need clean up after #3278. That's why I'd prefer to merge CRS scale change separately.

@mourner mourner added this to the 1.0 milestone Jun 8, 2015
@mourner mourner self-assigned this Jun 8, 2015
@IvanSanchez IvanSanchez mentioned this pull request Jun 9, 2015
2 tasks
@IvanSanchez
Copy link
Member

Superseded by #3523

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.

4 participants