B
    @\9                 @   s  d Z ddlmZmZmZmZ ddlZe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 ddlmZmZ dd	l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Z&eG dd de!Z'eG dd de%Z(G dd de'Z)G dd de(Z*dS )z- Models for displaying maps in Bokeh plots.

    )absolute_importdivisionprint_functionunicode_literalsN   )MapType)abstract)BoolEnumFloatInstanceIntJSONOverrideString)errorwarning)MISSING_RENDERERS)INCOMPATIBLE_MAP_RANGE_TYPEREQUIRED_RANGEMISSING_GOOGLE_API_KEY)Model)Range1d   )Plot)GMapOptionsGMapPlot
MapOptionsMapPlotc               @   s0   e Zd ZdZeddZeddZedddZdS )r   z3 Abstract base class for map options' models.

    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.
    N)	__name__
__module____qualname____doc__r   ZlatZlngr   Zzoom r%   r%   5lib/python3.7/site-packages/bokeh/models/map_plots.pyr   5   s   r   c                   s0   e Zd ZdZ fddZeedd Z  ZS )r   z/ Abstract base class for map plot models.

    c                sT   ddl m} x0dD ](}||krt|||std| qW tt| j|| d S )Nr   )r   )x_rangey_rangezIInvalid value for %r, MapPlot ranges may only be Range1d, not data ranges)models.rangesr   
isinstanceget
ValueErrorsuperr   __init__)selfargskwr   r)	__class__r%   r&   r.   M   s
    
zMapPlot.__init__c             C   sT   ddl m} | jd k	r.t| j|s.dt|  S | jd k	rPt| j|sPdt|  S d S )Nr   )r   z
%s.x_rangez
%s.y_range)r)   r   r'   r*   strr(   )r/   r   r%   r%   r&   "_check_incompatible_map_range_typeT   s
    z*MapPlot._check_incompatible_map_range_type)	r!   r"   r#   r$   r.   r   r   r5   __classcell__r%   r%   )r3   r&   r   G   s   r   c               @   s@   e Zd ZdZeedddZedddZe	ddZ
ed	d
dZdS )r   z( Options for ``GMapPlot`` objects.

    Zroadmapz
    The `map type`_ to use for the ``GMapPlot``.

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

    )defaultr   FzK
    Whether the Google map should display its distance scale control.
    a	  
    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

    )r   -   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

    N)r!   r"   r#   r$   r
   r   Zmap_typer	   Zscale_controlr   Zstylesr   Ztiltr%   r%   r%   r&   r   \   s   r   c               @   s|   e Zd ZdZeedd Zeedd Z	ee
dd Zeedd	Zed
dZedd	Zedd dZedd dZdS )r   a   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.

    Please also note that only ``Range1d`` ranges are supported by ``GMapPlot``.

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

    c             C   s   d S )Nr%   )r/   r%   r%   r&   _check_required_range   s    zGMapPlot._check_required_rangec             C   s   d S )Nr%   )r/   r%   r%   r&   _check_missing_renderers   s    z!GMapPlot._check_missing_renderersc             C   s   | j d krt| S d S )N)api_keyr4   )r/   r%   r%   r&   _check_missing_google_api_key   s    
z&GMapPlot._check_missing_google_api_keyz*
    Options for displaying the plot.
    )r   z#ffffff)r7   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               C   s   t  S )N)r   r%   r%   r%   r&   <lambda>   s    zGMapPlot.<lambda>c               C   s   t  S )N)r   r%   r%   r%   r&   r=      s    N)r!   r"   r#   r$   r   r   r9   r   r   r:   r   r<   r   r   Zmap_optionsr   Zborder_fill_colorr   r;   r'   r(   r%   r%   r%   r&   r      s   
r   )+r$   Z
__future__r   r   r   r   ZloggingZ	getLoggerr!   logZ
core.enumsr   Zcore.has_propsr   Zcore.propertiesr	   r
   r   r   r   r   r   r   Zcore.validationr   r   Zcore.validation.warningsr   Zcore.validation.errorsr   r   r   Zmodelr   r)   r   Zplotsr   __all__r   r   r   r   r%   r%   r%   r&   <module>	   s&   
(
#