fix up issue with Sencha Touch example not handling double tap to zoom in, r=elemoine (closes #3079)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11226 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2011-02-22 11:21:20 +00:00
parent f67bcaa033
commit 98a6c1754d
2 changed files with 48 additions and 0 deletions

View File

@@ -329,6 +329,43 @@
});
}
function test_touch_ignoresimulatedclick(t) {
t.plan(2);
// set up
var log;
var map = new OpenLayers.Map('map');
var control = {map: map};
var callbacks = {
'dblclick': function(e) {
log.dblclick = {x: e.xy.x, y: e.xy.y,
lastTouches: e.lastTouches};
}
};
var handler = new OpenLayers.Handler.Click(
control, callbacks,
{'double': true, pixelTolerance: null});
// test
log = {};
handler.touchstart({xy: {x: 1, y: 1}, touches: ["foo"]});
handler.touchend({});
handler.touchstart({xy: {x: 1, y: 1}, touches: ["foo"]});
handler.touchend({type: "click"});
t.eq(handler.touch, true, "Touch property should be true");
t.ok(log.dblclick == undefined, "dblclick callback not called with simulated click");
// tear down
map.destroy();
}
function test_touch_dblclick(t) {
t.plan(5);