
    phD                         S r SSKrSSKrSSKJrJrJrJrJr  SSK	J
r
Jr  SSKJr  SSKJrJrJr  SSKJr  SSKJr  SS	KJrJrJrJrJrJrJr  / S
Qr/ SQr " S S\
5      r  " S S\\5      r!g)z>
Make beautiful, interactive maps with Python and Leaflet.js

    N)AnyListOptionalSequenceUnion)ElementFigure)
JSCSSMixin)Evented	FitBoundsLayer)	TileLayer)Template)
TypeBoundsTypeJsonValue_parse_sizeparse_font_sizeremove_emptytemp_html_filepathvalidate_location))leafletz:https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js)jqueryz+https://code.jquery.com/jquery-3.7.1.min.js)	bootstrapzLhttps://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js)awesome_markersz_https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js))leaflet_cssz;https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css)bootstrap_csszGhttps://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css)glyphicons_csszLhttps://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css)awesome_markers_font_csszPhttps://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css)awesome_markers_cssz`https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css)awesome_rotate_csszghttps://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.cssc                   <   ^  \ rS rSr\" S5      rSU 4S jjrSrU =r$ )GlobalSwitchesA   z
        <script>
            L_NO_TOUCH = {{ this.no_touch |tojson}};
            L_DISABLE_3D = {{ this.disable_3d|tojson }};
        </script>
    c                 H   > [         TU ]  5         SU l        Xl        X l        g )Nr"   )super__init___nameno_touch
disable_3d)selfr(   r)   	__class__s      eC:\Users\julio\OneDrive\Documentos\Trabajo\IdeasFrscas\Cabanna\env\Lib\site-packages\folium/folium.pyr&   GlobalSwitches.__init__K   s    %
 $    )r'   r)   r(   )FF)	__name__
__module____qualname____firstlineno__r   	_templater&   __static_attributes____classcell__r+   s   @r,   r"   r"   A   s    	I% %r.   r"   c            3         ^  \ rS rSrSr\" S5      r\r\	r
                        S/S\\\      S\\\4   S\\\4   S\\\4   S	\\\4   S
\S\\\S4   S\\   S\\   S\\   S\S\S\S\S\S\S\S\S\S\S\S\S\\\4   S\S\42U 4S jjjrS\4S  jr S0S!\S"\S#\\\      S\4S$ jjrS\\   4S% jrS1S& jr    S2S'\S(\\\      S)\\\      S*\\\      S\\   SS4S+ jjrS,\SS4S- jrS.rU =r $ )3MapR   a	  Create a Map with Folium and Leaflet.js

Generate a base map of given width and height with either default
tilesets or a custom tileset URL. Folium has built-in all tilesets
available in the ``xyzservices`` package. For example, you can pass
any of the following to the "tiles" keyword:

    - "OpenStreetMap"
    - "CartoDB Positron"
    - "CartoDB Voyager"

Explore more provider names available in ``xyzservices`` here:
https://leaflet-extras.github.io/leaflet-providers/preview/.

You can also pass a custom tileset by passing a
:class:`xyzservices.TileProvider` or a Leaflet-style
URL to the tiles parameter: ``https://{s}.yourtiles.com/{z}/{x}/{y}.png``.

Parameters
----------
location: tuple or list, default None
    Latitude and Longitude of Map (Northing, Easting).
width: pixel int or percentage string (default: '100%')
    Width of the map.
height: pixel int or percentage string (default: '100%')
    Height of the map.
tiles: str or TileLayer or :class:`xyzservices.TileProvider`, default 'OpenStreetMap'
    Map tileset to use. Can choose from a list of built-in tiles,
    pass a :class:`xyzservices.TileProvider`,
    pass a custom URL, pass a TileLayer object,
    or pass `None` to create a map without tiles.
    For more advanced tile layer options, use the `TileLayer` class.
min_zoom: int, optional, default 0
    Minimum allowed zoom level for the tile layer that is created.
    Filled by xyzservices by default.
max_zoom: int, optional, default 18
    Maximum allowed zoom level for the tile layer that is created.
    Filled by xyzservices by default.
