:right-sidebar: True MapSource =================================================================== .. currentmodule:: gi.repository.Shumate .. class:: MapSource(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Shumate.RasterRenderer`, :class:`~gi.repository.Shumate.VectorRenderer` The base class for all map sources. Map sources fill :obj:`~gi.repository.Shumate.Tile` objects with images from various sources: a web API, for example, or a test pattern generated on demand. The most common map source is :obj:`~gi.repository.Shumate.RasterRenderer`\, which fetches tiles using a :obj:`~gi.repository.Shumate.TileDownloader`\. Methods ------- .. rst-class:: interim-class .. class:: MapSource :no-index: .. method:: do_fill_tile_async(self, tile: ~gi.repository.Shumate.Tile, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None :param tile: :param cancellable: :param callback: :param user_data: .. method:: do_fill_tile_finish(self, result: ~gi.repository.Gio.AsyncResult) -> bool :param result: .. method:: fill_tile_async(tile: ~gi.repository.Shumate.Tile, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronous version of shumate_map_source_fill_tile(). :param tile: a :obj:`~gi.repository.Shumate.Tile` :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:: fill_tile_finish(result: ~gi.repository.Gio.AsyncResult) -> bool Gets the success value of a completed :func:`~gi.repository.Shumate.MapSource.fill_tile_async` operation. :param result: a :obj:`~gi.repository.Gio.AsyncResult` provided to callback .. method:: get_column_count(zoom_level: int) -> int Gets the number of tiles in a column at this zoom level for this map source. :param zoom_level: the zoom level .. method:: get_id() -> str Gets map source's id. .. method:: get_latitude(zoom_level: float, y: float) -> float Gets the latitude corresponding to this y position in the map source's projection. :param zoom_level: the zoom level :param y: a y position .. method:: get_license() -> str Gets map source's license. .. method:: get_license_uri() -> str Gets map source's license URI. .. method:: get_longitude(zoom_level: float, x: float) -> float Gets the longitude corresponding to this x position in the map source's projection. :param zoom_level: the zoom level :param x: a x position .. method:: get_max_zoom_level() -> int Gets map source's maximum zoom level. .. method:: get_meters_per_pixel(zoom_level: float, latitude: float, longitude: float) -> float Gets meters per pixel at the position on the map using this map source's projection. :param zoom_level: the zoom level :param latitude: a latitude :param longitude: a longitude .. method:: get_min_zoom_level() -> int Gets map source's minimum zoom level. .. method:: get_name() -> str Gets map source's name. .. method:: get_projection() -> ~gi.repository.Shumate.MapProjection Gets map source's projection. .. method:: get_row_count(zoom_level: int) -> int Gets the number of tiles in a row at this zoom level for this map source. :param zoom_level: the zoom level .. method:: get_tile_size() -> int Gets map source's tile size. .. method:: get_tile_size_at_zoom(zoom_level: float) -> float Gets the apparent size of the map tiles at the given fractional zoom level. As the map is zoomed in, a tile gets bigger and bigger until, at the next integer zoom level, it "splits" into four tiles at the next zoom level. Thus, the size increase follows an exponential curve, base 2. :param zoom_level: a zoom level .. method:: get_x(zoom_level: float, longitude: float) -> float Gets the x position on the map using this map source's projection. (0, 0) is located at the top left. :param zoom_level: the zoom level :param longitude: a longitude .. method:: get_y(zoom_level: float, latitude: float) -> float Gets the y position on the map using this map source's projection. (0, 0) is located at the top left. :param zoom_level: the zoom level :param latitude: a latitude .. method:: set_id(id: str) -> None Sets the map source's id. :param id: an id .. method:: set_license(license: str) -> None Sets the map source's license. :param license: the licence .. method:: set_license_uri(license_uri: str) -> None Sets the map source's license URI. :param license_uri: the licence URI .. method:: set_max_zoom_level(zoom_level: int) -> None Sets the map source's maximum zoom level. :param zoom_level: the maximum zoom level .. method:: set_min_zoom_level(zoom_level: int) -> None Sets the map source's minimal zoom level. :param zoom_level: the minimal zoom level .. method:: set_name(name: str) -> None Sets the map source's name. :param name: a name .. method:: set_projection(projection: ~gi.repository.Shumate.MapProjection) -> None Sets the map source's projection. :param projection: a :obj:`~gi.repository.Shumate.MapProjection` .. method:: set_tile_size(tile_size: int) -> None Sets the map source's tile size. :param tile_size: the tile size Properties ---------- .. rst-class:: interim-class .. class:: MapSource :no-index: .. attribute:: props.id :type: str The type of the None singleton. .. attribute:: props.license :type: str The type of the None singleton. .. attribute:: props.license_uri :type: str The type of the None singleton. .. attribute:: props.max_zoom_level :type: int The type of the None singleton. .. attribute:: props.min_zoom_level :type: int The type of the None singleton. .. attribute:: props.name :type: str The type of the None singleton. .. attribute:: props.projection :type: ~gi.repository.Shumate.MapProjection The type of the None singleton. .. attribute:: props.tile_size :type: int The type of the None singleton. Virtual Methods --------------- .. rst-class:: interim-class .. class:: MapSource :no-index: .. method:: do_fill_tile_async(tile: ~gi.repository.Shumate.Tile, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronous version of shumate_map_source_fill_tile(). :param tile: a :obj:`~gi.repository.Shumate.Tile` :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_fill_tile_finish(result: ~gi.repository.Gio.AsyncResult) -> bool Gets the success value of a completed :func:`~gi.repository.Shumate.MapSource.fill_tile_async` operation. :param result: a :obj:`~gi.repository.Gio.AsyncResult` provided to callback Fields ------ .. rst-class:: interim-class .. class:: MapSource :no-index: .. attribute:: parent_instance