Change @require to @require:
git-svn-id: http://svn.openlayers.org/trunk/openlayers@326 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// @require OpenLayers/Control.js
|
||||
// @require: OpenLayers/Control.js
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
@@ -28,14 +28,15 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
/** @type String */
|
||||
nonActiveColor: "",
|
||||
|
||||
mode: "radio",
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
initialize: function() {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
initialize: function(options) {
|
||||
this.activeColor = OpenLayers.Control.LayerSwitcher.ACTIVE_COLOR;
|
||||
this.nonActiveColor = OpenLayers.Control.LayerSwitcher.NONACTIVE_COLOR;
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -84,10 +85,22 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
singleClick: function(evt) {
|
||||
var div = Event.element(evt);
|
||||
var layer = div.layer;
|
||||
var visible = layer.getVisibility();
|
||||
if (this.mode == "checkbox") {
|
||||
var visible = layer.getVisibility();
|
||||
|
||||
this.setTabActivation(div, !visible);
|
||||
layer.setVisibility(!visible);
|
||||
this.setTabActivation(div, !visible);
|
||||
layer.setVisibility(!visible);
|
||||
} else {
|
||||
this.setTabActivation(div, true);
|
||||
layer.setVisibility(true);
|
||||
for( var i = 0; i < this.map.layers.length; i++) {
|
||||
if (layer != this.map.layers[i]) {
|
||||
this.setTabActivation($("LayerSwitcher_" + layer.name + "_Tab_p"), false);
|
||||
layer.setVisibility(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
@@ -115,6 +128,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
// Inner Label - for Rico Corners
|
||||
//
|
||||
var backdropLabel = document.createElement('p');
|
||||
backdropLabelOuter.id = "LayerSwitcher_" + layer.name + "_Tab_p";
|
||||
backdropLabel.innerHTML = layer.name;
|
||||
backdropLabel.style.marginTop = "0px";
|
||||
backdropLabel.style.marginBottom = "0px";
|
||||
|
||||
Reference in New Issue
Block a user