
    =h.                     t    S r SSKJr  1 Skr1 Skr " S S5      r " S S\5      r " S	 S
\5      r   SS jrg)z0Performs requests to the Google Maps Static API.    )convert>   gifjpgpngpng8png32jpg-baseline>   hybridroadmapterrain	satellitec                   $    \ rS rSrSrS rS rSrg)StaticMapParam   z4Base class to handle parameters for Maps Static API.c                     / U l         g Nparamsselfs    bC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\googlemaps/maps.py__init__StaticMapParam.__init__   s	        c                 D    [         R                  " SU R                  5      $ )z^Converts a list of parameters to the format expected by
the Google Maps server.

:rtype: str

|)r   	join_listr   r   s    r   __str__StaticMapParam.__str__!   s       dkk22r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__ r   r   r   r      s    >3r   r   c                   2   ^  \ rS rSrSr SU 4S jjrSrU =r$ )StaticMapMarker+   z.Handles marker parameters for Maps Static API.c                   > [         [        U ]  5         U(       a  U R                  R	                  SU-  5        U(       a  U R                  R	                  SU-  5        U(       aw  [        U5      S:w  d?  UR                  5       (       a  UR                  5       (       a  UR                  5       (       d  [        S5      eU R                  R	                  SU-  5        U R                  R	                  [        R                  " U5      5        g)aT  
:param locations: Specifies the locations of the markers on
    the map.
:type locations: list

:param size: Specifies the size of the marker.
:type size: str

:param color: Specifies a color of the marker.
:type color: str

:param label: Specifies a single uppercase alphanumeric
    character to be displaied on marker.
:type label: str
zsize:%scolor:%s   z0Marker label must be alphanumeric and uppercase.zlabel:%sN)superr(   r   r   appendlenisalphaisupperisalnum
ValueErrorr   location_list)r   	locationssizecolorlabel	__class__s        r   r   StaticMapMarker.__init__.   s    $ 	ot-/KKy4/0KKzE125zQ5==??5==??SXS`S`SbSb !STTKKzE12700;<r   r&   )NNNr    r!   r"   r#   r$   r   r%   __classcell__r9   s   @r   r(   r(   +   s    8 /3= =r   r(   c                   4   ^  \ rS rSrSr  SU 4S jjrSrU =r$ )StaticMapPathP   z,Handles path parameters for Maps Static API.c                   > [         [        U ]  5         U(       a  U R                  R	                  SU-  5        U(       a  U R                  R	                  SU-  5        U(       a  U R                  R	                  SU-  5        U(       a  U R                  R	                  SU-  5        U R                  R	                  [
        R                  " U5      5        g)a@  
:param points: Specifies the point through which the path
    will be built.
:type points: list

:param weight: Specifies the thickness of the path in pixels.
:type weight: int

:param color: Specifies a color of the path.
:type color: str

:param fillcolor: Indicates both that the path marks off a
    polygonal area and specifies the fill color to use as an
    overlay within that area.
:type fillcolor: str

:param geodesic: Indicates that the requested path should be
    interpreted as a geodesic line that follows the curvature
    of the earth.
:type geodesic: bool
z	weight:%sr+   zfillcolor:%szgeodesic:%sN)r-   r?   r   r   r.   r   r4   )r   pointsweightr7   	fillcolorgeodesicr9   s         r   r   StaticMapPath.__init__S   s    2 	mT+-KK{V34KKzE12KK~	9:KK}x7870089r   r&   )NNNNr;   r=   s   @r   r?   r?   P   s    6 %)*.': ':r   r?   Nc                 h   S[         R                  " U5      0nU	(       d  U(       d  Uc  [        S5      eU(       a  [         R                  " U5      US'   Ub  X=S'   Ub  XMS'   U(       a  U[        ;  a  [        S5      eX]S'   U(       a  U[
        ;  a  [        S5      eXmS	'   U(       a  X}S
'   U(       a  XS'   U	(       a  XS'   U
(       a  XS'   U(       a  [         R                  " U5      US'   U(       a  [         R                  " U5      US'   U R                  SUS SS0S9nUR                  5       $ )a;  
Downloads a map image from the Maps Static API.

See https://developers.google.com/maps/documentation/maps-static/intro
for more info, including more detail for each parameter below.

:param size: Defines the rectangular dimensions of the map image.
:type param: int or list

:param center: Defines the center of the map, equidistant from all edges
    of the map.
:type center: dict or list or string

:param zoom: Defines the zoom level of the map, which determines the
    magnification level of the map.
:type zoom: int

:param scale: Affects the number of pixels that are returned.
:type scale: int

:param format: Defines the format of the resulting image.
:type format: string

:param maptype: defines the type of map to construct. There are several
    possible maptype values, including roadmap, satellite, hybrid,
    and terrain.
:type maptype: string

:param language: defines the language to use for display of labels on
    map tiles.
:type language: string

:param region: defines the appropriate borders to display, based on
    geo-political sensitivities.
:type region: string

:param markers: define one or more markers to attach to the image at
    specified locations.
:type markers: StaticMapMarker

:param path: defines a single path of two or more connected points to
    overlay on the image at specified locations.
:type path: StaticMapPath

:param visible: specifies one or more locations that should remain visible
    on the map, though no markers or other indicators will be displayed.
:type visible: list of dict

:param style: defines a custom style to alter the presentation of
    a specific feature (roads, parks, and other features) of the map.
:type style: list of dict

:rtype: iterator containing the raw image data, which typically can be
    used to save an image file locally. For example:

    ```
    f = open(local_filename, 'wb')
    for chunk in client.static_map(size=(400, 400),
                                   center=(52.520103, 13.404871),
                                   zoom=15):
        if chunk:
            f.write(chunk)
    f.close()
    ```
r6   z=both center and zoom are requiredwhen markers is not specifedcenterzoomscalezInvalid image formatformatzInvalid maptypemaptypelanguageregionmarkerspathvisiblestylez/maps/api/staticmapc                     U $ r   r&   )responses    r   <lambda>static_map.<locals>.<lambda>   s    hr   streamT)extract_bodyrequests_kwargs)
r   r6   r3   latlngMAPS_IMAGE_FORMATSMAPS_MAP_TYPESr4   
components_requestiter_content)clientr6   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   r   rT   s                  r   
static_mapra   }   s5   L gll4()F$*/ 
 ">>&1xvw++455!x.(.//#y%z!x#yv#11':y!,,U3w.!4(	  H   ""r   )NNNNNNNNNNN)	r$   
googlemapsr   r[   r\   r   r(   r?   ra   r&   r   r   <module>rc      sP   $ 7  L >3 3 "=n "=J*:N *:\ .2@D<@z#r   