Skip to content
This repository has been archived by the owner. It is now read-only.

robbiet480/leaflet-categorized-layers

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Leaflet Categorized Layers

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.

About

Leaflet Control Layers extended for group of base and overlay layers

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published