o
    PÉf 	  ã                   @   sJ   d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ deeƒZ	dS )	znAdd Locate control to folium Map.

Based on leaflet plugin: https://github.com/domoritz/leaflet-locatecontrol
é    )ÚMacroElement)ÚTemplate)Ú
JSCSSMixin)Úparse_optionsc                       s6   e Zd ZdZedƒZdgZdgZd‡ fdd„	Z‡  Z	S )	ÚLocateControla  Control plugin to geolocate the user.

    This plugins adds a button to the map, and when it's clicked shows the current
    user device location.

    To work properly in production, the connection needs to be encrypted, otherwise browser will not
    allow users to share their location.

    Parameters
    ----------
    auto-start : bool, default False
        When set to True, plugin will be activated on map loading and search for user position.
        Once user location is founded, the map will automatically centered in using user coordinates.
    **kwargs
        For possible options, see https://github.com/domoritz/leaflet-locatecontrol

    Examples
    --------
    >>> m = folium.Map()
    # With default settings
    >>> LocateControl().add_to(m)

    # With some custom options
    >>> LocateControl(
    ...     position="bottomright",
    ...     strings={"title": "See you current location", "popup": "Your position"},
    ... ).add_to(m)

    For more info check:
    https://github.com/domoritz/leaflet-locatecontrol

    aG  
        {% macro script(this, kwargs) %}
            var {{this.get_name()}} = L.control.locate(
                {{this.options | tojson}}
            ).addTo({{this._parent.get_name()}});
            {% if this.auto_start %}
                {{this.get_name()}}.start();
            {% endif %}
        {% endmacro %}
        )ÚControl_locate_min_jsz[https://cdnjs.cloudflare.com/ajax/libs/leaflet-locatecontrol/0.66.2/L.Control.Locate.min.js)ÚControl_locate_min_cssz\https://cdnjs.cloudflare.com/ajax/libs/leaflet-locatecontrol/0.66.2/L.Control.Locate.min.cssFc                    s*   t ƒ  ¡  d| _|| _tdi |¤Ž| _d S )Nr   © )ÚsuperÚ__init__Ú_nameÚ
auto_startr   Úoptions)Úselfr   Úkwargs©Ú	__class__r	   úi/home/deployuser/azure_apps/autowriter/venv/lib/python3.10/site-packages/folium/plugins/locate_control.pyr   I   s   
zLocateControl.__init__)F)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú	_templateÚ
default_jsÚdefault_cssr   Ú__classcell__r	   r	   r   r   r      s    !ÿÿÿr   N)
r   Úbranca.elementr   Újinja2r   Úfolium.elementsr   Úfolium.utilitiesr   r   r	   r	   r	   r   Ú<module>   s    