I need a Leaflet plugin which extends L.Control.Layers. I have the following requirements:

  • works with Leaflet 1.x
  • handles ungrouped layers alongside grouped ones
  • handles nested layer groups
  • does not rely on actual Leaflet LayerGroups, but can be built up independently (in other words, layers can be grouped in this control in a different structure to how the layers themselves are grouped in the Leaflet map)

I've tried:

Can anyone suggest if any plugin does what I need?

BOUNTY ADDED To qualify for the bounty, please link to or upload a fully working example using Leaflet 1.x, including in the custom layer control:

  • ungrouped layers
  • grouped layers
  • nested groups
  • 1
    Maybe you check out github.com/davicustodio/Leaflet.StyledLayerControl – g07kore Aug 31 '17 at 7:45
  • 2
    I think you're asking the wrong question. It'd make more sense to ask WHY the plugins you already linked are not working for you, and try investigating that. – Senshi Mar 21 '18 at 7:47
  • 4
    @Senshi I have, and most plugin authors say that nested groups are out of scope for their plugins. – Tom Chadwin Mar 21 '18 at 23:25
  • 1
    do you mean grouping together items like tile layers separate to your geojson file ? – Francis Odero Jul 26 '20 at 13:38
  • Greta question, and I would love to know the answer. Of course, nowadays, I would ask on software recommendations – Mawg says reinstate Monica Feb 15 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.