]> git.openstreetmap.org Git - rails.git/commitdiff
Don't load things if the layer is already visible: if that's the case, we should...
authorChristopher Schmidt <crschmidt@crschmidt.net>
Sat, 26 Apr 2008 16:15:45 +0000 (16:15 +0000)
committerChristopher Schmidt <crschmidt@crschmidt.net>
Sat, 26 Apr 2008 16:15:45 +0000 (16:15 +0000)
public/openlayers/OpenStreetMap.js

index 244930866ab07a46c834304eb3b3c40b2050ec30..f472d3fc14631d543fd4215b8448b9cb71f78e0d 100644 (file)
@@ -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) {