zoom_start: int, default 10
    Initial zoom level for the map.
attr: string, default None
    Map tile attribution; only required if passing custom tile URL.
crs : str, default 'EPSG3857'
    Defines coordinate reference systems for projecting geographical points
    into pixel (screen) coordinates and back.
    You can use Leaflet's values :
    * EPSG3857 : The most common CRS for online maps, used by almost all
    free and commercial tile providers. Uses Spherical Mercator projection.
    Set in by default in Map's crs option.
    * EPSG4326 : A common CRS among GIS enthusiasts.
    Uses simple Equirectangular projection.
    * EPSG3395 : Rarely used by some commercial tile providers.
    Uses Elliptical Mercator projection.
    * Simple : A simple CRS that maps longitude and latitude into
    x and y directly. May be used for maps of flat surfaces
    (e.g. game maps). Note that the y axis should still be inverted
    (going from bottom to top).
control_scale : bool, default False
    Whether to add a control scale on the map.
prefer_canvas : bool, default False
    Forces Leaflet to use the Canvas back-end (if available) for
    vector layers instead of SVG. This can increase performance
    considerably in some cases (e.g. many thousands of circle
    markers on the map).
no_touch : bool, default False
    Forces Leaflet to not use touch events even if it detects them.
disable_3d : bool, default False
    Forces Leaflet to not use hardware-accelerated CSS 3D
    transforms for positioning (which may cause glitches in some
    rare environments) even if they're supported.
zoom_control : bool or position string, default True
    Display zoom controls on the map. The default `True` places it in the top left corner.
    Other options are 'topleft', 'topright', 'bottomleft' or 'bottomright'.
font_size : int or float or string (default: '1rem')
    The font size to use for Leaflet, can either be a number or a
    string ending in 'rem', 'em', or 'px'.
**kwargs
    Additional keyword arguments are passed to Leaflets Map class:
    https://leafletjs.com/reference.html#map

Returns
-------
Folium Map Object

Examples
--------
>>> m = folium.Map(location=[45.523, -122.675], width=750, height=500)
>>> m = folium.Map(location=[45.523, -122.675], tiles="cartodb positron")
>>> m = folium.Map(
...     location=[45.523, -122.675],
...     zoom_start=2,
...     tiles="https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=mytoken",
...     attr="Mapbox attribution",
... )

a	  
        {% macro header(this, kwargs) %}
            <meta name="viewport" content="width=device-width,
                initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
            <style>
                #{{ this.get_name() }} {
                    position: {{this.position}};
                    width: {{this.width[0]}}{{this.width[1]}};
                    height: {{this.height[0]}}{{this.height[1]}};
                    left: {{this.left[0]}}{{this.left[1]}};
                    top: {{this.top[0]}}{{this.top[1]}};
                }
                .leaflet-container { font-size: {{this.font_size}}; }
            </style>

            <style>html, body {
                width: 100%;
                height: 100%;
                margin: 0;
                padding: 0;
            }
            </style>

            <style>#map {
                position:absolute;
                top:0;
                bottom:0;
                right:0;
                left:0;
                }
            </style>

            <script>
                L_NO_TOUCH = {{ this.global_switches.no_touch |tojson}};
                L_DISABLE_3D = {{ this.global_switches.disable_3d|tojson }};
            </script>

        {% endmacro %}

        {% macro html(this, kwargs) %}
            <div class="folium-map" id={{ this.get_name()|tojson }} ></div>
        {% endmacro %}

        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = L.map(
                {{ this.get_name()|tojson }},
                {
                    center: {{ this.location|tojson }},
                    crs: L.CRS.{{ this.crs }},
                    ...{{this.options|tojavascript}}

                }
            );

            {%- if this.control_scale %}
            L.control.scale().addTo({{ this.get_name() }});
            {%- endif %}

            {%- if this.zoom_control_position %}
            L.control.zoom( { position: {{ this.zoom_control|tojson }} } ).addTo({{ this.get_name() }});
            {%- endif %}

            {% if this.objects_to_stay_in_front %}
            function objects_in_front() {
                {%- for obj in this.objects_to_stay_in_front %}
                    {{ obj.get_name() }}.bringToFront();
                {%- endfor %}
            };
            {{ this.get_name() }}.on("overlayadd", objects_in_front);
            $(document).ready(objects_in_front);
            {%- endif %}

        {% endmacro %}
        Nlocationwidthheightlefttoppositiontilesattrmin_zoommax_zoom
