/*! SelectLayersControl - v0.2.2 - 2014-10-10 https://github.com/vogdb/SelectLayersControl.git Copyright (c) 2014 Sanin Aleksey aka vogdb; Licensed MIT */ L.Control.SelectLayers=L.Control.ActiveLayers.extend({_initLayout:function(){var a="leaflet-control-layers",b=this._container=L.DomUtil.create("div",a);L.DomEvent.disableClickPropagation(b),L.Browser.touch?L.DomEvent.on(b,"click",L.DomEvent.stopPropagation):L.DomEvent.on(b,"mousewheel",L.DomEvent.stopPropagation);var c=this._form=L.DomUtil.create("form",a+"-list");if(this.options.collapsed){var d=this._layersLink=L.DomUtil.create("a",a+"-toggle",b);d.href="#",d.title="Layers",L.Browser.touch?L.DomEvent.on(d,"click",L.DomEvent.stopPropagation).on(d,"click",L.DomEvent.preventDefault).on(d,"click",this._expand,this):(L.DomEvent.on(b,"mouseover",this._expand,this).on(b,"mouseout",this._collapse,this),L.DomEvent.on(d,"focus",this._expand,this)),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=L.DomUtil.create("select",a+"-base",c),L.DomEvent.on(this._baseLayersList,"change",this._onBaseLayerOptionChange,this),this._separator=L.DomUtil.create("div",a+"-separator",c),this._overlaysList=L.DomUtil.create("select",a+"-overlays",c),this._overlaysList.setAttribute("multiple",!0),this._overlaysList.style.width="100%",L.DomEvent.on(this._overlaysList,"change",this._onOverlayLayerOptionChange,this),b.appendChild(c)},_onBaseLayerOptionChange:function(){var a=this._baseLayersList.selectedIndex,b=this._baseLayersList.options[a],c=this._layers[b.layerId];this._changeBaseLayer(c)},_changeBaseLayer:function(a){this._handlingClick=!0,this._map.addLayer(a.layer),this._map.removeLayer(this._activeBaseLayer.layer),this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:a.layer}),this._activeBaseLayer=a,this._handlingClick=!1},_onOverlayLayerOptionChange:function(){this._handlingClick=!0;for(var a=this._overlaysList.options,b=0;b