From ac7172bec7a07f292b5d852f70717ecc5f1666d8 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 17 Mar 2008 15:53:13 +0000 Subject: [PATCH] If you call setVisibility(true) on a layer which is out of range, the layer's visibility won't change, but the tiles will be displayed anyway, in the wrong position. Instead, prevent tiles from being displayed at all. r=ahocevar, (Closes #1429) git-svn-id: http://svn.openlayers.org/trunk/openlayers@6540 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 78bc44cee8..3cf5d7ef4d 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -604,8 +604,9 @@ OpenLayers.Layer = OpenLayers.Class({ * display - {Boolean} */ display: function(display) { + var inRange = this.calculateInRange(); if (display != (this.div.style.display != "none")) { - this.div.style.display = (display) ? "block" : "none"; + this.div.style.display = (display && inRange) ? "block" : "none"; } },