modestmaps-js icon indicating copy to clipboard operation
modestmaps-js copied to clipboard

Pinch to zoom stutters and get stuck a lot

Open pixelfreak opened this issue 13 years ago • 7 comments
trafficstars

Try pinching to zoom on iPhone/iPad. It stutters pretty badly and gets stuck a lot, meaning you can't zoom in/out again unless you let go and start pinching again.

pixelfreak avatar Feb 15 '12 22:02 pixelfreak

Trying to debug this...the touchmove event seems to stop getting triggered when it hits the next/previous zoom level. The issue also seems to be intermittent.

pixelfreak avatar Feb 16 '12 01:02 pixelfreak

I moved all the touches listener to document.body, no luck, doesn't seem to matter.

pixelfreak avatar Feb 16 '12 01:02 pixelfreak

Is there a way to not update the tiles until touchend happens? I think that might be what's causing the issue.

pixelfreak avatar Feb 16 '12 01:02 pixelfreak

The code that zooms the tiles and the one that updates them are a little convoluted. I am not familiar enough with the codebase to fix this.

pixelfreak avatar Feb 16 '12 23:02 pixelfreak

@pixelfreak - I'll be working on this area and addressing this in the #84 ticket. If you want to de-convolute the code, go for it.

tmcw avatar Feb 20 '12 17:02 tmcw

I did some standalone experiment and confirmed that the culprit is the map updating the tiles on touchmove. Delaying the updates until touchend solves it.

pixelfreak avatar Feb 20 '12 18:02 pixelfreak

@pixelfreak try the ff branch: it defers tile loading and changes the CSS transforms strategy. Currently at the cost of Firefox & IE compatibility, but that should be fixable soon.

tmcw avatar Feb 20 '12 22:02 tmcw