From: Christopher Schmidt Date: Sat, 26 Apr 2008 16:15:45 +0000 (+0000) Subject: Don't load things if the layer is already visible: if that's the case, we should... X-Git-Tag: live~8263^2~13 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/3d6b28b6662a37ee10491fcd739f7ccdaf56f8db?hp=1f0636d2532b014573f98f835a6725d5663b7c9c Don't load things if the layer is already visible: if that's the case, we should already be loading. --- diff --git a/public/openlayers/OpenStreetMap.js b/public/openlayers/OpenStreetMap.js index 244930866..f472d3fc1 100644 --- a/public/openlayers/OpenStreetMap.js +++ b/public/openlayers/OpenStreetMap.js @@ -185,9 +185,10 @@ OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, { OpenLayers.Layer.Data = OpenLayers.Class(OpenLayers.Layer, { setVisibility: function(vis) { + var oldvis = this.visibility; OpenLayers.Layer.prototype.setVisibility.apply(this, arguments); if (!this.map) { return; } - if (vis) { + if (vis && !oldvis) { new Ajax.Request('/browse/start', {asynchronous:true, evalScripts:true}); } else { if (this.stopBrowse) {