DataSource#
Superclasses: Object
Subclasses: TileDownloader
The base class used to retrieve tiles as Bytes.
Methods#
- class DataSource
- do_get_tile_data_async(self, x: int, y: int, zoom_level: int, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
- Parameters:
- x 
- y 
- zoom_level 
- cancellable 
- callback 
- user_data 
 
 
 - do_get_tile_data_finish(self, result: AsyncResult) Bytes | None#
- Parameters:
- result 
 
 - do_start_request(self, x: int, y: int, zoom_level: int, cancellable: Cancellable | None = None) DataSourceRequest#
- Parameters:
- x 
- y 
- zoom_level 
- cancellable 
 
 
 - async get_tile_data_async(self, x: int, y: int, zoom_level: int) Bytes | None#
- This is the awaitable version of - get_tile_data_async().- Parameters:
- x – the X coordinate to fetch 
- y – the Y coordinate to fetch 
- zoom_level – the Z coordinate to fetch 
 
 
 - get_tile_data_async(x: int, y: int, zoom_level: int, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
- Gets the data for the tile at the given coordinates. - Some data sources may return data multiple times. For example, - TileDownloadermay return data from a cache, then return updated data from the network.- received_datais emitted each time data is received, then- callbackis called after the last update.- Parameters:
- x – the X coordinate to fetch 
- y – the Y coordinate to fetch 
- zoom_level – the Z coordinate to fetch 
- cancellable – a - Cancellable
- callback – a - AsyncReadyCallbackto execute upon completion
- user_data – closure data for - callback
 
 
 - get_tile_data_finish(result: AsyncResult) Bytes | None#
- Gets the final result of a request started with - get_tile_data_async().- Parameters:
- result – a - AsyncResultprovided to callback
 
 - set_max_zoom_level(zoom_level: int) None#
- Sets the data source’s maximum zoom level. - Added in version 1.1. - Parameters:
- zoom_level – the maximum zoom level 
 
 - set_min_zoom_level(zoom_level: int) None#
- Sets the data source’s minimum zoom level. - Added in version 1.1. - Parameters:
- zoom_level – the minimum zoom level 
 
 - start_request(x: int, y: int, zoom_level: int, cancellable: Cancellable | None = None) DataSourceRequest#
- Begins a request for a tile. - Added in version 1.1. - Parameters:
- x – X coordinate to request 
- y – Y coordinate to request 
- zoom_level – zoom level to request 
- cancellable – for cancelling the request 
 
 
 
Properties#
Signals#
- class DataSource.signals
- received_data(x: int, y: int, zoom_level: int, bytes: Bytes) None#
- The type of the None singleton. - Deprecated since version 1.1: Use - start_requestand connect to the notify signals of the resulting- DataSourceRequest.- Parameters:
- x – the X coordinate of the tile 
- y – the Y coordinate of the tile 
- zoom_level – the zoom level of the tile 
- bytes – the received data 
 
 
 
Virtual Methods#
- class DataSource
- do_get_tile_data_async(x: int, y: int, zoom_level: int, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
- Gets the data for the tile at the given coordinates. - Some data sources may return data multiple times. For example, - TileDownloadermay return data from a cache, then return updated data from the network.- received_datais emitted each time data is received, then- callbackis called after the last update.- Parameters:
- x – the X coordinate to fetch 
- y – the Y coordinate to fetch 
- zoom_level – the Z coordinate to fetch 
- cancellable – a - Cancellable
- callback – a - AsyncReadyCallbackto execute upon completion
- user_data – closure data for - callback
 
 
 - do_get_tile_data_finish(result: AsyncResult) Bytes | None#
- Gets the final result of a request started with - get_tile_data_async().- Parameters:
- result – a - AsyncResultprovided to callback
 
 - do_start_request(x: int, y: int, zoom_level: int, cancellable: Cancellable | None = None) DataSourceRequest#
- Begins a request for a tile. - Added in version 1.1. - Parameters:
- x – X coordinate to request 
- y – Y coordinate to request 
- zoom_level – zoom level to request 
- cancellable – for cancelling the request 
 
 
 
Fields#
- class DataSource
- parent_instance#