X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e03605929bcd7fe864c0b0c38c4ec8c80f865c39..5620d7263a36fe842f4d97bc21dda5edd0651b37:/public/openlayers/OpenStreetMap.js diff --git a/public/openlayers/OpenStreetMap.js b/public/openlayers/OpenStreetMap.js index d6bc397d1..f472d3fc1 100644 --- a/public/openlayers/OpenStreetMap.js +++ b/public/openlayers/OpenStreetMap.js @@ -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(); + } + } + } +});