zoom_startmin_latmax_latmin_lonmax_lon
max_boundscrscontrol_scaleprefer_canvasr(   r)   png_enabledzoom_control	font_sizekwargsc                 @  > [         TU ]  5         SU l        S U l        UU l        Uc  SS/U l        SnO[        U5      U l        [        5       R                  U 5        [        U5      U l
        [        U5      U l        [        U5      U l        [        U5      U l        X`l        [        U5      U l        U(       a  X/X//OS nUU l        UU l        ['        U[(        5      (       a   SU l        US;  a  [-        S5      eUU l        OSU l        [1        UU5      U l        [5        SUUU R*                  (       a  SOUUS.UD6U l        / U l        ['        U[:        5      (       a  U R                  U5        g U(       a%  [;        XxXS	9nU R                  UUR<                  S
9  g g )Nr8   g           T>   toplefttopright
bottomleftbottomrightzeIncorrect value for `zoom_control`, choose from 'topleft', 'topright', 'bottomleft' or 'bottomright'.F)rI   zoomrN   rL   )r@   rA   rB   rC   )name )r%   r&   r'   
_png_imagerM   r:   r   r	   	add_childr   r;   r<   r=   r>   r?   r   rO   rJ   rK   
isinstancestrzoom_control_position
ValueErrorrN   r"   global_switchesr   optionsobjects_to_stay_in_frontr   	tile_name)r*   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r(   r)   rM   rN   rO   rP   max_bounds_array
tile_layerr+   s                               r,   r&   Map.__init__  s   8 	
+/& #JDMJ-h7DM4  !'
!&)%	s# (3 9Cg'!34 	 * lC(()-D&#WW {  !-D).D&-h
C# 
'"&"<"<,'	

 
 68%eY''NN5!"J NN:J,@,@NA	 r.   returnc                     U R                   c@  U R                  [        5       5        U   U R                   R                  " S0 UD6nSU l         U$ U R                   R                  " S0 UD6nU$ )z,Displays the HTML Map in a Jupyter notebook.NrY   )_parentadd_tor	   _repr_html_)r*   rP   outs      r,   rk   Map._repr_html_^  s`    <<KK!,,**4V4CDL 
 ,,**4V4C
r.   delaydriversizec                    U R                   Gc  UcJ  SSKJn  UR                  R                  R                  5       nUR                  S5        UR                  US9nUc  UR                  5         O"UR                  " S/UQ76 nUR                  " U6   U R                  5       R                  5       n[        U5       nUR                  SU 35        [        R                   " U5        UR#                  SS	5      n	U	R$                  n
UR'                  5         SSS5        W
U l         U R                   $ ! , (       d  f       N!= f)
a  Export the HTML to byte representation of a PNG image.

Uses selenium to render the HTML and record a PNG. You may need to
adjust the `delay` time keyword argument if maps render without data or tiles.

Uses a headless Firefox webdriver by default, though you can provide your own.

Examples
--------
>>> m._to_png()
>>> m._to_png(time=10)  # Wait 10 seconds between render and snapshot.

Nr   )	webdriverz
--headless)ra   z
                    return [window.outerWidth - window.innerWidth + arguments[0],
                      window.outerHeight - window.innerHeight + arguments[1]];
                    zfile:///z
class namez
folium-map)rZ   seleniumrr   firefoxra   Optionsadd_argumentFirefoxfullscreen_windowexecute_scriptset_window_sizeget_rootrenderr   gettimesleepfind_elementscreenshot_as_pngquit)r*   rn   ro   rp   rr   ra   window_sizehtmlfnamedivpngs              r,   _to_pngMap._to_pngi  s   " ??"~.#++33;;=$$\2"**7*;|((*$33
  &&4==?))+D#D)U

