
    -e                    v   d Z ddlmZ ddlZ ej        e          ZddlmZ ddl	m
Z
 ddlmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZ dd	lmZmZmZ dd
lm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& dZ'e
 G d de"                      Z(e
 G d de&                      Z) G d de(          Z* G d de)          Z+dS )z- Models for displaying maps in Bokeh plots.

    )annotationsN   )MapType)abstract)JSONBoolBytesEnumFloatInstanceInstanceDefaultIntNullableOverrideRequiredString)errorwarning)INCOMPATIBLE_MAP_RANGE_TYPEMISSING_GOOGLE_API_KEYREQUIRED_RANGE)MISSING_RENDERERS)ModelRange1d   )Plot)GMapOptionsGMapPlot
MapOptionsMapPlotc                  r     e Zd ZdZd
 fdZ eed          Z eed          Z e	dd	          Z
 xZS )r    z3 Abstract base class for map options' models.

    returnNonec                :     t                      j        |i | d S Nsuper__init__selfargskwargs	__class__s      6lib/python3.11/site-packages/bokeh/models/map_plots.pyr)   zMapOptions.__init__E   %    $)&)))))    z8
    The latitude where the map should be centered.
    helpz9
    The longitude where the map should be centered.
       z@
    The initial zoom level to use when displaying the map.
    r#   r$   )__name__
__module____qualname____doc__r)   r   r   latlngr   zoom__classcell__r.   s   @r/   r    r    >   s         
* * * * * * (5   	 	 	C (5   	 	 	C 3r  	 	 	DDDDDr1   r    c                  L     e Zd ZdZd fdZ ee          d             Z xZS )r!   z/ Abstract base class for map plot models.

    r#   r$   c                    ddl m} dD ]<}||v r6t          |                    |          |          st	          d|d          = t                      j        |i | d S )Nr   r   )x_rangey_rangezInvalid value for z5, MapPlot ranges may only be Range1d, not data ranges)models.rangesr   
isinstanceget
ValueErrorr(   r)   )r+   r,   r-   r   rr.   s        r/   r)   zMapPlot.__init__Z   s    ++++++' 	r 	rAF{{:fjjmmW#E#E{ !pa!p!p!pqqq$)&)))))r1   c                    ddl m} | j        't          | j        |          sdt	          |           z  S | j        't          | j        |          sdt	          |           z  S d S d S )Nr   r   z
%s.x_rangez
%s.y_range)rC   r   rA   rD   strrB   )r+   r   s     r/   "_check_incompatible_map_range_typez*MapPlot._check_incompatible_map_range_typea   sv    ++++++<#Jt|W,M,M##d))++<#Jt|W,M,M##d))++ $###r1   r5   )	r6   r7   r8   r9   r)   r   r   rJ   r=   r>   s   @r/   r!   r!   T   sn         * * * * * * U&'', , (', , , , ,r1   r!   c                       e Zd ZdZd fdZ eedd          Z edd	          Z	 e
ed
d          Z edd          Z xZS )r   z( Options for ``GMapPlot`` objects.

    r#   r$   c                :     t                      j        |i | d S r&   r'   r*   s      r/   r)   zGMapOptions.__init__o   r0   r1   roadmapz
    The `map type`_ to use for the ``GMapPlot``.

    .. _map type: https://developers.google.com/maps/documentation/javascript/reference#MapTypeId

    defaultr3   FzK
    Whether the Google map should display its distance scale control.
    Na	  
    A JSON array of `map styles`_ to use for the ``GMapPlot``. Many example styles can
    `be found here`_.

    .. _map styles: https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyle
    .. _be found here: https://snazzymaps.com

    -   a  
    `Tilt`_ angle of the map. The only allowed values are 0 and 45.
    Only has an effect on 'satellite' and 'hybrid' map types.
    A value of 0 causes the map to always use a 0 degree overhead view.
    A value of 45 causes the tilt angle to switch to 45 imagery if available.

    .. _Tilt: https://developers.google.com/maps/documentation/javascript/reference/3/map#MapOptions.tilt

    r5   )r6   r7   r8   r9   r)   r
   r   map_typer   scale_controlr   r   stylesr   tiltr=   r>   s   @r/   r   r   i   s         
