only jolt layer if we are setting it to visible (and if it has its 'map' property set.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@462 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-29 19:54:55 +00:00
parent 85ccc6c638
commit 40cb75ca27

View File

@@ -58,7 +58,9 @@ OpenLayers.Layer.prototype = {
*/
setVisibility: function(visible) {
this.div.style.display = (visible) ? "block" : "none";
this.moveTo(this.map.getExtent());
if ((visible) && (this.map != null)) {
this.moveTo(this.map.getExtent());
}
},
/** @final @type String */