make setVisibility() actually call display(). also add some comments on this rather funky situation.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1615 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -236,7 +236,15 @@ OpenLayers.Layer.prototype = {
|
||||
return this.visibility;
|
||||
},
|
||||
|
||||
/**
|
||||
/** Set the visibility flag for the layer and hide/show&redraw accordingly.
|
||||
* Fire event unless otherwise specified
|
||||
*
|
||||
* Note that visibility is no longer simply whether or not the layer's
|
||||
* style.display is set to "block". Now we store a 'visibility' state
|
||||
* property on the layer class, this allows us to remember whether or not
|
||||
* we *desire* for a layer to be visible. In the case where the map's
|
||||
* resolution is out of the layer's range, this desire may be subverted.
|
||||
*
|
||||
* @param {Boolean} visible Whether or not to display the layer
|
||||
* (if in range)
|
||||
* @param {Boolean} noEvent
|
||||
@@ -244,6 +252,7 @@ OpenLayers.Layer.prototype = {
|
||||
setVisibility: function(visibility, noEvent) {
|
||||
if (visibility != this.visibility) {
|
||||
this.visibility = visibility;
|
||||
this.display(visibility);
|
||||
if (this.map != null) {
|
||||
var extent = this.map.getExtent();
|
||||
if (extent != null) {
|
||||
@@ -257,7 +266,8 @@ OpenLayers.Layer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
/** Hide or show the Layer
|
||||
*
|
||||
* @param {Boolean} display
|
||||
*/
|
||||
display: function(display) {
|
||||
|
||||
Reference in New Issue
Block a user