diff --git a/README.md b/README.md index 129e5f6..52e25a4 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,9 @@ var groupedOverlays = { } }; -L.control.groupedLayers(baseLayers, groupedOverlays).addTo(map); +var options = { exclusiveGroups: ["Landmarks"] }; + +L.control.groupedLayers(baseLayers, groupedOverlays, options).addTo(map); ``` The [example](example/basic.html) shows its usage with various layers. @@ -44,7 +46,8 @@ layerControl.addOverlay(cities, "Cities", "Landmarks"). 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. +Grouping base layers is not currently supported, but adding exclusive layer +groups is. Layers in an exclusive layer group render as radio inputs. ## License diff --git a/example/basic.html b/example/basic.html index 725fda4..18d683c 100644 --- a/example/basic.html +++ b/example/basic.html @@ -1,72 +1,77 @@ - Basic example + Basic Example + - - - + - - - +
-
- - + + diff --git a/preview.png b/preview.png index 41806e6..4797aa5 100644 Binary files a/preview.png and b/preview.png differ