Math.pow(aEvent.targetTouches.item(1).clientY -
aEvent.targetTouches.item(0).clientY, 2)
);
+ if (!gPinchStartWidth)
+ gPinchStartWidth = curPinchStartWidth;
+
if (gPinchStartWidth / curPinchStartWidth > 1.7 ||
gPinchStartWidth / curPinchStartWidth < 0.6) {
var newZoomLevel = gPos.z + (gPinchStartWidth < curPinchStartWidth ? 1 : -1);
zoomIn();
else
zoomOut();
+
+ // Reset pinch start width and start another pinch gesture.
+ gPinchStartWidth = null;
}
}
+ // If we are in a pinch, do not drag.
break;
}
var x = coordObj.clientX - gMapCanvas.offsetLeft;
break;
case "mouseup":
case "touchend":
+ gPinchStartWidth = null;
gDragging = false;
showUI();
break;