Leaflet Control Layers extended for group of base and overlay layers
Copyright 2014 Robbie Trencheny
Tested in Leaflet 0.7
Source code:
Github
#Usage
var baseLayers = {
"Esri": {
"WorldStreetMap": L.tileLayer.provider('Esri.WorldStreetMap'),
"DeLorme": L.tileLayer.provider('Esri.DeLorme'),
}
};
var overlayLayers = {
"Weather": {
"OpenWeatherMap Clouds": L.tileLayer.provider('OpenWeatherMap.Clouds'),
"OpenWeatherMap Precipitation": L.tileLayer.provider('OpenWeatherMap.Precipitation'),
"OpenWeatherMap Rain": L.tileLayer.provider('OpenWeatherMap.Rain'),
"OpenWeatherMap Pressure": L.tileLayer.provider('OpenWeatherMap.Pressure'),
"OpenWeatherMap Wind": L.tileLayer.provider('OpenWeatherMap.Wind')
}
};
map.addControl( new L.Control.CategorizedLayers(baseLayers, overLayers, {collapsed: false}) );
#Thanks Thanks to Stefano Cudini for the initial idea in his leaflet-panel-layers project.