Shumate.TileDownloader

g GObject.Object GObject.Object Shumate.DataSource Shumate.DataSource GObject.Object->Shumate.DataSource Shumate.TileDownloader Shumate.TileDownloader Shumate.DataSource->Shumate.TileDownloader

Subclasses:

None

Methods

Inherited:

Shumate.DataSource (7), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (url_template)

Virtual Methods

Inherited:

Shumate.DataSource (3), GObject.Object (7)

Properties

Inherited:

Shumate.DataSource (2)

Name

Type

Flags

Short Description

url-template

str

r/w/co

URL template

Signals

Inherited:

Shumate.DataSource (1), GObject.Object (1)

Fields

Inherited:

Shumate.DataSource (1), GObject.Object (1)

Class Details

class Shumate.TileDownloader(**kwargs)
Bases:

Shumate.DataSource

Abstract:

No

Structure:

Shumate.TileDownloaderClass

A [class`DataSource`] that asynchronously downloads tiles from an online service using a given template.

It contains an internal [class`FileCache`] to cache the tiles on the system.

classmethod new(url_template)
Parameters:

url_template (str) – a URL template to fetch tiles from

Returns:

a newly constructed [class`TileDownloader`]

Return type:

Shumate.TileDownloader

Creates a new [class`TileDownloader`] that fetches tiles from an API and caches them on disk.

See [property`TileDownloader`:py:data::url-template<Shumate.TileDownloader.props.url_template>] for the format of the URL template.

Property Details

Shumate.TileDownloader.props.url_template
Name:

url-template

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

A template for construting the URL to download a tile from.

The template has the following replacements:

  • “{x}”: The X coordinate of the tile

  • “{y}”: The Y coordinate of the tile

  • “{z}”: The zoom level of the tile

  • “{tmsy}”: The inverted Y coordinate (i.e. tile numbering starts with 0 at the bottom, rather than top, of the map)