
    -e!                        d Z ddlmZ ddlZ ej        e          ZddlZddlZddl	Z	ddl
mZ ddlmZ  G d dej                  Z ed	          Ze e_         d
e_        eej        d	<   [[[dS )a	   Pre-configured tile sources for common third party tile services.

.. autofunction:: bokeh.tile_providers.get_provider

The available built-in tile providers are listed in the ``Vendors`` enum:

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

.. warning::
    The built-in Vendors are deprecated as of Bokeh 3.0.0 and will be removed in a future
    release. You can pass the same strings to ``add_tile`` directly.

Any of these values may be be passed to the ``get_provider`` function in order
to obtain a tile provider to use with a Bokeh plot. Representative samples of
each tile provider are shown below.

CARTODBPOSITRON
---------------

Tile Source for CartoDB Tile Service

.. 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)

.. raw:: html

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

ESRI_IMAGERY
------------

Tile Source for ESRI public tiles.

.. raw:: html

    <img src="https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/14/6331/2627.jpg" />

OSM
---

Tile Source for Open Street Maps.

.. raw:: html

    <img src="https://c.tile.openstreetmap.org/14/2627/6331.png" />

STAMEN_TERRAIN
--------------

Tile Source for Stamen Terrain Service

.. raw:: html

    <img src="https://stamen-tiles.a.ssl.fastly.net/terrain/14/2627/6331.png" />

STAMEN_TERRAIN_RETINA
---------------------

Tile Source for Stamen Terrain Service (tiles at 'retina' resolution)

.. raw:: html

    <img src="https://stamen-tiles.a.ssl.fastly.net/terrain/14/2627/6331@2x.png" />

STAMEN_TONER
------------

Tile Source for Stamen Toner Service

.. raw:: html

    <img src="https://stamen-tiles.a.ssl.fastly.net/toner/14/2627/6331.png" />

STAMEN_TONER_BACKGROUND
-----------------------

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

.. raw:: html

    <img src="https://stamen-tiles.a.ssl.fastly.net/toner-background/14/2627/6331.png" />

STAMEN_TONER_LABELS
-------------------

Tile Source for Stamen Toner Service which includes only labels

.. raw:: html

    <img src="https://stamen-tiles.a.ssl.fastly.net/toner-labels/14/2627/6331.png" />

    )annotationsN)enumeration   )
deprecatedc                      e Zd Zd Z e            ZddZej        Zej        Zej        Zej	        Z	ej
        Z
ej        Zej        Zej        Zej        ZdS )_TileProvidersModulec                 V    t          ddd           t          dddddd	d
ddd
  
        S )N   r   r   ztile_providers moduleadd_tile directlyCARTODBPOSITRONCARTODBPOSITRON_RETINASTAMEN_TERRAINSTAMEN_TERRAIN_RETINASTAMEN_TONERSTAMEN_TONER_BACKGROUNDSTAMEN_TONER_LABELSOSMESRI_IMAGERYT)case_sensitive)r   r        4lib/python3.11/site-packages/bokeh/tile_providers.pydeprecated_vendorsz'_TileProvidersModule.deprecated_vendors   sI    957JKKK,.F,.E~57L!>+/	1 1 1 	1r   provider_name(str | Vendors | xyzservices.TileProviderc           	     V   t          ddd           ddlm} t          ||          r ||j        |j                  S t          |t                    ri|                                }|dk    rd}|d	k    rd
}d|v r|                    dd          }d}nd}|rdnd}t          j
                            |          }nd}t          |t          j                  rP ||                    |          |j        |                    dd          |                    dd                    S dS )aF  Use this function to retrieve an instance of a predefined tile provider.

        .. warning::
            get_provider is deprecated as of Bokeh 3.0.0 and will be removed in a future
            release. Use ``add_tile`` directly instead.

        Args:
            provider_name (Union[str, Vendors, xyzservices.TileProvider]):
                Name of the tile provider to supply.

                Use a ``tile_providers.Vendors`` enumeration value, or the string
                name of one of the known providers. Use
                :class:`xyzservices.TileProvider` to pass custom tile providers.

        Returns:
            WMTSTileProviderSource: The desired tile provider instance.

        Raises:
            ValueError: if the specified 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'>

                    >>> import xyzservices.providers as xyz
                    >>> get_provider(xyz.CartoDB.Positron)
                    <class 'bokeh.models.tiles.WMTSTileSource'>
        r
   get_providerr   r   )WMTSTileSource)urlattributionesri_imageryesri_worldimageryosmopenstreetmap_mapnikretina TFz@2xN)scale_factormin_zoommax_zoom   )r    r!   r)   r*   )r   bokeh.modelsr   
isinstancer    r!   strlowerreplacexyzservices	providers
query_nameTileProvider	build_urlhtml_attributionget)selfr   r   r&   r(   s        r   r   z!_TileProvidersModule.get_provider   sj   F 	9n.ABBB//////m^44 	`!>m&7]E^____mS)) 	 )//11M.. 3%% 6=(( - 5 5h C C$*455L'1<<]KKMMLm[%=>> 	!>!+++FF):&**:q99&**:r::	   	 	r   N)r   r   )__name__
__module____qualname__r   Vendorsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s        1 1 1 ! ""GC C C CP -O$;+N#9'L%=!5
+C'LLLr   r   zbokeh.tile_providers)r   r   r   r   r   r   r   r   r   r   r<   )__doc__
__future__r   logging	getLoggerr9   logsystypesr1   bokeh.core.enumsr   util.deprecationr   
ModuleTyper   _mod__all__modulesr   r   r   <module>rJ      s   c cP # " " " " " g!! 


      ) ( ( ( ( ( ) ( ( ( ( (&\( \( \( \( \(5+ \( \( \(D 233 '+" ##uuur   