:right-sidebar: True DataSource =================================================================== .. currentmodule:: gi.repository.Shumate .. class:: DataSource(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Shumate.TileDownloader` :Constructors: :: DataSource(**properties) Methods ------- .. rst-class:: interim-class .. class:: DataSource :no-index: .. method:: get_max_zoom_level() -> int Gets the data source's maximum zoom level. .. versionadded:: 1.1 .. method:: get_min_zoom_level() -> int Gets the data source's minimum zoom level. .. versionadded:: 1.1 .. method:: get_tile_data_async(x: int, y: int, zoom_level: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None Gets the data for the tile at the given coordinates. Some data sources may return data multiple times. For example, :obj:`~gi.repository.Shumate.TileDownloader` may return data from a cache, then return updated data from the network. :obj:`~gi.repository.Shumate.ShumateDataSource.signals.received_data` is emitted each time data is received, then ``callback`` is called after the last update. :param x: the X coordinate to fetch :param y: the Y coordinate to fetch :param zoom_level: the Z coordinate to fetch :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to execute upon completion :param user_data: closure data for ``callback`` .. method:: get_tile_data_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.GLib.Bytes | None Gets the final result of a request started with :func:`~gi.repository.Shumate.DataSource.get_tile_data_async`. :param result: a :obj:`~gi.repository.Gio.AsyncResult` provided to callback .. method:: set_max_zoom_level(zoom_level: int) -> None Sets the data source's maximum zoom level. .. versionadded:: 1.1 :param zoom_level: the maximum zoom level .. method:: set_min_zoom_level(zoom_level: int) -> None Sets the data source's minimum zoom level. .. versionadded:: 1.1 :param zoom_level: the minimum zoom level .. method:: start_request(x: int, y: int, zoom_level: int, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Shumate.DataSourceRequest Begins a request for a tile. .. versionadded:: 1.1 :param x: X coordinate to request :param y: Y coordinate to request :param zoom_level: zoom level to request :param cancellable: for cancelling the request Properties ---------- .. rst-class:: interim-class .. class:: DataSource :no-index: .. attribute:: props.max_zoom_level :type: int The maximum zoom level .. versionadded:: 1.1 .. attribute:: props.min_zoom_level :type: int The minimum zoom level .. versionadded:: 1.1 Signals ------- .. rst-class:: interim-class .. class:: DataSource.signals :no-index: .. method:: received_data(x: int, y: int, zoom_level: int, bytes: ~gi.repository.GLib.Bytes) -> None Emitted when data is received for any tile. This includes any intermediate steps, such as data from the file cache, as well as the final result. .. deprecated:: 1.1 Use :obj:`~gi.repository.DataSource.start_request` and connect to the notify signals of the resulting :obj:`~gi.repository.Shumate.DataSourceRequest`. :param x: the X coordinate of the tile :param y: the Y coordinate of the tile :param zoom_level: the zoom level of the tile :param bytes: the received data Virtual Methods --------------- .. rst-class:: interim-class .. class:: DataSource :no-index: .. method:: do_get_tile_data_async(x: int, y: int, zoom_level: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None Gets the data for the tile at the given coordinates. Some data sources may return data multiple times. For example, :obj:`~gi.repository.Shumate.TileDownloader` may return data from a cache, then return updated data from the network. :obj:`~gi.repository.Shumate.ShumateDataSource.signals.received_data` is emitted each time data is received, then ``callback`` is called after the last update. :param x: the X coordinate to fetch :param y: the Y coordinate to fetch :param zoom_level: the Z coordinate to fetch :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to execute upon completion :param user_data: closure data for ``callback`` .. method:: do_get_tile_data_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.GLib.Bytes | None Gets the final result of a request started with :func:`~gi.repository.Shumate.DataSource.get_tile_data_async`. :param result: a :obj:`~gi.repository.Gio.AsyncResult` provided to callback .. method:: do_start_request(x: int, y: int, zoom_level: int, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Shumate.DataSourceRequest Begins a request for a tile. .. versionadded:: 1.1 :param x: X coordinate to request :param y: Y coordinate to request :param zoom_level: zoom level to request :param cancellable: for cancelling the request Fields ------ .. rst-class:: interim-class .. class:: DataSource :no-index: .. attribute:: parent_instance