bokeh.tile_providers#
Pre-configured tile sources for common third party tile services.
- get_provider(provider_name: str | Vendors | xyzservices.TileProvider)#
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.- Parameters:
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. Usexyzservices.TileProvider
to pass custom tile providers.- Returns:
The desired tile provider instance.
- Return type:
WMTSTileProviderSource
- Raises:
ValueError – if the specified provider can not be found.
Example
>>> 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'>
The available built-in tile providers are listed in the Vendors
enum:
- Vendors = Enumeration(CARTODBPOSITRON, CARTODBPOSITRON_RETINA, STAMEN_TERRAIN, STAMEN_TERRAIN_RETINA, STAMEN_TONER, STAMEN_TONER_BACKGROUND, STAMEN_TONER_LABELS, OSM, ESRI_IMAGERY)
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
CARTODBPOSITRON_RETINA#
Tile Source for CartoDB Tile Service (tiles at ‘retina’ resolution)
ESRI_IMAGERY#
Tile Source for ESRI public tiles.
OSM#
Tile Source for Open Street Maps.