X-Git-Url: https://git-public.kairo.at/?p=lantea.git;a=blobdiff_plain;f=js%2Fmap.js;h=dc3ad9c776637595ddbc764b18b111e119dc67ba;hp=6aeacf688794cbdbb33fccde9c89c6b23b93df61;hb=d07d7abcbf226716c7f1d6cb70942252d5af27ad;hpb=003d56f8a1eee6825cc6c800f135e13df753770d;ds=sidebyside diff --git a/js/map.js b/js/map.js index 6aeacf6..dc3ad9c 100644 --- a/js/map.js +++ b/js/map.js @@ -489,7 +489,6 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); - console.log('!!! ' + gPinchStartWidth); } gDragTouchID = aEvent.changedTouches.item(0).identifier; coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID); @@ -515,7 +514,7 @@ var mapEvHandler = { ); if (!gPinchStartWidth) gPinchStartWidth = curPinchStartWidth; - console.log(gPinchStartWidth + ' ' + curPinchStartWidth); + if (gPinchStartWidth / curPinchStartWidth > 1.7 || gPinchStartWidth / curPinchStartWidth < 0.6) { var newZoomLevel = gPos.z + (gPinchStartWidth < curPinchStartWidth ? 1 : -1); @@ -544,6 +543,7 @@ var mapEvHandler = { gPinchStartWidth = null; } } + // If we are in a pinch, do not drag. break; } var x = coordObj.clientX - gMapCanvas.offsetLeft; @@ -574,6 +574,7 @@ var mapEvHandler = { break; case "mouseup": case "touchend": + gPinchStartWidth = null; gDragging = false; showUI(); break;