[OpenLayers-Commits] r3574 - trunk/openlayers/lib/OpenLayers
commits at openlayers.org
commits at openlayers.org
Tue Jul 3 17:45:36 EDT 2007
Author: euzuro
Date: 2007-07-03 17:45:26 -0400 (Tue, 03 Jul 2007)
New Revision: 3574
Modified:
trunk/openlayers/lib/OpenLayers/Map.js
Log:
patch from #796 - warn users if they try to add a layer that has already been added
Modified: trunk/openlayers/lib/OpenLayers/Map.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Map.js 2007-07-03 18:55:44 UTC (rev 3573)
+++ trunk/openlayers/lib/OpenLayers/Map.js 2007-07-03 21:45:26 UTC (rev 3574)
@@ -492,6 +492,9 @@
addLayer: function (layer) {
for(var i=0; i < this.layers.length; i++) {
if (this.layers[i] == layer) {
+ var msg = "You tried to add the layer: " + layer.name +
+ " to the map, but it has already been added";
+ OpenLayers.Console.warn(msg);
return false;
}
}
More information about the Commits
mailing list