All Projects → ismyrnow → Leaflet Groupedlayercontrol

ismyrnow / Leaflet Groupedlayercontrol

Licence: mit
Leaflet layer control with support for grouping overlays together.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Leaflet Groupedlayercontrol

Vue2leaflet
Vue 2 components for Leaflet maps
Stars: ✭ 1,809 (+737.5%)
Mutual labels:  leaflet
Leaflet Tilelayer Baidugaode
leaflet 加载百度瓦片地图图层 以及高德 、天地图等国内常用地图
Stars: ✭ 175 (-18.98%)
Mutual labels:  leaflet
React Leaflet Demo
Demo of a Leaflet map created with React
Stars: ✭ 200 (-7.41%)
Mutual labels:  leaflet
Leaflet.storage
Manage map and features with Leaflet and expose them for backend storage through an API.
Stars: ✭ 138 (-36.11%)
Mutual labels:  leaflet
Node Tileserver
A lightweight tileserver based on NodeJS for serving bitmap and vector tiles.
Stars: ✭ 148 (-31.48%)
Mutual labels:  leaflet
Wind Layer
🎏 🚀 wind-layer | a openlayers && amap && bmap && leaflet && mapbox-gl extension to windjs
Stars: ✭ 188 (-12.96%)
Mutual labels:  leaflet
Flutter map
A Flutter map widget inspired by Leaflet
Stars: ✭ 1,886 (+773.15%)
Mutual labels:  leaflet
Ngx Leaflet Starter
A soup of Angular and Leaflet
Stars: ✭ 208 (-3.7%)
Mutual labels:  leaflet
Tangram
WebGL map rendering engine for creative cartography
Stars: ✭ 1,964 (+809.26%)
Mutual labels:  leaflet
Leaflet.extras
Extra functionality for leaflet R package.
Stars: ✭ 193 (-10.65%)
Mutual labels:  leaflet
Dtp Stat
Карта ДТП
Stars: ✭ 141 (-34.72%)
Mutual labels:  leaflet
Mapbox.js
Mapbox JavaScript API, a Leaflet Plugin
Stars: ✭ 1,819 (+742.13%)
Mutual labels:  leaflet
Geopackage Js
GeoPackage JavaScript Library
Stars: ✭ 191 (-11.57%)
Mutual labels:  leaflet
Leaflet Choropleth
Choropleth plugin for Leaflet (color scale based on value)
Stars: ✭ 138 (-36.11%)
Mutual labels:  leaflet
Ember Leaflet
🔥 🍃 Easy and declarative mapping for ember
Stars: ✭ 201 (-6.94%)
Mutual labels:  leaflet
Leaflet.canvaslayer.field
Load and style Raster files in Leaflet (geotiff & asciigrid)
Stars: ✭ 128 (-40.74%)
Mutual labels:  leaflet
Greinerhormann
Greiner-Hormann polygon clipping algorithm. Does AND, OR, XOR. Plays nicely with Leaflet. Handles non-convex polygons and multiple clipping areas. ~3kb footprint, no dependencies
Stars: ✭ 176 (-18.52%)
Mutual labels:  leaflet
Leaflet Panel Layers
Leaflet Control Layers extended with support groups and icons
Stars: ✭ 210 (-2.78%)
Mutual labels:  leaflet
React Leaflet Markercluster
React wrapper of the official Leaflet.markercluster for react-leaflet
Stars: ✭ 202 (-6.48%)
Mutual labels:  leaflet
Mapsapi
Карты 2ГИС — это точные данные обо всех объектах города, включая новостройки, с детализацией до заборов и внутриквартальных проездов.
Stars: ✭ 193 (-10.65%)
Mutual labels:  leaflet

leaflet-groupedlayercontrol

Leaflet layer control with support for grouping overlays together. Also supports making groups exclusive (radio instead of checkbox).

This project is looking for a maintainer. Interested? Open an issue.

preview

Demos: Basic | Advanced

Installation

Include the compressed JavaScript and CSS files located in the /dist folder.

This project is also available via bower and jspm:

bower install leaflet-groupedlayercontrol

Usage

Initialization

Add groupings to your overlay layers object, and swap out the default layer control with the new one.

var groupedOverlays = {
  "Landmarks": {
    "Motorways": motorways,
    "Cities": cities
  },
  "Points of Interest": {
    "Restaurants": restaurants
  }
};

L.control.groupedLayers(baseLayers, groupedOverlays).addTo(map);

Advanced usage

For added functionality, pass options when creating the layer control.

var options = {
  // Make the "Landmarks" group exclusive (use radio inputs)
  exclusiveGroups: ["Landmarks"],
  // Show a checkbox next to non-exclusive group labels for toggling all
  groupCheckboxes: true
};

L.control.groupedLayers(baseLayers, groupedOverlays, options).addTo(map);

advanced preview

Adding a layer

Adding a layer individually works similarly to the default layer control, except that you can also specify a group name, along with the layer and layer name.

layerControl.addOverlay(cities, "Cities", "Landmarks");

Note

This plugin only affects how the layers are displayed in the layer control, and not how they are rendered or layered on the map.

Grouping base layers is not currently supported, but adding exclusive layer groups is. Layers in an exclusive layer group render as radio inputs.

License

leaflet-groupedlayercontrol is free software, and may be redistributed under the MIT-LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].