Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Leaflet Control Layers extended for group of base and overlay layers

License

Notifications You must be signed in to change notification settings

robbiet480/leaflet-categorized-layers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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