[OpenLayers-Commits] r11241 - in trunk/openlayers: lib/OpenLayers/Control tests/Control

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Feb 22 09:39:39 EST 2011


Author: bartvde
Date: 2011-02-22 06:39:39 -0800 (Tue, 22 Feb 2011)
New Revision: 11241

Modified:
   trunk/openlayers/lib/OpenLayers/Control/TouchNavigation.js
   trunk/openlayers/tests/Control/TouchNavigation.html
Log:
two-finger tap zoomout should work on iPhone, non-functional change (closes #3087)

Modified: trunk/openlayers/lib/OpenLayers/Control/TouchNavigation.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Control/TouchNavigation.js	2011-02-22 14:31:43 UTC (rev 11240)
+++ trunk/openlayers/lib/OpenLayers/Control/TouchNavigation.js	2011-02-22 14:39:39 UTC (rev 11241)
@@ -128,7 +128,7 @@
      * evt - {Event}
      */
     defaultClick: function (evt) {
-        if(evt.lasttouches && evt.lasttouches.length == 2) {
+        if(evt.lastTouches && evt.lastTouches.length == 2) {
             this.map.zoomOut();
         }
     },

Modified: trunk/openlayers/tests/Control/TouchNavigation.html
===================================================================
--- trunk/openlayers/tests/Control/TouchNavigation.html	2011-02-22 14:31:43 UTC (rev 11240)
+++ trunk/openlayers/tests/Control/TouchNavigation.html	2011-02-22 14:39:39 UTC (rev 11241)
@@ -102,6 +102,28 @@
 
     }
 
+    function test_zoomOut(t) {
+        t.plan(1);
+
+        var map = new OpenLayers.Map(document.body);
+        var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
+                    "http://labs.metacarta.com/wms/vmap0",
+                    {layers: 'basic'} );
+        map.addLayer(layer);
+        map.setCenter(new OpenLayers.LonLat(0, 0), 5);
+        var control = new OpenLayers.Control.TouchNavigation();
+        map.addControl(control);
+        var handler = control.handlers.click;
+        handler.touchstart({xy: {x: 1, y: 1}, touches: ["foo", "bar"]});
+        handler.touchend({});
+        t.delay_call(1, function() {
+            t.eq(map.getZoom(), 4, "Did we zoom out?");
+            // tear down
+            map.destroy();
+        });
+
+    }
+
   </script>
 </head>
 <body>



More information about the Commits mailing list