Map.addLayer() will return false when adding duplicate layers. Fixes #248.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2539 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -299,6 +299,12 @@ OpenLayers.Map.prototype = {
|
||||
* @param {OpenLayers.Layer} layer
|
||||
*/
|
||||
addLayer: function (layer) {
|
||||
for(var i=0; i < this.layers.length; i++) {
|
||||
if (this.layers[i] == layer) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
layer.div.style.overflow = "";
|
||||
this.setLayerZIndex(layer, this.layers.length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user