o
    Pf
                     @   s:   d dl mZ d dlmZ d dlmZ G dd deeZdS )    )Template)
JSCSSMixin)Layerc                       s0   e Zd ZdZedZdgZd fdd	Z  ZS )	FeatureGroupSubGroupaJ  
    Creates a Feature Group that adds its child layers into a parent group when
    added to a map (e.g. through LayerControl). Useful to create nested groups,
    or cluster markers from multiple overlays. From [0].

    [0] https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup

    Parameters
    ----------
    group : Layer
        The MarkerCluster or FeatureGroup containing this subgroup.
    name : string, default None
        The name of the Layer, as it will appear in LayerControls
    overlay : bool, default True
        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.

    Examples
    -------

    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)
    z
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = L.featureGroup.subGroup(
                {{ this._group.get_name() }}
            );
        {% endmacro %}
        )featuregroupsubgroupjsz[https://unpkg.com/leaflet.featuregroup.subgroup@1.0.2/dist/leaflet.featuregroup.subgroup.jsNTc                    s$   t  j||||d || _d| _d S )N)nameoverlaycontrolshowr   )super__init___group_name)selfgroupr   r   r	   r
   	__class__ r/home/deployuser/azure_apps/autowriter/venv/lib/python3.10/site-packages/folium/plugins/feature_group_sub_group.pyr   K   s   
zFeatureGroupSubGroup.__init__)NTTT)	__name__
__module____qualname____doc__r   	_template
default_jsr   __classcell__r   r   r   r   r      s    2r   N)jinja2r   folium.elementsr   
folium.mapr   r   r   r   r   r   <module>   s    