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:
+5
-11
@@ -10,8 +10,6 @@ OpenLayers.Layer.prototype = {
|
|||||||
// OpenLayers.Map
|
// OpenLayers.Map
|
||||||
map: null,
|
map: null,
|
||||||
|
|
||||||
status: null,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {str} name
|
* @param {str} name
|
||||||
*/
|
*/
|
||||||
@@ -20,7 +18,6 @@ OpenLayers.Layer.prototype = {
|
|||||||
this.div = OpenLayers.Util.createDiv();
|
this.div = OpenLayers.Util.createDiv();
|
||||||
this.div.style.width="100%";
|
this.div.style.width="100%";
|
||||||
this.div.style.height="100%";
|
this.div.style.height="100%";
|
||||||
this.status = true;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,16 +36,13 @@ OpenLayers.Layer.prototype = {
|
|||||||
// not implemented here
|
// not implemented here
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
|
||||||
getVisibility: function() {
|
getVisibility: function() {
|
||||||
return this.status;
|
return (this.div.style.display != "none");
|
||||||
},
|
},
|
||||||
setVisibility: function(on) {
|
|
||||||
if (on) {
|
setVisibility: function(visible) {
|
||||||
this.div.style.display="block";
|
this.div.style.display = (visible) ? "block" : "none";
|
||||||
} else {
|
|
||||||
this.div.style.display="none";
|
|
||||||
}
|
|
||||||
this.status = on;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user