σ
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
 Z
 d d l Z d d l m Z d   Z d e j f d     YZ e e d   Z e  e _  d e _ e e
 j d <[ [
 [ [ d S(   uδ   Pre-configured tile sources for common third party tile services.


Attributes:

    .. bokeh-enum:: Vendors
        :module: bokeh.tile_providers

    get_provider
        Use this function to retrieve an instance of a predefined tile provider.

        Args:
            provider_name (Union[str, Vendors])
                Name of the tile provider to supply.
                Use tile_providers.Vendors enum, or the name of a provider as string

        Returns:
            WMTSTileProviderSource: The desired tile provider instance

        Raises:
            ValueError, if the provider can not be found
            ValueError, if the attribution for that provider can not be found


        Example:

            .. code-block:: python

                    >>> from bokeh.tile_providers import get_provider, Vendors
                    >>> get_provider(Vendors.CARTODBPOSITRON)
                    <class 'bokeh.models.tiles.WMTSTileSource'>
                    >>> get_provider('CARTODBPOSITRON')
                    <class 'bokeh.models.tiles.WMTSTileSource'>


    CARTODBPOSITRON
        Tile Source for CartoDB Tile Service

        Warns:
            BokehDeprecationWarning: Deprecated in bokeh 1.1.0. Use get_provider instead

        .. raw:: html

            <img src="https://tiles.basemaps.cartocdn.com/light_all/14/2627/6331.png" />

    CARTODBPOSITRON_RETINA
        Tile Source for CartoDB Tile Service (tiles at 'retina' resolution)

        Warns:
            BokehDeprecationWarning: Deprecated in bokeh 1.1.0. Use get_provider instead

        .. raw:: html

            <img src="https://tiles.basemaps.cartocdn.com/light_all/14/2627/6331@2x.png" />

    STAMEN_TERRAIN
        Tile Source for Stamen Terrain Service

        Warns:
            BokehDeprecationWarning: Deprecated in bokeh 1.1.0. Use get_provider instead

        .. raw:: html

            <img src="http://c.tile.stamen.com/terrain/14/2627/6331.png" />

    STAMEN_TERRAIN_RETINA
        Tile Source for Stamen Terrain Service

        Warns:
            BokehDeprecationWarning: Deprecated in bokeh 1.1.0. Use get_provider instead

        .. raw:: html

            <img src="http://c.tile.stamen.com/terrain/14/2627/6331@2x.png" />

    STAMEN_TONER
        Tile Source for Stamen Toner Service

        Warns:
            BokehDeprecationWarning: Deprecated in bokeh 1.1.0. Use get_provider instead

        .. raw:: html

            <img src="http://c.tile.stamen.com/toner/14/2627/6331.png" />

    STAMEN_TONER_BACKGROUND
        Tile Source for Stamen Toner Background Service which does not include labels

        Warns:
            BokehDeprecationWarning: Deprecated in bokeh 1.1.0. Use get_provider instead

        .. raw:: html

            <img src="http://c.tile.stamen.com/toner-background/14/2627/6331.png" />

    STAMEN_TONER_LABELS
        Tile Source for Stamen Toner Service which includes only labels

        Warns:
            BokehDeprecationWarning: Deprecated in bokeh 1.1.0. Use get_provider instead

        .. raw:: html

            <img src="http://c.tile.stamen.com/toner-labels/14/2627/6331.png" />

Additional information available at:

* Stamen tile service - http://maps.stamen.com/
* CartoDB tile service - https://carto.com/location-data-services/basemaps/

i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   enumerationc         ` s     f d   } t  |  } | S(   Nc         ` s=   d d l  m } | d d	 d   d d    |  j d    S(
   Ni    (   t
   deprecatedt   since_or_msgi   t   oldt   newu   get_provider(Vendors.%s)t   provider_name(   i   i   i    (   t   bokeh.util.deprecationR   t   get_provider(   t   selfR   (   t   name(    s3   lib/python2.7/site-packages/bokeh/tile_providers.pyt   deprecated_property_tile£   s    (   t   property(   R   R   t   func(    (   R   s3   lib/python2.7/site-packages/bokeh/tile_providers.pyt   _make_deprecated_property‘   s    t   _TileProvidersModulec           B` s  e  Z d  Z d Z e d d d d d d d d	 d
 d d d d d  Z e d d d d d
 d d d d d  Z e d d d d d d d d e Z	 d   Z
 e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z RS(   u   &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors,&copy; <a href="https://cartodb.com/attributions">CartoDB</a>uΠ   Map tiles by <a href="https://stamen.com">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="https://openstreetmap.org">OpenStreetMap</a>, under %s.t   CARTODBPOSITRONu=   https://tiles.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.pngt   CARTODBPOSITRON_RETINAu@   https://tiles.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.pngt   STAMEN_TERRAINu.   http://tile.stamen.com/terrain/{Z}/{X}/{Y}.pngt   STAMEN_TERRAIN_RETINAu1   http://tile.stamen.com/terrain/{Z}/{X}/{Y}@2x.pngt   STAMEN_TONERu,   http://tile.stamen.com/toner/{Z}/{X}/{Y}.pngt   STAMEN_TONER_BACKGROUNDu7   http://tile.stamen.com/toner-background/{Z}/{X}/{Y}.pngt   STAMEN_TONER_LABELSu3   http://tile.stamen.com/toner-labels/{Z}/{X}/{Y}.pnguE   <a href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>u:   <a href="https://www.openstreetmap.org/copyright">ODbL</a>u   CARTODBPOSITRONu   CARTODBPOSITRON_RETINAu   STAMEN_TERRAINu   STAMEN_TERRAIN_RETINAu   STAMEN_TONERu   STAMEN_TONER_BACKGROUNDu   STAMEN_TONER_LABELSt   case_sensitivec         C` sΧ   d d l  m } t | |  r8 | d | j d | j  S| j   } | |  j k rf t d |   n  |  j | } | j	 d  r |  j
 } n6 | j	 d  r΄ |  j |  j | } n t d |   | d | d |  S(	   Ni    (   t   WMTSTileSourcet   urlt   attributionu   Unknown tile provider %su   CARTOu   STAMENu#   Can not retrieve attribution for %s(   t   bokeh.models.tilesR   t
   isinstanceR   R   t   uppert   Vendorst
   ValueErrort   _SERVICE_URLSt
   startswitht   _CARTO_ATTRIBUTIONt   _STAMEN_ATTRIBUTIONt   _STAMEN_ATTRIBUTION_URLS(   R   R	   R   t   selected_providerR   R   (    (    s3   lib/python2.7/site-packages/bokeh/tile_providers.pyR   Ο   s    (   t   __name__t
   __module__R%   R&   t   dictR#   R'   R   t   TrueR!   R   R   R   R   R   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/bokeh/tile_providers.pyR   «   s8   							u   bokeh.tile_providersu   CARTODBPOSITRONu   CARTODBPOSITRON_RETINAu   STAMEN_TERRAINu   STAMEN_TERRAIN_RETINAu   STAMEN_TONERu   STAMEN_TONER_BACKGROUNDu   STAMEN_TONER_LABELSu   get_provideru   Vendors(	   u   CARTODBPOSITRONu   CARTODBPOSITRON_RETINAu   STAMEN_TERRAINu   STAMEN_TERRAIN_RETINAu   STAMEN_TONERu   STAMEN_TONER_BACKGROUNDu   STAMEN_TONER_LABELSu   get_provideru   Vendors(   t   __doc__t
   __future__R    R   R   R   t   loggingt	   getLoggerR)   t   logt   syst   typest   bokeh.core.enumsR   R   t
   ModuleTypeR   t   strt   _modt   __all__t   modules(    (    (    s3   lib/python2.7/site-packages/bokeh/tile_providers.pyt   <module>u   s*   "	
I	        	