Shumate.MapSource¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c/en |
The id of the map source |
||
r/w/c/en |
The usage license of the map source |
||
r/w/c/en |
The usage license’s uri for more information |
||
r/w/c/en |
The maximum zoom level |
||
r/w/c/en |
The minimum zoom level |
||
r/w/c/en |
The name of the map source |
||
r/w/c/en |
The map projection |
||
r/w/c/en |
The map size |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Shumate.MapSource(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
The base class for all map sources. Map sources fill [class`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 [class`RasterRenderer`], which fetches tiles using a [class`TileDownloader`].
- fill_tile_async(tile, cancellable, callback, *user_data)¶
- Parameters:
tile (
Shumate.Tile
) – aShumate.Tile
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to execute upon completion
Asynchronous version of shumate_map_source_fill_tile().
- fill_tile_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
provided to callback- Raises:
- Returns:
True
if the tile was filled with valid data, otherwiseFalse
- Return type:
Gets the success value of a completed
Shumate.MapSource.fill_tile_async
() operation.
- get_column_count(zoom_level)¶
- Parameters:
zoom_level (
int
) – the zoom level- Returns:
the number of tiles in a column
- Return type:
Gets the number of tiles in a column at this zoom level for this map source.
- get_latitude(zoom_level, y)¶
- Parameters:
- Returns:
the latitude
- Return type:
Gets the latitude corresponding to this y position in the map source’s projection.
- get_license_uri()¶
- Returns:
the map source’s license URI.
- Return type:
Gets map source’s license URI.
- get_longitude(zoom_level, x)¶
- Parameters:
- Returns:
the longitude
- Return type:
Gets the longitude corresponding to this x position in the map source’s projection.
- get_max_zoom_level()¶
- Returns:
the maximum zoom level this map source supports
- Return type:
Gets map source’s maximum zoom level.
- get_meters_per_pixel(zoom_level, latitude, longitude)¶
- Parameters:
- Returns:
the meters per pixel
- Return type:
Gets meters per pixel at the position on the map using this map source’s projection.
- get_min_zoom_level()¶
- Returns:
the miminum zoom level this map source supports
- Return type:
Gets map source’s minimum zoom level.
- get_projection()¶
- Returns:
the map source’s projection.
- Return type:
Gets map source’s projection.
- get_row_count(zoom_level)¶
- Parameters:
zoom_level (
int
) – the zoom level- Returns:
the number of tiles in a row
- Return type:
Gets the number of tiles in a row at this zoom level for this map source.
- get_tile_size()¶
- Returns:
the tile’s size (width and height) in pixels for this map source
- Return type:
Gets map source’s tile size.
- get_tile_size_at_zoom(zoom_level)¶
- Parameters:
zoom_level (
float
) – a zoom level- Returns:
the tile’s size (width and height) in pixels for this map source at this zoom level
- Return type:
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.
- get_x(zoom_level, longitude)¶
- Parameters:
- Returns:
the x position
- Return type:
Gets the x position on the map using this map source’s projection. (0, 0) is located at the top left.
- get_y(zoom_level, latitude)¶
- Parameters:
- Returns:
the y position
- Return type:
Gets the y position on the map using this map source’s projection. (0, 0) is located at the top left.
- set_license_uri(license_uri)¶
- Parameters:
license_uri (
str
) – the licence URI
Sets the map source’s license URI.
- set_max_zoom_level(zoom_level)¶
- Parameters:
zoom_level (
int
) – the maximum zoom level
Sets the map source’s maximum zoom level.
- set_min_zoom_level(zoom_level)¶
- Parameters:
zoom_level (
int
) – the minimal zoom level
Sets the map source’s minimal zoom level.
- set_projection(projection)¶
- Parameters:
projection (
Shumate.MapProjection
) – aShumate.MapProjection
Sets the map source’s projection.
- set_tile_size(tile_size)¶
- Parameters:
tile_size (
int
) – the tile size
Sets the map source’s tile size.
- do_fill_tile_async(tile, cancellable, callback, *user_data) virtual¶
- Parameters:
tile (
Shumate.Tile
) – aShumate.Tile
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to execute upon completion
Asynchronous version of shumate_map_source_fill_tile().
- do_fill_tile_finish(result) virtual¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
provided to callback- Returns:
True
if the tile was filled with valid data, otherwiseFalse
- Return type:
Gets the success value of a completed
Shumate.MapSource.fill_tile_async
() operation.
Property Details¶
- Shumate.MapSource.props.id¶
-
The id of the map source
- Shumate.MapSource.props.license¶
-
The usage license of the map source
- Shumate.MapSource.props.license_uri¶
- Name:
license-uri
- Type:
- Default Value:
- Flags:
The usage license’s uri for more information
- Shumate.MapSource.props.max_zoom_level¶
- Name:
max-zoom-level
- Type:
- Default Value:
18
- Flags:
The maximum zoom level
- Shumate.MapSource.props.min_zoom_level¶
- Name:
min-zoom-level
- Type:
- Default Value:
0
- Flags:
The minimum zoom level
- Shumate.MapSource.props.name¶
-
The name of the map source
- Shumate.MapSource.props.projection¶
- Name:
projection
- Type:
- Default Value:
- Flags:
The map projection of the map source