o
    Pf                     @   sF   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 )    )MacroElement)Template)
JSCSSMixin)parse_optionsc                       sF   e Zd ZdZedZdgZdgZ							
		d fdd	Z  Z	S )MousePositionu\  Add a field that shows the coordinates of the mouse position.

    Uses the Leaflet plugin by Ardhi Lukianto under MIT license.
    https://github.com/ardhi/Leaflet.MousePosition

    Parameters
    ----------
    position : str, default 'bottomright'
        The standard Control position parameter for the widget.
    separator : str, default ' : '
        Character used to separate latitude and longitude values.
    empty_string : str, default 'Unavailable'
       Initial text to display.
    lng_first : bool, default False
        Whether to put the longitude first or not.
        Set as True to display longitude before latitude.
    num_digits : int, default '5'
        Number of decimal places included in the displayed
        longitude and latitude decimal degree values.
    prefix : str, default ''
        A string to be prepended to the coordinates.
    lat_formatter : str, default None
        Custom Javascript function to format the latitude value.
    lng_formatter : str, default None
        Custom Javascript function to format the longitude value.

    Examples
    --------
    >>> fmtr = "function(num) {return L.Util.formatNum(num, 3) + ' º ';};"
    >>> MousePosition(
    ...     position="topright",
    ...     separator=" | ",
    ...     prefix="Mouse:",
    ...     lat_formatter=fmtr,
    ...     lng_formatter=fmtr,
    ... )

    a  
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = new L.Control.MousePosition(
                {{ this.options|tojson }}
            );
            {{ this.get_name() }}.options["latFormatter"] =
                {{ this.lat_formatter }};
            {{ this.get_name() }}.options["lngFormatter"] =
                {{ this.lng_formatter }};
            {{ this._parent.get_name() }}.addControl({{ this.get_name() }});
        {% endmacro %}
    )Control_MousePosition_jszZhttps://cdn.jsdelivr.net/gh/ardhi/Leaflet.MousePosition/src/L.Control.MousePosition.min.js)Control_MousePosition_cssz[https://cdn.jsdelivr.net/gh/ardhi/Leaflet.MousePosition/src/L.Control.MousePosition.min.cssbottomright : UnavailableF    Nc	           
   	      sF   t    d| _td||||||d|	| _|pd| _|pd| _d S )Nr   )position	separatorempty_string	lng_first
num_digitsprefix	undefined )super__init___namer   optionslat_formatterlng_formatter)
selfr   r   r   r   r   r   r   r   kwargs	__class__r   i/home/deployuser/azure_apps/autowriter/venv/lib/python3.10/site-packages/folium/plugins/mouse_position.pyr   L   s   

	zMousePosition.__init__)r	   r
   r   Fr   r   NN)
__name__
__module____qualname____doc__r   	_template
default_jsdefault_cssr   __classcell__r   r   r   r    r      s$    '	r   N)	branca.elementr   jinja2r   folium.elementsr   folium.utilitiesr   r   r   r   r   r    <module>   s
    