o
    Pf                     @   sh   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
 G dd deeZG dd	 d	eeZd
S )    )MacroElement)Template)
JSCSSMixin)Map)get_obj_in_upper_treeparse_optionsc                       sJ   e Zd ZdZedZdgZ								d fd
d	Z fddZ  Z	S )StripePatterna  Fill Pattern for polygon composed of alternating lines.

    Add these to the 'fillPattern' field in GeoJson style functions.

    Parameters
    ----------
    angle: float, default 0.5
        Angle of the line pattern (degrees). Should be between -360 and 360.
    weight: float, default 4
        Width of the main lines (pixels).
    space_weight: float
        Width of the alternate lines (pixels).
    color: string with hexadecimal, RGB, or named color, default "#000000"
        Color of the main lines.
    space_color: string with hexadecimal, RGB, or named color, default "#ffffff"
        Color of the alternate lines.
    opacity: float, default 0.75
        Opacity of the main lines. Should be between 0 and 1.
    space_opacity: float, default 0.0
        Opacity of the alternate lines. Should be between 0 and 1.

    See https://github.com/teastman/Leaflet.pattern for more information.
    a  
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = new L.StripePattern(
                {{ this.options|tojson }}
            );
            {{ this.get_name() }}.addTo({{ this.parent_map.get_name() }});
        {% endmacro %}
    patternz=https://teastman.github.io/Leaflet.pattern/leaflet.pattern.js      ?   #000000#ffffff      ?        c           	   
      s:   t    d| _td|||||||d|| _d | _d S )Nr   )angleweightspace_weightcolorspace_coloropacityspace_opacity )super__init___namer   options
parent_map)	selfr   r   r   r   r   r   r   kwargs	__class__r   b/home/deployuser/azure_apps/autowriter/venv/lib/python3.10/site-packages/folium/plugins/pattern.pyr   1   s   


zStripePattern.__init__c                    s"   t | t| _t jdi | d S Nr   )r   r   r   r   renderr   r   r    r   r"   r$   J   s   zStripePattern.render)r   r   r   r   r   r   r   
__name__
__module____qualname____doc__r   	_template
default_jsr   r$   __classcell__r   r   r    r"   r   	   s     r   c                       sL   e Zd ZdZedZdgZ									d fd
d	Z fddZ  Z	S )CirclePatterna  Fill Pattern for polygon composed of repeating circles.

    Add these to the 'fillPattern' field in GeoJson style functions.

    Parameters
    ----------
    width: int, default 20
        Horizontal distance between circles (pixels).
    height: int, default 20
        Vertical distance between circles (pixels).
    radius: int, default 12
        Radius of each circle (pixels).
    weight: float, default 2.0
        Width of outline around each circle (pixels).
    color: string with hexadecimal, RGB, or named color, default "#3388ff"
        Color of the circle outline.
    fill_color: string with hexadecimal, RGB, or named color, default "#3388ff"
        Color of the circle interior.
    opacity: float, default 0.75
        Opacity of the circle outline. Should be between 0 and 1.
    fill_opacity: float, default 0.5
        Opacity of the circle interior. Should be between 0 and 1.

    See https://github.com/teastman/Leaflet.pattern for more information.
    a  
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }}_shape = new L.PatternCircle(
                {{ this.options_pattern_circle|tojson }}
            );
            var {{ this.get_name() }} = new L.Pattern(
                {{ this.options_pattern|tojson }}
            );
            {{ this.get_name() }}.addShape({{ this.get_name() }}_shape);
            {{ this.get_name() }}.addTo({{ this.parent_map }});
        {% endmacro %}
    r	                @#3388ffr   r   c	           	         sT   t    d| _t|d|  |d|  ||||||dd	| _t||d| _d | _d S )Nr.      T)	xyr   radiusr   
fill_colorr   fill_opacityfill)widthheight)r   r   r   r   options_pattern_circleoptions_patternr   )	r   r:   r;   r6   r   r   r7   r   r8   r    r   r"   r   }   s$   



zCirclePattern.__init__c                    s&   t | t | _t jdi | d S r#   )r   r   get_namer   r   r$   r%   r    r   r"   r$      s   zCirclePattern.render)r/   r/   r0   r1   r2   r2   r   r   r&   r   r   r    r"   r.   O   s"    r.   N)branca.elementr   jinja2r   folium.elementsr   folium.foliumr   folium.utilitiesr   r   r   r.   r   r   r   r"   <module>   s    F