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:
+12
-2
@@ -236,7 +236,15 @@ OpenLayers.Layer.prototype = {
|
|||||||
return this.visibility;
|
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
|
* @param {Boolean} visible Whether or not to display the layer
|
||||||
* (if in range)
|
* (if in range)
|
||||||
* @param {Boolean} noEvent
|
* @param {Boolean} noEvent
|
||||||
@@ -244,6 +252,7 @@ OpenLayers.Layer.prototype = {
|
|||||||
setVisibility: function(visibility, noEvent) {
|
setVisibility: function(visibility, noEvent) {
|
||||||
if (visibility != this.visibility) {
|
if (visibility != this.visibility) {
|
||||||
this.visibility = visibility;
|
this.visibility = visibility;
|
||||||
|
this.display(visibility);
|
||||||
if (this.map != null) {
|
if (this.map != null) {
|
||||||
var extent = this.map.getExtent();
|
var extent = this.map.getExtent();
|
||||||
if (extent != null) {
|
if (extent != null) {
|
||||||
@@ -257,7 +266,8 @@ OpenLayers.Layer.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/** Hide or show the Layer
|
||||||
|
*
|
||||||
* @param {Boolean} display
|
* @param {Boolean} display
|
||||||
*/
|
*/
|
||||||
display: function(display) {
|
display: function(display) {
|
||||||
|
|||||||
Reference in New Issue
Block a user