Shumate.VectorRenderer¶
- Subclasses:
None
Methods¶
- Inherited:
Shumate.MapSource (26), GObject.Object (37), Gio.Initable (2)
- Structs:
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
sprite-sheet |
||
r/w/co/en |
Style JSON |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Shumate.VectorRenderer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A [class`MapSource`] that renders tiles from a given vector data source.
- classmethod is_supported()¶
- Returns:
True
if libshumate was compiled with-Dvector_renderer=true
orFalse
if it was not- Return type:
Checks whether libshumate was compiled with vector tile support. If it was not, vector renderers cannot be created or used.
- classmethod new(id, style_json)¶
- Parameters:
- Raises:
- Returns:
a newly constructed [class`VectorRenderer`], or
None
if error is set- Return type:
Creates a new [class`VectorRenderer`] from the given JSON style.
The stylesheet should contain a list of tile sources. Tiles will be downloaded using [class`TileDownloader`]s.
See the MapLibre Style Specification for details on style_json, but be aware that libshumate does not support every feature of the specification.
- get_sprite_sheet()¶
- Returns:
the [class`VectorSpriteSheet`]
- Return type:
Gets the sprite sheet used to render icons and textures.
New in version 1.1.
- set_data_source(name, data_source)¶
- Parameters:
name (
str
) – the name of the data sourcedata_source (
Shumate.DataSource
) – a [class`DataSource`]
Adds a data source to the renderer.
Currently, [class`VectorRenderer`] only supports one data source and throws an error if the style does not contain exactly one data source. However, support for multiple sources may be added in the future, so this method accepts a name parameter. If the name does not match the one expected by the style, this method will have no effect.
New in version 1.2.
- set_sprite_sheet(sprites)¶
- Parameters:
sprites (
Shumate.VectorSpriteSheet
) – a [class`VectorSpriteSheet`]
Sets the sprite sheet used to render icons and textures.
New in version 1.1.
- set_sprite_sheet_data(sprites_pixbuf, sprites_json)¶
- Parameters:
sprites_pixbuf (
GdkPixbuf.Pixbuf
) – a [class`GdkPixbuf`.Pixbuf]sprites_json (
str
) – a JSON string
- Raises:
- Returns:
whether the sprite sheet was loaded successfully
- Return type:
Sets the sprite sheet used by the style JSON to render icons and textures.
The existing [property`VectorRenderer`:py:data::sprite-sheet<Shumate.VectorRenderer.props.sprite_sheet>] property will be replaced with a new instance of [class`VectorSpriteSheet`].
Deprecated since version 1.1: Use the methods of [property`VectorRenderer`:sprite-sheet] instead.
Property Details¶
- Shumate.VectorRenderer.props.sprite_sheet¶
- Name:
sprite-sheet
- Type:
- Default Value:
- Flags:
The sprite sheet used to render icons and textures.
New in version 1.1.
- Shumate.VectorRenderer.props.style_json¶
- Name:
style-json
- Type:
- Default Value:
- Flags:
A map style, in Mapbox Style Specification format.
Note that not all features of the specification are supported.