mapbox.js
mapbox.js copied to clipboard
Map on a page with a form not responding to touch gestures when viewed on iPhone
When adding a map to a contact page that contained a standard contact form I found out the following:
- having a form on a same page as a map makes the map sloppy (very delayed or no response to touch events) when viewing on iPhone
- the level of sloppiness depends on the number of input fields in the form
See examples:
Note that on a desktop, the map is perfectly fine.
Anyone experienced this problem?
Cheers!
Lukáš
I'm not seeing a difference between these two examples, on an iPhone 5S, running iOS 7
Hi Tom,
I tested it on iPhone 4S, running iOS7. I suspect the problem might be a block of little inefficient traversing code in mapbox.js that works fine on fast machines but on little slower ones starts causing trouble.
Mapbox.js doesn't traverse over non-map elements in a page - unless you can distill this down into a narrow test case or replicate it on a non-iOS client, I don't think there's a route to getting it changed.
If you were able to compare the examples on iphone 4S, or older, you'd see the difference. I looked into mapbox.js and couldn't find any suspicious piece of code either, so I'm not sure why it's happening but the correlation is evident. The more input fields in a form anywhere on a page with a map, the less responsive the map is to touch events. Interestingly enough, the controls (zoom, layers etc.) keep working fine - it seems to be just dragging and pinching that stop working.
Anyway, I'll do a bit more testing.