Champlain.MapSource

g Champlain.MapSource Champlain.MapSource GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Champlain.MapSource GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

Champlain.MapSourceChain, Champlain.TileCache, Champlain.TileSource

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

fill_tile (tile)

get_column_count (zoom_level)

get_id ()

get_latitude (zoom_level, y)

get_license ()

get_license_uri ()

get_longitude (zoom_level, x)

get_max_zoom_level ()

get_meters_per_pixel (zoom_level, latitude, longitude)

get_min_zoom_level ()

get_name ()

get_next_source ()

get_projection ()

get_renderer ()

get_row_count (zoom_level)

get_tile_size ()

get_x (zoom_level, longitude)

get_y (zoom_level, latitude)

set_next_source (next_source)

set_renderer (renderer)

Virtual Methods

Inherited:

GObject.Object (7)

do_fill_tile (tile)

do_get_id ()

do_get_license ()

do_get_license_uri ()

do_get_max_zoom_level ()

do_get_min_zoom_level ()

do_get_name ()

do_get_projection ()

do_get_tile_size ()

Properties

Name

Type

Flags

Short Description

next-source

Champlain.MapSource

r/w

Next source in the loading chain

renderer

Champlain.Renderer

r/w

Tile renderer used to render tiles

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.InitiallyUnowned

r

Class Details

class Champlain.MapSource(**kwargs)
Bases:

GObject.InitiallyUnowned

Abstract:

Yes

Structure:

Champlain.MapSourceClass

The Champlain.MapSource structure contains only private data and should be accessed using the provided API

New in version 0.4.

fill_tile(tile)
Parameters:

tile (Champlain.Tile) – a Champlain.Tile

Fills the tile with image data (either from cache, network or rendered locally).

New in version 0.4.

get_column_count(zoom_level)
Parameters:

zoom_level (int) – the zoom level

Returns:

the number of tiles in a column

Return type:

int

Gets the number of tiles in a column at this zoom level for this map source.

New in version 0.4.

get_id()
Returns:

the map source’s id.

Return type:

str

Gets map source’s id.

New in version 0.4.

get_latitude(zoom_level, y)
Parameters:
  • zoom_level (int) – the zoom level

  • y (float) – a y position

Returns:

the latitude

Return type:

float

Gets the latitude corresponding to this y position in the map source’s projection.

New in version 0.4.

get_license()
Returns:

the map source’s license.

Return type:

str

Gets map source’s license.

New in version 0.4.

get_license_uri()
Returns:

the map source’s license URI.

Return type:

str

Gets map source’s license URI.

New in version 0.4.

get_longitude(zoom_level, x)
Parameters:
  • zoom_level (int) – the zoom level

  • x (float) – a x position

Returns:

the longitude

Return type:

float

Gets the longitude corresponding to this x position in the map source’s projection.

New in version 0.4.

get_max_zoom_level()
Returns:

the maximum zoom level this map source supports

Return type:

int

Gets map source’s maximum zoom level.

New in version 0.4.

get_meters_per_pixel(zoom_level, latitude, longitude)
Parameters:
  • zoom_level (int) – the zoom level

  • latitude (float) – a latitude

  • longitude (float) – a longitude

Returns:

the meters per pixel

Return type:

float

Gets meters per pixel at the position on the map using this map source’s projection.

New in version 0.4.3.

get_min_zoom_level()
Returns:

the miminum zoom level this map source supports

Return type:

int

Gets map source’s minimum zoom level.

New in version 0.4.

get_name()
Returns:

the map source’s name.

Return type:

str

Gets map source’s name.

New in version 0.4.

get_next_source()
Returns:

the next source in the chain.

Return type:

Champlain.MapSource

Get the next source in the chain.

New in version 0.6.

get_projection()
Returns:

the map source’s projection.

Return type:

Champlain.MapProjection

Gets map source’s projection.

New in version 0.4.

get_renderer()
Returns:

the renderer.

Return type:

Champlain.Renderer

Get the renderer used for tiles rendering.

New in version 0.8.

get_row_count(zoom_level)
Parameters:

zoom_level (int) – the zoom level

Returns:

the number of tiles in a row

Return type:

int

Gets the number of tiles in a row at this zoom level for this map source.

New in version 0.4.

get_tile_size()
Returns:

the tile’s size (width and height) in pixels for this map source

Return type:

int

Gets map source’s tile size.

New in version 0.4.

get_x(zoom_level, longitude)
Parameters:
  • zoom_level (int) – the zoom level

  • longitude (float) – a longitude

Returns:

the x position

Return type:

float

Gets the x position on the map using this map source’s projection. (0, 0) is located at the top left.

New in version 0.4.

get_y(zoom_level, latitude)
Parameters:
  • zoom_level (int) – the zoom level

  • latitude (float) – a latitude

Returns:

the y position

Return type:

float

Gets the y position on the map using this map source’s projection. (0, 0) is located at the top left.

New in version 0.4.

set_next_source(next_source)
Parameters:

next_source (Champlain.MapSource) – the next Champlain.MapSource in the chain

Sets the next map source in the chain.

New in version 0.6.

set_renderer(renderer)
Parameters:

renderer (Champlain.Renderer) – the renderer

Sets the renderer used for tiles rendering.

New in version 0.8.

do_fill_tile(tile) virtual
Parameters:

tile (Champlain.Tile) – a Champlain.Tile

Fills the tile with image data (either from cache, network or rendered locally).

New in version 0.4.

do_get_id() virtual
Returns:

the map source’s id.

Return type:

str

Gets map source’s id.

New in version 0.4.

do_get_license() virtual
Returns:

the map source’s license.

Return type:

str

Gets map source’s license.

New in version 0.4.

do_get_license_uri() virtual
Returns:

the map source’s license URI.

Return type:

str

Gets map source’s license URI.

New in version 0.4.

do_get_max_zoom_level() virtual
Returns:

the maximum zoom level this map source supports

Return type:

int

Gets map source’s maximum zoom level.

New in version 0.4.

do_get_min_zoom_level() virtual
Returns:

the miminum zoom level this map source supports

Return type:

int

Gets map source’s minimum zoom level.

New in version 0.4.

do_get_name() virtual
Returns:

the map source’s name.

Return type:

str

Gets map source’s name.

New in version 0.4.

do_get_projection() virtual
Returns:

the map source’s projection.

Return type:

Champlain.MapProjection

Gets map source’s projection.

New in version 0.4.

do_get_tile_size() virtual
Returns:

the tile’s size (width and height) in pixels for this map source

Return type:

int

Gets map source’s tile size.

New in version 0.4.

Property Details

Champlain.MapSource.props.next_source
Name:

next-source

Type:

Champlain.MapSource

Default Value:

None

Flags:

READABLE, WRITABLE

Next source in the loading chain.

New in version 0.6.

Champlain.MapSource.props.renderer
Name:

renderer

Type:

Champlain.Renderer

Default Value:

None

Flags:

READABLE, WRITABLE

Renderer used for tiles rendering.

New in version 0.8.