Don't load things if the layer is already visible: if that's the case, we should already be loading.

This commit is contained in:
Christopher Schmidt 2008-04-26 16:15:45 +00:00
parent 1f0636d253
commit 3d6b28b666

View file

@ -185,9 +185,10 @@ OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, {
OpenLayers.Layer.Data = OpenLayers.Class(OpenLayers.Layer, { OpenLayers.Layer.Data = OpenLayers.Class(OpenLayers.Layer, {
setVisibility: function(vis) { setVisibility: function(vis) {
var oldvis = this.visibility;
OpenLayers.Layer.prototype.setVisibility.apply(this, arguments); OpenLayers.Layer.prototype.setVisibility.apply(this, arguments);
if (!this.map) { return; } if (!this.map) { return; }
if (vis) { if (vis && !oldvis) {
new Ajax.Request('/browse/start', {asynchronous:true, evalScripts:true}); new Ajax.Request('/browse/start', {asynchronous:true, evalScripts:true});
} else { } else {
if (this.stopBrowse) { if (this.stopBrowse) {