diff --git a/lib/OpenLayers/Control/TouchNavigation.js b/lib/OpenLayers/Control/TouchNavigation.js index 990242690d..d102c39205 100644 --- a/lib/OpenLayers/Control/TouchNavigation.js +++ b/lib/OpenLayers/Control/TouchNavigation.js @@ -128,7 +128,7 @@ OpenLayers.Control.TouchNavigation = OpenLayers.Class(OpenLayers.Control, { * evt - {Event} */ defaultClick: function (evt) { - if(evt.lasttouches && evt.lasttouches.length == 2) { + if(evt.lastTouches && evt.lastTouches.length == 2) { this.map.zoomOut(); } }, diff --git a/tests/Control/TouchNavigation.html b/tests/Control/TouchNavigation.html index 52b834d350..7a9d67a59b 100644 --- a/tests/Control/TouchNavigation.html +++ b/tests/Control/TouchNavigation.html @@ -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(); + }); + + } +