From 63ad64cb7a2e0de040fc7663f72dbd1d61a72d8f Mon Sep 17 00:00:00 2001 From: danzel Date: Tue, 20 Nov 2012 09:36:23 +1300 Subject: [PATCH] Use invoke to make this code smaller. --- src/layer/LayerGroup.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/layer/LayerGroup.js b/src/layer/LayerGroup.js index 4f4dc998..ca8ce8db 100644 --- a/src/layer/LayerGroup.js +++ b/src/layer/LayerGroup.js @@ -84,13 +84,8 @@ L.LayerGroup = L.Class.extend({ } }, - setZIndex: function(zIndex) - { - this.eachLayer(function(l) { - if (l.setZIndex) { - l.setZIndex(zIndex); - } - }, this); + setZIndex: function(zIndex) { + return this.invoke('setZIndex', zIndex); } });