* * * * * * tGY 6 	 	 	H D . 	 	 	M XdD 0 	 	 	F 3r ! 	 	 	DDDDDr1   r   c                      e Zd ZdZd fdZ ee          d             Z ee	          d             Z
 ee          d             Z eed	          Z ed
          Z ed          Z eed	                              ed           Z edd          Z e ee                    Z e ee                    Z xZS )r   an   A Bokeh Plot with a `Google Map`_ displayed underneath.

    Data placed on this plot should be specified in decimal lat/lon coordinates
    e.g. ``(37.123, -122.404)``. It will be automatically converted into the
    web mercator projection to display properly over google maps tiles.

    The ``api_key`` property must be configured with a Google API Key in order
    for ``GMapPlot`` to function. The key will be stored in the Bokeh Document
    JSON.

    Note that Google Maps exert explicit control over aspect ratios at all
    times, which imposes some limitations on ``GMapPlot``:

    * Only ``Range1d`` ranges are supported. Attempting to use other range
      types will result in an error.

    * Usage of ``BoxZoomTool`` is incompatible with ``GMapPlot``. Adding a
      ``BoxZoomTool`` will have no effect.

    .. _Google Map: https://www.google.com/maps/

    r#   r$   c                :     t                      j        |i | d S r&   r'   r*   s      r/   r)   zGMapPlot.__init__   r0   r1   c                    d S r&    r+   s    r/   _check_required_rangezGMapPlot._check_required_range       r1   c                    d S r&   rX   rY   s    r/   _check_missing_renderersz!GMapPlot._check_missing_renderers   r[   r1   c                2    | j         t          |           S d S r&   )api_keyrI   rY   s    r/   _check_missing_google_api_keyz&GMapPlot._check_missing_google_api_key   s    <t99  r1   z*
    Options for displaying the plot.
    r2   z#ffffff)rO   g        z
    Google Maps API requires an API key. See https://developers.google.com/maps/documentation/javascript/get-api-key
    for more information on how to obtain your own.
    c                ,    |                      d          S )Nzutf-8)encode)vals    r/   <lambda>zGMapPlot.<lambda>   s    SZZ%8%8 r1   weeklyz
    The version of Google Maps API to use. See https://developers.google.com/maps/documentation/javascript/versions
    for more information.

    .. note::
        Changing this value may result in broken map rendering.

    rN   r5   )r6   r7   r8   r9   r)   r   r   rZ   r   r   r]   r   r`   r   r   map_optionsr   border_fill_colorbackground_fill_alphar   r	   acceptsr   r_   api_versionr   r   rA   rB   r=   r>   s   @r/   r   r      s        0* * * * * * U>   W    U!""  #" (; . 	 	 	K !333$HS111hu $ 	 	 	 
88	9	9 
 & 1 	 	 	K hw77888Ghw77888GGGGGr1   r   ),r9   
__future__r   logging	getLoggerr6   log
core.enumsr   core.has_propsr   core.propertiesr   r   r	   r
   r   r   r   r   r   r   r   r   core.validationr   r   core.validation.errorsr   r   r   core.validation.warningsr   modelr   rC   r   plotsr   __all__r    r!   r   r   rX   r1   r/   <module>rx      sL    # " " " " " g!! !           % % % % % %                            - , , , , , , , h h h h h h h h h h 8 8 8 8 8 8       # # # # # #       
	 	 	 	 	 	 	 
	* 
, , , , ,d , , 
,(%	 %	 %	 %	 %	* %	 %	 %	NB9 B9 B9 B9 B9w B9 B9 B9 B9 B9r1   