XeW-.

5!)),E++ * "DO *)s   ;AD//
D=c                 F    U R                   (       d  gU R                  5       $ )z+Displays the PNG Map in a Jupyter notebook.N)rM   r   )r*   s    r,   
_repr_png_Map._repr_png_  s     ||~r.   c                 "   [        U R                  5       R                  5       5       n[        R                  " SU-   5        [        S5          [        R                  " S5        M  ! [         a     Of = fSSS5        g! , (       d  f       g= f)z+Display the Map in the default web browser.zfile://zWYour map should have been opened in your browser automatically.
Press ctrl+c to return.d   N)	r   r{   r|   
webbrowseropenprintr~   r   KeyboardInterrupt)r*   r   s     r,   show_in_browserMap.show_in_browser  so     6 6 89UOOI-.,
JJsO $  :99s)   %B A''
A41B 3A44B  
Bboundspadding_top_leftpadding_bottom_rightpaddingc           
      <    U R                  [        UUUUUS95        g)a  Fit the map to contain a bounding box with the
maximum zoom level possible.

Parameters
----------
bounds: list of (latitude, longitude) points
    Bounding box specified as two points [southwest, northeast]
padding_top_left: (x, y) point, default None
    Padding in the top left corner. Useful if some elements in
    the corner, such as controls, might obscure objects you're zooming
    to.
padding_bottom_right: (x, y) point, default None
    Padding in the bottom right corner.
padding: (x, y) point, default None
    Equivalent to setting both top left and bottom right padding to
    the same value.
max_zoom: int, default None
    Maximum zoom to be used.

Examples
--------
>>> m.fit_bounds([[52.193636, -2.221575], [52.636878, -1.139759]])

)r   r   r   rC   N)r[   r   )r*   r   r   r   r   rC   s         r,   
fit_boundsMap.fit_bounds  s(    @ 	!1%9!	
r.   argsc                 L    U H  nU R                   R                  U5        M      g)a@  Pass one or multiple layers that must stay in front.

The ordering matters, the last one is put on top.

Parameters
----------
*args :
    Variable length argument list. Any folium object that counts as an
    overlay. For example FeatureGroup or TileLayer.
    Does not work with markers, for those use z_index_offset.
N)rb   append)r*   r   objs      r,   keep_in_frontMap.keep_in_front  s"     C))005 r.   )r'   ri   rZ   rK   rJ   rO   r`   r<   r=   r:   rb   ra   rM   r?   r>   r;   rN   r^   )N100%r   0%r   relativeOpenStreetMapNNN
   iZ   iL   FEPSG3857FFFFFT1rem)   NN)rg   N)NNNN)!r/   r0   r1   r2   __doc__r   r3   _default_js
default_js_default_cssdefault_cssr   r   floatr   r]   r   intboolr   r&   rk   r   bytesr   r   r   r   r   r   r   r4   r5   r6   s   @r,   r8   r8   R   s   _B I	KI\ JK /3#)$*"&!%"-<""&"& ## !)-3WB8E?+WB S%Z WB c5j!	WB
 CJWB 3:WB WB S)T)*WB smWB 3-WB 3-WB WB WB WB WB  !WB" #WB$ %WB& 'WB( )WB* +WB, -WB. /WB0 D#I&1WB2 3WB4  5WB WBr	s 	 SW--&)-8@#8O-	-^HUO $ 7;:>-1"&(
(
 #8E?3(
 'x7	(

 (5/*(
 3-(
 
(
T65 6T 6 6r.   r8   )"r   r~   r   typingr   r   r   r   r   branca.elementr   r	   folium.elementsr
   
folium.mapr   r   r   folium.raster_layersr   folium.templater   folium.utilitiesr   r   r   r   r   r   r   r   r   r"   r8   rY   r.   r,   <module>r      sc   
   7 7 * & 0 0 * $  4%W %"T6*g T6r.   