mapbox.js icon indicating copy to clipboard operation
mapbox.js copied to clipboard

Map on a page with a form not responding to touch gestures when viewed on iPhone

Open pecinec opened this issue 11 years ago • 4 comments

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áš

pecinec avatar Aug 17 '14 23:08 pecinec

I'm not seeing a difference between these two examples, on an iPhone 5S, running iOS 7

tmcw avatar Aug 18 '14 18:08 tmcw

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.

pecinec avatar Aug 18 '14 20:08 pecinec

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.

tmcw avatar Aug 18 '14 20:08 tmcw

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.

pecinec avatar Aug 18 '14 21:08 pecinec