Champlain.MapSourceFactory¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Champlain.MapSourceFactory(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Champlain.MapSourceFactory
structure contains only private data and should be accessed using the provided APINew in version 0.4.
- classmethod dup_default()¶
- Returns:
the singleton
Champlain.MapSourceFactory
, it should be freed usingGObject.Object.unref
() when not needed.- Return type:
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; returnsNone
if the source with the given name doesn’t exist.- Return type:
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 ofChamplain.MemoryCache
,Champlain.FileCache
,Champlain.MapSource
matching the given name, and an error tile source created withChamplain.MapSourceFactory.create_error_source
(). ReturnsNone
if the source with the given name doesn’t exist.- Return type:
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:
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 ofChamplain.MemoryCache
andChamplain.MapSource
matching the given name. ReturnsNone
if the source with the given name doesn’t exist.- Return type:
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:
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:
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 passedChamplain.MapSourceDesc
, so don’t free it.New in version 0.10.