adds a zoomBoxEnabled boolean option in Control.Navigation, r=ahocevar, (Closes #2416)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10067 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
pgiraud
2010-02-15 13:08:28 +00:00
parent 7a546bf5c5
commit b165d015e1
2 changed files with 49 additions and 1 deletions

View File

@@ -71,6 +71,28 @@
OpenLayers.Control.prototype.destroy = temp;
}
function test_Control_Navigation_disableZoomBox(t) {
t.plan(2);
var nav = new OpenLayers.Control.Navigation();
var zb = new OpenLayers.Control.ZoomBox({});
nav.zoomBox = zb;
zb.activate();
nav.disableZoomBox();
t.eq(nav.zoomBoxEnabled, false, "zoom box deactivated");
t.eq(zb.active, false, "zoom box control deactivated");
}
function test_Control_Navigation_enableZoomBox(t) {
t.plan(2);
var nav = new OpenLayers.Control.Navigation();
var zb = new OpenLayers.Control.ZoomBox({});
nav.zoomBox = zb;
nav.active = true;
nav.enableZoomBox();
t.eq(nav.zoomBoxEnabled, true, "zoom box activated");
t.eq(zb.active, true, "zoom box control activated");
}
function test_Control_Navigation_disableZoomWheel(t) {
t.plan(2);
var nav = new OpenLayers.Control.Navigation();