# Path: folium/map.py
# class Layer(MacroElement):
#     """An abstract class for everything that is a Layer on the map.
#     It will be used to define whether an object will be included in
#     LayerControls.
# 
#     Parameters
#     ----------
#     name : string, default None
#         The name of the Layer, as it will appear in LayerControls
#     overlay : bool, default False
#         Adds the layer as an optional overlay (True) or the base layer (False).
#     control : bool, default True
#         Whether the Layer will be included in LayerControls.
#     show: bool, default True
#         Whether the layer will be shown on opening (only for overlays).
#     """
#     def __init__(self, name=None, overlay=False, control=True, show=True):
#         super(Layer, self).__init__()
#         self.layer_name = name if name is not None else self.get_name()
#         self.overlay = overlay
#         self.control = control
#         self.show = show


from folium.elements import JSCSSMixin
from folium.map import Layer
from jinja2 import Template
    -------

    Nested groups
    =============
    >>> fg = folium.FeatureGroup()                          # Main group
    >>> g1 = folium.plugins.FeatureGroupSubGroup(fg, 'g1')  # First subgroup of fg
    >>> g2 = folium.plugins.FeatureGroupSubGroup(fg, 'g2')  # Second subgroup of fg
    >>> m.add_child(fg)
    >>> m.add_child(g1)
    >>> m.add_child(g2)
    >>> g1.add_child(folium.Marker([0,0]))
    >>> g2.add_child(folium.Marker([0,1]))
    >>> folium.LayerControl().add_to(m)

    Multiple overlays part of the same cluster group
    =====================================================
    >>> mcg = folium.plugins.MarkerCluster(control=False)   # Marker Cluster, hidden in controls
    >>> g1 = folium.plugins.FeatureGroupSubGroup(mcg, 'g1') # First group, in mcg
    >>> g2 = folium.plugins.FeatureGroupSubGroup(mcg, 'g2') # Second group, in mcg
    >>> m.add_child(mcg)
    >>> m.add_child(g1)
    >>> m.add_child(g2)
    >>> g1.add_child(folium.Marker([0,0]))
    >>> g2.add_child(folium.Marker([0,1]))
    >>> folium.LayerControl().add_to(m)
    """
    _template = Template(u"""
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = L.featureGroup.subGroup(
                {{ this._group.get_name() }}

# Path: folium/map.py
# class Layer(MacroElement):
#     """An abstract class for everything that is a Layer on the map.
#     It will be used to define whether an object will be included in
#     LayerControls.
# 
#     Parameters
#     ----------
#     name : string, default None
#         The name of the Layer, as it will appear in LayerControls
#     overlay : bool, default False
#         Adds the layer as an optional overlay (True) or the base layer (False).
#     control : bool, default True
#         Whether the Layer will be included in LayerControls.
#     show: bool, default True
#         Whether the layer will be shown on opening (only for overlays).
#     """
#     def __init__(self, name=None, overlay=False, control=True, show=True):
#         super(Layer, self).__init__()
#         self.layer_name = name if name is not None else self.get_name()
#         self.overlay = overlay
#         self.control = control
#         self.show = show


# Path: folium/plugins/feature_group_sub_group.py
from folium.elements import JSCSSMixin
from folium.map import Layer
from jinja2 import Template

    -------

    Nested groups
    =============
    >>> fg = folium.FeatureGroup()                          # Main group
    >>> g1 = folium.plugins.FeatureGroupSubGroup(fg, 'g1')  # First subgroup of fg
    >>> g2 = folium.plugins.FeatureGroupSubGroup(fg, 'g2')  # Second subgroup of fg
    >>> m.add_child(fg)
    >>> m.add_child(g1)
    >>> m.add_child(g2)
    >>> g1.add_child(folium.Marker([0,0]))
    >>> g2.add_child(folium.Marker([0,1]))
    >>> folium.LayerControl().add_to(m)

    Multiple overlays part of the same cluster group
    =====================================================
    >>> mcg = folium.plugins.MarkerCluster(control=False)   # Marker Cluster, hidden in controls
    >>> g1 = folium.plugins.FeatureGroupSubGroup(mcg, 'g1') # First group, in mcg
    >>> g2 = folium.plugins.FeatureGroupSubGroup(mcg, 'g2') # Second group, in mcg
    >>> m.add_child(mcg)
    >>> m.add_child(g1)
    >>> m.add_child(g2)
    >>> g1.add_child(folium.Marker([0,0]))
    >>> g2.add_child(folium.Marker([0,1]))
    >>> folium.LayerControl().add_to(m)
    """
    _template = Template(u"""
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = L.featureGroup.subGroup(
                {{ this._group.get_name() }}

            );