Folium: Add sub-layers to layer control

Created on 31 Jul 2016  路  4Comments  路  Source: python-visualization/folium

Here is an example of what I mean by sub-layers. Let's say that I was trying to track a group of dogs and a group of cats like this:

Dogs
-Fido
-Spot
-Rex

Cats
-Wiskers
-Garfield
-Tom

On the top layer I could select all the dogs or all the cats. In the sub-layer I could select any of the individual dogs or cats.

feature request

Most helpful comment

We now have this behavior with the FeatureGroupSubGroup plugin. Check out an example here:

https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/Plugins.ipynb#Sub-categories

All 4 comments

Are there any plans to implement this feature?

Plans? Yes. Manpower to do so? No.

This functionality is not available in Leaflet. This stackoverflow entry asks the same question, they mention this Leaflet plugin that adds grouping in layer control, but doesn't add hierarchy. So actual sub-layers seem difficult to achieve.

We now have this behavior with the FeatureGroupSubGroup plugin. Check out an example here:

https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/Plugins.ipynb#Sub-categories

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alcampopiano picture Alcampopiano  路  14Comments

ElmWer picture ElmWer  路  24Comments

wangchenwc picture wangchenwc  路  18Comments

olibchr picture olibchr  路  19Comments

nathan3leaf picture nathan3leaf  路  32Comments