MapSource#
Superclasses: Object
Subclasses: RasterRenderer
, VectorRenderer
The base class for all map sources. Map sources fill 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 RasterRenderer
, which fetches tiles
using a TileDownloader
.
Methods#
- class MapSource
- do_fill_tile_async(self, tile: Tile, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
- Parameters:
tile
cancellable
callback
user_data
- do_fill_tile_finish(self, result: AsyncResult) bool #
- Parameters:
result
- fill_tile_async(tile: Tile, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Asynchronous version of shumate_map_source_fill_tile().
- Parameters:
tile – a
Tile
cancellable – a
Cancellable
callback – a
AsyncReadyCallback
to execute upon completionuser_data – closure data for
callback
- fill_tile_finish(result: AsyncResult) bool #
Gets the success value of a completed
fill_tile_async()
operation.- Parameters:
result – a
AsyncResult
provided to callback
- get_column_count(zoom_level: int) int #
Gets the number of tiles in a column at this zoom level for this map source.
- Parameters:
zoom_level – the zoom level
- get_latitude(zoom_level: float, y: float) float #
Gets the latitude corresponding to this y position in the map source’s projection.
- Parameters:
zoom_level – the zoom level
y – a y position
- get_longitude(zoom_level: float, x: float) float #
Gets the longitude corresponding to this x position in the map source’s projection.
- Parameters:
zoom_level – the zoom level
x – a x position
- 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.
- Parameters:
zoom_level – the zoom level
latitude – a latitude
longitude – a longitude
- get_projection() MapProjection #
Gets map source’s projection.
- get_row_count(zoom_level: int) int #
Gets the number of tiles in a row at this zoom level for this map source.
- Parameters:
zoom_level – the zoom level
- 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.
- Parameters:
zoom_level – a zoom level
- 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.
- Parameters:
zoom_level – the zoom level
longitude – a longitude
- 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.
- Parameters:
zoom_level – the zoom level
latitude – a latitude
- set_license_uri(license_uri: str) None #
Sets the map source’s license URI.
- Parameters:
license_uri – the licence URI
- set_max_zoom_level(zoom_level: int) None #
Sets the map source’s maximum zoom level.
- Parameters:
zoom_level – the maximum zoom level
- set_min_zoom_level(zoom_level: int) None #
Sets the map source’s minimal zoom level.
- Parameters:
zoom_level – the minimal zoom level
- set_projection(projection: MapProjection) None #
Sets the map source’s projection.
- Parameters:
projection – a
MapProjection
Properties#
- class MapSource
-
- props.projection: MapProjection#
The type of the None singleton.
Virtual Methods#
- class MapSource
- do_fill_tile_async(tile: Tile, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Asynchronous version of shumate_map_source_fill_tile().
- Parameters:
tile – a
Tile
cancellable – a
Cancellable
callback – a
AsyncReadyCallback
to execute upon completionuser_data – closure data for
callback
- do_fill_tile_finish(result: AsyncResult) bool #
Gets the success value of a completed
fill_tile_async()
operation.- Parameters:
result – a
AsyncResult
provided to callback
Fields#
- class MapSource
- parent_instance#