lets_plot.maptiles_zxy

lets_plot.maptiles_zxy(url: str, attribution: Optional[str] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, subdomains: Optional[str] = None, **other_args) dict

Makes raster tiles config. Can be used individually in geom_livemap() or in every livemap via LetsPlot.set().

Parameters
  • url (str) – Template for a standard raster ZXY tile provider with {z}, {x}, {y} and {s} placeholders, e.g. "https://{s}.tile.com/{z}/{x}/{y}.png". Where {z} means zoom, {x} and {y} means tile coordinate, {s} means subdomains.

  • attribution (str) – An attribution or a copyright notice to display on the map as required by the tile license. Supports HTML links: '<a href="http://www.example.com">Example</a>'.

  • min_zoom (int) – Minimal zoom limit.

  • max_zoom (int) – Maximal zoom limit.

  • subdomains (str) – Each character of this list is interpreted as standalone tile servers, so an interactive map can request tiles from any of these servers independently for better load balance. If url contains {s} placeholder and subdomains parameter is not set default string ‘abc’ will be used.

  • other_args – Any key-value pairs that can be substituted into the URL template, e.g. maptiles_zxy(url='http://maps.example.com/{z}/{x}/{y}.png?access_key={key}', key='MY_ACCESS_KEY').

Returns

Tile provider settings.

Return type

dict

Examples

1from lets_plot import *
2LetsPlot.setup_html()
3tiles = maptiles_zxy(
4    url="https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_CityLights_2012/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpg",
5    attribution='<a href="https://earthdata.nasa.gov/eosdis/science-system-description/eosdis-components/gibs">© NASA Global Imagery Browse Services (GIBS)</a>',
6    max_zoom=8
7)
8ggplot() + geom_livemap(tiles=tiles)