/*! Version: 0.6.1
Date: 2018-04-30 */
L.Control.GroupedLayers=L.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,exclusiveGroups:[],groupCheckboxes:!1},initialize:function(a,b,c){var d,e;L.Util.setOptions(this,c),this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._groupList=[],this._domGroups=[];for(d in a)this._addLayer(a[d],d);for(d in b)for(e in b[d])this._addLayer(b[d][e],e,d,!0)},onAdd:function(a){return this._initLayout(),this._update(),a.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(a){a.off("layeradd",this._onLayerChange,this).off("layerremove",this._onLayerChange,this)},addBaseLayer:function(a,b){return this._addLayer(a,b),this._update(),this},addOverlay:function(a,b,c){return this._addLayer(a,b,c,!0),this._update(),this},removeLayer:function(a){var b=L.Util.stamp(a),c=this._getLayer(b);return c&&delete this._layers[this._layers.indexOf(c)],this._update(),this},_getLayer:function(a){for(var b=0;b";var d=document.createElement("div");return d.innerHTML=c,d.firstChild},_addItem:function(a){var b,c,d,e=document.createElement("label"),f=this._map.hasLayer(a.layer);a.overlay?a.group.exclusive?(d="leaflet-exclusive-group-layer-"+a.group.id,b=this._createRadioElement(d,f)):(b=document.createElement("input"),b.type="checkbox",b.className="leaflet-control-layers-selector",b.defaultChecked=f):b=this._createRadioElement("leaflet-base-layers",f),b.layerId=L.Util.stamp(a.layer),b.groupID=a.group.id,L.DomEvent.on(b,"click",this._onInputClick,this);var g=document.createElement("span");if(g.innerHTML=" "+a.name,e.appendChild(b),e.appendChild(g),a.overlay){c=this._overlaysList;var h=this._domGroups[a.group.id];if(!h){h=document.createElement("div"),h.className="leaflet-control-layers-group",h.id="leaflet-control-layers-group-"+a.group.id;var i=document.createElement("label");if(i.className="leaflet-control-layers-group-label",""!==a.group.name&&!a.group.exclusive&&this.options.groupCheckboxes){var j=document.createElement("input");j.type="checkbox",j.className="leaflet-control-layers-group-selector",j.groupID=a.group.id,j.legend=this,L.DomEvent.on(j,"click",this._onGroupInputClick,j),i.appendChild(j)}var k=document.createElement("span");k.className="leaflet-control-layers-group-name",k.innerHTML=a.group.name,i.appendChild(k),h.appendChild(i),c.appendChild(h),this._domGroups[a.group.id]=h}c=h}else c=this._baseLayersList;return c.appendChild(e),e},_onGroupInputClick:function(){var a,b,c,d=this.legend;d._handlingClick=!0;var e=d._form.getElementsByTagName("input"),f=e.length;for(a=0;f>a;a++)b=e[a],b.groupID===this.groupID&&"leaflet-control-layers-selector"===b.className&&(b.checked=this.checked,c=d._getLayer(b.layerId),b.checked&&!d._map.hasLayer(c.layer)?d._map.addLayer(c.layer):!b.checked&&d._map.hasLayer(c.layer)&&d._map.removeLayer(c.layer));d._handlingClick=!1},_onInputClick:function(){var a,b,c,d=this._form.getElementsByTagName("input"),e=d.length;for(this._handlingClick=!0,a=0;e>a;a++)b=d[a],"leaflet-control-layers-selector"===b.className&&(c=this._getLayer(b.layerId),b.checked&&!this._map.hasLayer(c.layer)?this._map.addLayer(c.layer):!b.checked&&this._map.hasLayer(c.layer)&&this._map.removeLayer(c.layer));this._handlingClick=!1},_expand:function(){L.DomUtil.addClass(this._container,"leaflet-control-layers-expanded");var a=this._map._size.y-4*this._container.offsetTop;ac;c++)if(a[c]===b)return c;return-1}}),L.control.groupedLayers=function(a,b,c){return new L.Control.GroupedLayers(a,b,c)};
//# sourceMappingURL=leaflet.groupedlayercontrol.min.js.map