lets_plot.maptiles_zxy#

lets_plot.maptiles_zxy(url: str, attribution: str | None = None, min_zoom: int | None = None, max_zoom: int | None = None, subdomains: str | None = None, **other_args) dict#

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

Parameters:
urlstr

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.

attributionstr

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_zoomint

Minimal zoom limit, an integer from 1 to 15. Should be less than or equal to max_zoom.

max_zoomint

Maximal zoom limit, an integer from 1 to 15. Should be greater than or equal to min_zoom.

subdomainsstr

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:
dict

Tile provider settings.

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)