Ticket #651: panzoom.patch
| File panzoom.patch, 4.9 kB (added by crschmidt, 1 year ago) |
|---|
-
lib/OpenLayers/Control/PanZoom.js
old new 117 117 118 118 OpenLayers.Event.observe(btn, "mousedown", 119 119 this.buttonDown.bindAsEventListener(btn)); 120 OpenLayers.Event.observe(btn, "mouseup",121 this.doubleClick.bindAsEventListener(btn));122 120 OpenLayers.Event.observe(btn, "dblclick", 123 121 this.doubleClick.bindAsEventListener(btn)); 124 122 OpenLayers.Event.observe(btn, "click", -
tests/Control/test_PanZoom.html
old new 62 62 simulateClick(wnd, wnd.control.buttons[0]); 63 63 t.ok( wnd.mapper.getCenter().lat > wnd.centerLL.lat, "Pan up works correctly" ); 64 64 t.ok(!flag.mousedown, "mousedown does not get to the map"); 65 t.ok( !flag.mouseup, "mouseup does notget to the map");65 t.ok(flag.mouseup, "mouseup does get to the map"); 66 66 t.ok(!flag.click, "click does not get to the map"); 67 67 t.ok(!flag.dblclick, "dblclick does not get to the map"); 68 68 resetFlags(); … … 70 70 simulateClick(wnd, wnd.control.buttons[1]); 71 71 t.ok( wnd.mapper.getCenter().lon < wnd.centerLL.lon, "Pan left works correctly" ); 72 72 t.ok(!flag.mousedown, "mousedown does not get to the map"); 73 t.ok( !flag.mouseup, "mouseup does notget to the map");73 t.ok(flag.mouseup, "mouseup does get to the map"); 74 74 t.ok(!flag.click, "click does not get to the map"); 75 75 t.ok(!flag.dblclick, "dblclick does not get to the map"); 76 76 resetFlags(); … … 78 78 simulateClick(wnd, wnd.control.buttons[2]); 79 79 t.ok( wnd.mapper.getCenter().lon == wnd.centerLL.lon, "Pan right works correctly" ); 80 80 t.ok(!flag.mousedown, "mousedown does not get to the map"); 81 t.ok( !flag.mouseup, "mouseup does notget to the map");81 t.ok(flag.mouseup, "mouseup does get to the map"); 82 82 t.ok(!flag.click, "click does not get to the map"); 83 83 t.ok(!flag.dblclick, "dblclick does not get to the map"); 84 84 resetFlags(); … … 86 86 simulateClick(wnd, wnd.control.buttons[3]); 87 87 t.ok( wnd.mapper.getCenter().lat == wnd.centerLL.lat, "Pan down works correctly" ); 88 88 t.ok(!flag.mousedown, "mousedown does not get to the map"); 89 t.ok( !flag.mouseup, "mouseup does notget to the map");89 t.ok(flag.mouseup, "mouseup does get to the map"); 90 90 t.ok(!flag.click, "click does not get to the map"); 91 91 t.ok(!flag.dblclick, "dblclick does not get to the map"); 92 92 resetFlags(); … … 94 94 simulateClick(wnd, wnd.control.buttons[4]); 95 95 t.eq( wnd.mapper.getZoom(), 6, "zoomin works correctly" ); 96 96 t.ok(!flag.mousedown, "mousedown does not get to the map"); 97 t.ok( !flag.mouseup, "mouseup does notget to the map");97 t.ok(flag.mouseup, "mouseup does get to the map"); 98 98 t.ok(!flag.click, "click does not get to the map"); 99 99 t.ok(!flag.dblclick, "dblclick does not get to the map"); 100 100 resetFlags(); … … 102 102 simulateClick(wnd, wnd.control.buttons[6]); 103 103 t.eq( wnd.mapper.getZoom(), 5, "zoomout works correctly" ); 104 104 t.ok(!flag.mousedown, "mousedown does not get to the map"); 105 t.ok( !flag.mouseup, "mouseup does notget to the map");105 t.ok(flag.mouseup, "mouseup does get to the map"); 106 106 t.ok(!flag.click, "click does not get to the map"); 107 107 t.ok(!flag.dblclick, "dblclick does not get to the map"); 108 108 resetFlags(); … … 110 110 simulateClick(wnd, wnd.control.buttons[5]); 111 111 t.eq( wnd.mapper.getZoom(), 2, "zoomworld works correctly" ); 112 112 t.ok(!flag.mousedown, "mousedown does not get to the map"); 113 t.ok( !flag.mouseup, "mouseup does notget to the map");113 t.ok(flag.mouseup, "mouseup does get to the map"); 114 114 t.ok(!flag.click, "click does not get to the map"); 115 115 t.ok(!flag.dblclick, "dblclick does not get to the map"); 116 116 resetFlags();
