removed 'status' variable. no reason to duplicate the storage of visibility when it can always be read directly from the layer's div.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@37 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -10,8 +10,6 @@ OpenLayers.Layer.prototype = {
|
||||
// OpenLayers.Map
|
||||
map: null,
|
||||
|
||||
status: null,
|
||||
|
||||
/**
|
||||
* @param {str} name
|
||||
*/
|
||||
@@ -20,7 +18,6 @@ OpenLayers.Layer.prototype = {
|
||||
this.div = OpenLayers.Util.createDiv();
|
||||
this.div.style.width="100%";
|
||||
this.div.style.height="100%";
|
||||
this.status = true;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -39,16 +36,13 @@ OpenLayers.Layer.prototype = {
|
||||
// not implemented here
|
||||
return;
|
||||
},
|
||||
|
||||
getVisibility: function() {
|
||||
return this.status;
|
||||
return (this.div.style.display != "none");
|
||||
},
|
||||
setVisibility: function(on) {
|
||||
if (on) {
|
||||
this.div.style.display="block";
|
||||
} else {
|
||||
this.div.style.display="none";
|
||||
}
|
||||
this.status = on;
|
||||
|
||||
setVisibility: function(visible) {
|
||||
this.div.style.display = (visible) ? "block" : "none";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user