From b28b6da9242cb98e803bcd9e71e06eb2f9307b82 Mon Sep 17 00:00:00 2001 From: danzel Date: Mon, 19 Nov 2012 09:58:28 +1300 Subject: [PATCH] Add setZIndex to LayerGroup to allow LayerGroups to work better with the layers control. Fixes #1096 --- src/layer/LayerGroup.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/layer/LayerGroup.js b/src/layer/LayerGroup.js index 7095d919..4f4dc998 100644 --- a/src/layer/LayerGroup.js +++ b/src/layer/LayerGroup.js @@ -82,6 +82,15 @@ L.LayerGroup = L.Class.extend({ method.call(context, this._layers[i]); } } + }, + + setZIndex: function(zIndex) + { + this.eachLayer(function(l) { + if (l.setZIndex) { + l.setZIndex(zIndex); + } + }, this); } });