deprecated LayerSwitcher roundedCorner option
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Control.js
|
* @requires OpenLayers/Control.js
|
||||||
* @requires OpenLayers/Lang.js
|
* @requires OpenLayers/Lang.js
|
||||||
* @requires Rico/Corner.js
|
* @requires OpenLayers/Console.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,9 +28,13 @@ OpenLayers.Control.LayerSwitcher =
|
|||||||
/**
|
/**
|
||||||
* APIProperty: roundedCorner
|
* APIProperty: roundedCorner
|
||||||
* {Boolean} If true the Rico library is used for rounding the corners
|
* {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
|
* APIProperty: roundedCornerColor
|
||||||
@@ -115,6 +119,10 @@ OpenLayers.Control.LayerSwitcher =
|
|||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||||
this.layerStates = [];
|
this.layerStates = [];
|
||||||
|
|
||||||
|
if(this.roundedCorner) {
|
||||||
|
OpenLayers.Console.warn('roundedCorner option is deprecated');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function test_Control_LayerSwitcher_ascendingw (t) {
|
function test_Control_LayerSwitcher_ascending (t) {
|
||||||
|
|
||||||
t.plan( 4 );
|
t.plan( 4 );
|
||||||
|
|
||||||
@@ -158,10 +158,10 @@
|
|||||||
map.addControl(control);
|
map.addControl(control);
|
||||||
control2 = new OpenLayers.Control.LayerSwitcher({'ascending':false});
|
control2 = new OpenLayers.Control.LayerSwitcher({'ascending':false});
|
||||||
map.addControl(control2);
|
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[0].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(control.div.childNodes[0].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[0].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(control2.div.childNodes[0].childNodes[0].innerHTML.match("Overlays"), "Base Layers last in LayerSwitcher with ascending false");
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_Control_LayerSwitcher_displayInLayerSwitcher (t) {
|
function test_Control_LayerSwitcher_displayInLayerSwitcher (t) {
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
|
|
||||||
control = new OpenLayers.Control.LayerSwitcher();
|
control = new OpenLayers.Control.LayerSwitcher();
|
||||||
map.addControl(control);
|
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');
|
map = new OpenLayers.Map('map');
|
||||||
var layer = new OpenLayers.Layer.WMS("WMS",
|
var layer = new OpenLayers.Layer.WMS("WMS",
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
|
|
||||||
control = new OpenLayers.Control.LayerSwitcher();
|
control = new OpenLayers.Control.LayerSwitcher();
|
||||||
map.addControl(control);
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user