From 40cb75ca27287d93c684a77eec1490d44988d579 Mon Sep 17 00:00:00 2001 From: euzuro Date: Mon, 29 May 2006 19:54:55 +0000 Subject: [PATCH] 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 --- lib/OpenLayers/Layer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 2aa119e4ce..4f18e91f1b 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -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 */