]> git.openstreetmap.org Git - rails.git/blobdiff - public/openlayers/OpenStreetMap.js
Merge 7452:7744 from trunk.
[rails.git] / public / openlayers / OpenStreetMap.js
index d6bc397d132ae517433ae494ad5956a0cc18cef1..f472d3fc14631d543fd4215b8448b9cb71f78e0d 100644 (file)
@@ -182,3 +182,19 @@ OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, {
 
     CLASS_NAME: "OpenLayers.Layer.OSM.Maplint"
 });
+
+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 && !oldvis) {
+            new Ajax.Request('/browse/start', {asynchronous:true, evalScripts:true}); 
+        } else {
+            if (this.stopBrowse) {
+                this.stopBrowse();
+                closeSidebar(); 
+            }    
+        }    
+    }
+});