From 5c4ef6011dfdd29001a360605e091a2687286273 Mon Sep 17 00:00:00 2001 From: euzuro Date: Tue, 3 Jul 2007 21:45:26 +0000 Subject: [PATCH] patch from #796 - warn users if they try to add a layer that has already been added git-svn-id: http://svn.openlayers.org/trunk/openlayers@3574 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 5befd0d1b4..20841872c3 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -492,6 +492,9 @@ OpenLayers.Map.prototype = { 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; } }