DEPRECATED-mapbox-ios-sdk icon indicating copy to clipboard operation
DEPRECATED-mapbox-ios-sdk copied to clipboard

Wrong zoom level on double tap after pinch

Open masteranca opened this issue 11 years ago • 6 comments

When zooming in using double tap and pinch the zoom level gets out of sync. It usually happens when:

  1. Double tap to get to the next zoom level
  2. From that level use a small pinch gesture to load the next level
  3. Immediately stop the pinch gesture when the map switch to next level
  4. Double tap again to go to next level

Result: tiles are loaded from two levels below instead of one level.

/Anders

masteranca avatar Aug 19 '14 13:08 masteranca

Could you possible provide a video or code sample? On device you can do this with Reflector.

incanus avatar Aug 19 '14 22:08 incanus

I turned on logging in zoomOutToNextNativeZoomAt:animated: and zoomInToNextNativeZoomAt:animated: This is the output:

(tap) zoom in from:4.330569 to:5.000000 by factor:1.590446 around {144.500000,444.500000} (tap) zoom in from:5.000000 to:6.000000 by factor:2.000000 around {161.500000,423.000000} (tap) zoom in from:6.000000 to:7.000000 by factor:2.000000 around {150.000000,377.500000} (tap) zoom in from:7.000000 to:8.000000 by factor:2.000000 around {170.000000,343.500000} (tap) zoom in from:8.000000 to:9.000000 by factor:2.000000 around {232.500000,299.000000} (tap after pinch) zoom in from:9.061029 to:10.000000 by factor:1.917160 around {198.500000,278.000000} (tap after pinch) zoom in from:10.031708 to:11.000000 by factor:1.956523 around {185.500000,290.000000}

Notice that the last double tap took us to level 11 but tiles was loaded from level 13 (see debug info in movie). Shouldn't it be from level 12?

Link to movie: https://www.dropbox.com/s/cvvlxaof2ue0zjv/Out_Of_Sync_Tiles.mov

masteranca avatar Aug 20 '14 09:08 masteranca

@incanus Any idea when this can be investigated further please?

maciekish avatar Sep 25 '14 08:09 maciekish

When the app enters this incorrect zoom state and you double tap the home button, the map changes back to the correct zoom. Maybe this will help the troubleshooting?

Video: http://s.swic.name/Xt0O

maciekish avatar Oct 06 '14 07:10 maciekish

There. I fixed it. https://github.com/mapbox/mapbox-ios-sdk/pull/523

maciekish avatar Oct 07 '14 13:10 maciekish

Tested on iOS 7, 8 and 8.1 on a range of different devices.

maciekish avatar Oct 07 '14 14:10 maciekish