stamen / modestmaps-js

Modest Maps javascript port
http://modestmaps.com
566 stars 152 forks source link

Pinch to zoom stutters and get stuck a lot #103

Open pixelfreak opened 12 years ago

pixelfreak commented 12 years ago

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 commented 12 years ago

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 commented 12 years ago

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

pixelfreak commented 12 years ago

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

pixelfreak commented 12 years ago

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.

tmcw commented 12 years ago

@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.

pixelfreak commented 12 years ago

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.

tmcw commented 12 years ago

@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.