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

Map disappears in some zoom cases under iOS #32

Closed
mourner opened this issue Apr 12, 2011 · 9 comments
Closed

Map disappears in some zoom cases under iOS #32

mourner opened this issue Apr 12, 2011 · 9 comments
Assignees
Labels
blocker Critical issue or PR that must be resolved before the next release
Milestone

Comments

@mourner
Copy link
Member

mourner commented Apr 12, 2011

No description provided.

@ghost ghost assigned mourner Apr 12, 2011
@mourner
Copy link
Member Author

mourner commented Apr 13, 2011

Improved, now such cases are much more rare.

mourner added a commit that referenced this issue Apr 13, 2011
mourner added a commit that referenced this issue Apr 13, 2011
@mourner
Copy link
Member Author

mourner commented Apr 15, 2011

Still quite a critical bug (as it blocks the map and the page needs reload) :(

@cgalli
Copy link

cgalli commented May 14, 2011

Without a doubt the most critical issue relating to Android 2.2+ webkit with Zoom in and out. Not having consistent zooming capabilities makes the Map API difficult to develop with right now. iOS seems more stable.

@mourner
Copy link
Member Author

mourner commented May 14, 2011

Yep, I'll be fixing it ASAP.

@mourner
Copy link
Member Author

mourner commented May 14, 2011

@cgalli I'll probably disable zoom animation in Android temporarily until I find a good fix for strange zoom behavior - it worked acceptably on my test Google Nexus One, but it turned out that many things behave differently in different Android phones, especially when it comes to features like CSS3 transforms and transitions. :(

@mourner
Copy link
Member Author

mourner commented May 14, 2011

@cgalli could you please check if it works better without zoom animation on your phone?

@cgalli
Copy link

cgalli commented May 14, 2011

OK. Some rigorous testing on Android 2.2.1 (Droid X device). Using updated code, the zoom feature seems to be working as expected. Tiles are visible and seem to consistently load properly. However, once a zoom is complete, dragging the map around via touch eventually yields similar results where the map tiles become invisible and no JS error is thrown.

To test this theory I added an onClick event to the map that calls the map.setView like this:
map.setView(map.getCenter(),map.getZoom(),true);

Essentially just a refresh of the map for the exact zoom and latlng center. This makes the tiles visible again. I then added the options of {fadeAnimation: false, zoomAnimation: false} to the map creation. Now zooming and dragging afterwards works without tiles disappearing. I think this should help pinpoint the larger issue at hand perhaps? I still had to set zoomAnimation to false for Android to consistently work without tiles disappearing.

Also tested heavily in iOS v4.x (iPhone US ATT). I can get tiles to disappear occasionally (maybe 1 out of 20) with pinch zooming. I can then use the onClick event I added to the map to get the tiles to show. Interesting... Adding a zoomend event verifies that when the tiles fail to load/show after a pinch zoom, the zoomend event does not fire, which implies the end of a pinch is sometimes not detected after it starts. So that's another bug lurking there.

Here is the test example I have, for anyone else who wants to copy what I've done to test:
http://xc1.xcskies.com/leaf_test.html

I'm using transparent CM tiles on top of a base terrain map I made residing in Amazon S3.

@mourner
Copy link
Member Author

mourner commented May 15, 2011

Thank you very much for such a thorough testing, it's very helpful! I'll then leave zoom and fade animation to false by default on Android until I find how to make it more stable. Regarding iOS - I noticed this too, apparently touchend doesn't fire after touchstart/touchmove in some rare cases, but I didn't manage to understand why. I'll probably get this fixes during next week.

@mourner
Copy link
Member Author

mourner commented May 23, 2011

Made a separate issue for Android because the it is now fixed in iOS. #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Critical issue or PR that must be resolved before the next release
Projects
None yet
Development

No branches or pull requests

2 participants