From f1541c52336707f14e2965635a1ddf5f5cf6f952 Mon Sep 17 00:00:00 2001 From: Mario Murrent Date: Thu, 9 Oct 2014 18:28:38 +0200 Subject: [PATCH] +) Fixed multitouch zoom when first touchpoint is outside map --- lib/OpenLayers/Handler/Pinch.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/OpenLayers/Handler/Pinch.js b/lib/OpenLayers/Handler/Pinch.js index cd3d086f66..6cd6f4603a 100644 --- a/lib/OpenLayers/Handler/Pinch.js +++ b/lib/OpenLayers/Handler/Pinch.js @@ -86,6 +86,14 @@ OpenLayers.Handler.Pinch = OpenLayers.Class(OpenLayers.Handler, { * {Boolean} Let the event propagate. */ touchstart: function(evt) { + // Check if first touch point is outside map + // Sometimes this is necessary for multitouch to disable unwanted map zooming + var id = evt.touches.item(0).target.id; + if(id){ + if(id.indexOf("OpenLayers") === -1){ + return false; + } + } var propagate = true; this.pinching = false; if (OpenLayers.Event.isMultiTouch(evt)) {