Champlain.MapSourceFactory

g Champlain.MapSourceFactory Champlain.MapSourceFactory GObject.Object GObject.Object GObject.Object->Champlain.MapSourceFactory

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class dup_default ()
  create (id)
  create_cached_source (id)
  create_error_source (tile_size)
  create_memcached_source (id)
  get_registered ()
  register (desc)

Virtual Methods

Inherited:GObject.Object (7)

Properties

None

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class Champlain.MapSourceFactory(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:Champlain.MapSourceFactoryClass

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

New in version 0.4.

classmethod dup_default()
Returns:the singleton Champlain.MapSourceFactory, it should be freed using GObject.Object.unref() when not needed.
Return type:Champlain.MapSourceFactory

A method to obtain the singleton object.

New in version 0.4.

create(id)
Parameters:id (str) – the wanted map source id
Returns:a ready to use Champlain.MapSource matching the given name; returns None if the source with the given name doesn’t exist.
Return type:Champlain.MapSource

Note: The id should not contain any character that can’t be in a filename as it will be used as the cache directory name for that map source.

New in version 0.4.

create_cached_source(id)
Parameters:id (str) – the wanted map source id
Returns:a ready to use Champlain.MapSourceChain consisting of Champlain.MemoryCache, Champlain.FileCache, Champlain.MapSource matching the given name, and an error tile source created with Champlain.MapSourceFactory.create_error_source (). Returns None if the source with the given name doesn’t exist.
Return type:Champlain.MapSource

Creates a cached map source.

New in version 0.6.

create_error_source(tile_size)
Parameters:tile_size (int) – the size of the error tile
Returns:a ready to use map source generating error tiles.
Return type:Champlain.MapSource

Creates a map source generating error tiles.

New in version 0.8.

create_memcached_source(id)
Parameters:id (str) – the wanted map source id
Returns:a ready to use Champlain.MapSourceChain consisting of Champlain.MemoryCache and Champlain.MapSource matching the given name. Returns None if the source with the given name doesn’t exist.
Return type:Champlain.MapSource

Creates a memory cached map source.

New in version 0.12.5.

get_registered()
Returns:the list of registered map sources, the items should not be freed, the list should be freed with #g_slist_free.
Return type:[Champlain.MapSourceDesc]

Get the list of registered map sources.

New in version 0.4.

register(desc)
Parameters:desc (Champlain.MapSourceDesc) – the description of the map source
Returns:True if the registration suceeded.
Return type:bool

Registers the new map source with the given constructor. When this map source is requested, the given constructor will be used to build the map source. Champlain.MapSourceFactory will take ownership of the passed Champlain.MapSourceDesc, so don’t free it.

New in version 0.10.