There is no API for this, but you can easily create it yourself:
// Add method to layer control class L.Control.Layers.include({ getActiveOverlays: function () { // Create array for holding active layers var active = []; // Iterate all layers in control this._layers.forEach(function (obj) { // Check if it an overlay and added to the map if (obj.overlay && this._map.hasLayer(obj.layer)) { // Push layer to active array active.push(obj.layer); } }); // Return array return active; } }); var control = new L.Control.Layers(...), active = control.getActiveOverlays();
source share