ó
mÜJ]c           @` s}  d  Z  d d l m Z m Z m Z 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 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 d e! f d „  ƒ  Yƒ Z' e d e% f d „  ƒ  Yƒ Z( d e' f d „  ƒ  YZ) d e( f d „  ƒ  YZ* d S(   u-    Models for displaying maps in Bokeh plots.

i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsNi   (   t   MapType(   t   abstract(   t   Boolt   Enumt   Floatt   Instancet   Intt   JSONt   Overridet   String(   t   errort   warning(   t   MISSING_RENDERERS(   t   INCOMPATIBLE_MAP_RANGE_TYPEt   REQUIRED_RANGEt   MISSING_GOOGLE_API_KEY(   t   Model(   t   Range1di   (   t   Plotu   GMapOptionsu   GMapPlotu
   MapOptionsu   MapPlott
   MapOptionsc           B` s>   e  Z d  Z e d d ƒ Z e d d ƒ Z e d d d ƒZ RS(   u3    Abstract base class for map options' models.

    t   helpu8   
    The latitude where the map should be centered.
    u9   
    The longitude where the map should be centered.
    i   u@   
    The initial zoom level to use when displaying the map.
    (   t   __name__t
   __module__t   __doc__R   t   latt   lngR
   t   zoom(    (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyR   5   s   			t   MapPlotc           B` s,   e  Z d  Z d „  Z e e ƒ d „  ƒ Z RS(   u/    Abstract base class for map plot models.

    c         O` sv   d d l  m } xF d D]> } | | k r t | j | ƒ | ƒ r t d | ƒ ‚ q q Wt t |  ƒ j | | Ž  d  S(   Ni   (   R   u   x_rangeu   y_rangeuI   Invalid value for %r, MapPlot ranges may only be Range1d, not data ranges(   u   x_rangeu   y_range(   t   models.rangesR   t
   isinstancet   gett
   ValueErrort   superR   t   __init__(   t   selft   argst   kwR   t   r(    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyR%   M   s
    %c         C` st   d d l  m } |  j d  k	 r@ t |  j | ƒ r@ d t |  ƒ S|  j d  k	 rp t |  j | ƒ rp d t |  ƒ Sd  S(   Ni   (   R   u
   %s.x_rangeu
   %s.y_range(   R    R   t   x_ranget   NoneR!   t   strt   y_range(   R&   R   (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyt"   _check_incompatible_map_range_typeT   s
    ""(   R   R   R   R%   R   R   R.   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyR   G   s   	t   GMapOptionsc           B` s_   e  Z d  Z e e d d d d ƒZ e d e d d ƒ Z e	 d d ƒ Z
 e d d d d ƒ Z RS(	   u(    Options for ``GMapPlot`` objects.

    t   defaultu   roadmapR   uš   
    The `map type`_ to use for the ``GMapPlot``.

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

    uK   
    Whether the Google map should display its distance scale control.
    u	  
    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

    i-   u‰  
    `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

    (   R   R   R   R   R   t   map_typeR   t   Falset   scale_controlR   t   stylesR
   t   tilt(    (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyR/   \   s   			t   GMapPlotc           B` s¡   e  Z d  Z e e ƒ d „  ƒ Z e e ƒ d „  ƒ Z e e	 ƒ d „  ƒ Z
 e e d d ƒZ e d d ƒ Z e d d ƒ Z e d d	 „  ƒ Z e d d
 „  ƒ Z RS(   uÅ   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.

    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/

    c         C` s   d  S(   N(    (   R&   (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyt   _check_required_range”   s    c         C` s   d  S(   N(    (   R&   (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyt   _check_missing_renderers˜   s    c         C` s   |  j  d  k r t |  ƒ Sd  S(   N(   t   api_keyR+   R,   (   R&   (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyt   _check_missing_google_api_keyœ   s    R   u*   
    Options for displaying the plot.
    R0   u   #ffffffu®   
    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   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyt   <lambda>¬   t    c           C` s   t  ƒ  S(   N(   R   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyR;   ®   R<   (   R   R   R   R   R   R7   R   R   R8   R   R:   R	   R/   t   map_optionsR   t   border_fill_colorR   R9   R*   R-   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyR6      s   			(   u   GMapOptionsu   GMapPlotu
   MapOptionsu   MapPlot(+   R   t
   __future__R    R   R   R   t   loggingt	   getLoggerR   t   logt
   core.enumsR   t   core.has_propsR   t   core.propertiesR   R   R   R	   R
   R   R   R   t   core.validationR   R   t   core.validation.warningsR   t   core.validation.errorsR   R   R   t   modelR   R    R   t   plotsR   t   __all__R   R   R/   R6   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/map_plots.pyt   <module>	   s,   ":   #