Skip to content

Commit

Permalink
#109 Do not prevent default scrolling in the touch enabled browsers w…
Browse files Browse the repository at this point in the history
…hen map is not zoomed
  • Loading branch information
bjornd committed Oct 1, 2012
1 parent 0ef09e3 commit 58b3b3a
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions lib/world-map.js
Expand Up @@ -325,23 +325,26 @@ jvm.WorldMap.prototype = {
}); });
jvm.$(this.container).bind('touchmove', function(e){ jvm.$(this.container).bind('touchmove', function(e){
var touch; var touch;
if (e.originalEvent.touches.length == 1 && touchX && touchY) {
touch = e.originalEvent.touches[0];


map.transX -= (touchX - touch.pageX) / map.scale; if (map.scale != map.baseScale) {
map.transY -= (touchY - touch.pageY) / map.scale; if (e.originalEvent.touches.length == 1 && touchX && touchY) {
touch = e.originalEvent.touches[0];


map.applyTransform(); map.transX -= (touchX - touch.pageX) / map.scale;
map.transY -= (touchY - touch.pageY) / map.scale;


map.label.hide(); map.applyTransform();


touchX = touch.pageX; map.label.hide();
touchY = touch.pageY;
} else { touchX = touch.pageX;
touchX = false; touchY = touch.pageY;
touchY = false; } else {
touchX = false;
touchY = false;
}
return false;
} }
return false;
}); });
}, },


Expand Down

0 comments on commit 58b3b3a

Please sign in to comment.