deprecated LayerSwitcher roundedCorner option

This commit is contained in:
Éric Lemoine
2011-12-09 00:10:29 +01:00
parent a8be54b0fe
commit 513dd16be3
2 changed files with 18 additions and 10 deletions

View File

@@ -6,7 +6,7 @@
/**
* @requires OpenLayers/Control.js
* @requires OpenLayers/Lang.js
* @requires Rico/Corner.js
* @requires OpenLayers/Console.js
*/
/**
@@ -28,9 +28,13 @@ OpenLayers.Control.LayerSwitcher =
/**
* APIProperty: roundedCorner
* {Boolean} If true the Rico library is used for rounding the corners
* of the layer switcher div, defaults to true.
* of the layer switcher div, defaults to false. *Deprecated*. Use
* CSS3's border-radius instead. If this option is set to true the
* Rico/Corner.js script must be loaded in the page, and therefore
* listed in the build profile.
*
*/
roundedCorner: true,
roundedCorner: false,
/**
* APIProperty: roundedCornerColor
@@ -115,6 +119,10 @@ OpenLayers.Control.LayerSwitcher =
initialize: function(options) {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
this.layerStates = [];
if(this.roundedCorner) {
OpenLayers.Console.warn('roundedCorner option is deprecated');
}
},
/**

View File

@@ -141,7 +141,7 @@
}
}
function test_Control_LayerSwitcher_ascendingw (t) {
function test_Control_LayerSwitcher_ascending (t) {
t.plan( 4 );
@@ -158,10 +158,10 @@
map.addControl(control);
control2 = new OpenLayers.Control.LayerSwitcher({'ascending':false});
map.addControl(control2);
t.ok(control.div.childNodes[1].childNodes[0].innerHTML.match("Base Layer"), "Base Layers first in LayerSwitcher with ascending true");
t.ok(control.div.childNodes[1].childNodes[2].innerHTML.match("Overlays"), "Overlays in LayerSwitcher with ascending true");
t.ok(control2.div.childNodes[1].childNodes[2].innerHTML.match("Base Layer"), "Base Layers last in LayerSwitcher with ascending false");
t.ok(control2.div.childNodes[1].childNodes[0].innerHTML.match("Overlays"), "Base Layers last in LayerSwitcher with ascending false");
t.ok(control.div.childNodes[0].childNodes[0].innerHTML.match("Base Layer"), "Base Layers first in LayerSwitcher with ascending true");
t.ok(control.div.childNodes[0].childNodes[2].innerHTML.match("Overlays"), "Overlays in LayerSwitcher with ascending true");
t.ok(control2.div.childNodes[0].childNodes[2].innerHTML.match("Base Layer"), "Base Layers last in LayerSwitcher with ascending false");
t.ok(control2.div.childNodes[0].childNodes[0].innerHTML.match("Overlays"), "Base Layers last in LayerSwitcher with ascending false");
}
function test_Control_LayerSwitcher_displayInLayerSwitcher (t) {
@@ -176,7 +176,7 @@
control = new OpenLayers.Control.LayerSwitcher();
map.addControl(control);
t.eq(control.div.childNodes[1].childNodes[0].style.display, "none" , "Base layer display off when no visble base layer");
t.eq(control.div.childNodes[0].childNodes[0].style.display, "none" , "Base layer display off when no visble base layer");
map = new OpenLayers.Map('map');
var layer = new OpenLayers.Layer.WMS("WMS",
@@ -186,7 +186,7 @@
control = new OpenLayers.Control.LayerSwitcher();
map.addControl(control);
t.eq(control.div.childNodes[1].childNodes[0].style.display, "" , "Base layer display on when visble base layer");
t.eq(control.div.childNodes[0].childNodes[0].style.display, "" , "Base layer display on when visble base layer");
}