Shumate.SymbolEvent

g GObject.GInterface GObject.GInterface Shumate.Location Shumate.Location GObject.GInterface->Shumate.Location GObject.Object GObject.Object Shumate.SymbolEvent Shumate.SymbolEvent GObject.Object->Shumate.SymbolEvent Shumate.Location->Shumate.SymbolEvent

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Shumate.Location (4)

Structs:

GObject.ObjectClass (5)

get_feature_id ()

get_keys ()

get_layer ()

get_source_layer ()

get_tag (tag_name)

Virtual Methods

Inherited:

GObject.Object (7), Shumate.Location (3)

Properties

Inherited:

Shumate.Location (2)

Name

Type

Flags

Short Description

feature-id

str

r

Feature ID

layer

str

r

layer

source-layer

str

r

source-layer

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Shumate.SymbolEvent(**kwargs)
Bases:

GObject.Object, Shumate.Location

Abstract:

No

Structure:

Shumate.SymbolEventClass

An object containing the details of a map feature that has been clicked. It is the argument of the [signal`MapLayer`:py:func:::symbol-clicked<Shumate.SymbolEvent.signals.symbol_clicked>] and [signal`SimpleMap`:py:func:::symbol-clicked<Shumate.SymbolEvent.signals.symbol_clicked>] signals.

When vector maps are rendered, they may contain labels and icons. When one of these symbols is clicked, these signals are emitted to give the application access to the original location and details of the map feature.

[class`SymbolEvent`] implements [iface`Location`] so you can get the latitude and longitude of the feature that was clicked.

New in version 1.1.

get_feature_id()
Returns:

the feature ID

Return type:

str

Gets the feature ID as specified in the data source. The meaning of the ID, if any, is up to the source.

Feature IDs in Mapbox Vector Tile format are integers, but they are formatted as a string here for futureproofing.

New in version 1.1.

get_keys()
Returns:

a list of the tag keys

Return type:

[str]

Gets a list of the keys of the source feature’s tags.

New in version 1.1.

get_layer()
Returns:

the layer name

Return type:

str

Gets the name of the layer the clicked symbol is in, as named in the vector stylesheet.

Note that this is distinct from the name of the layer in the vector tile schema. Some styles have multiple symbol layers derived from the same data source layer.

New in version 1.1.

get_source_layer()
Returns:

the layer name

Return type:

str

Gets the name of the source layer the clicked feature is in, as named in the vector tile schema.

New in version 1.1.

get_tag(tag_name)
Parameters:

tag_name (str) – the tag to get

Returns:

the tag value, formatted as a string

Return type:

str

Gets a tag from the source feature.

The available tags depend on the vector tile schema and the source layer. Check the documentation for the tiles you’re using to see what information is available.

New in version 1.1.

Property Details

Shumate.SymbolEvent.props.feature_id
Name:

feature-id

Type:

str

Default Value:

None

Flags:

READABLE

The ID of the feature that this event pertains to, as it was given in the data source.

New in version 1.1.

Shumate.SymbolEvent.props.layer
Name:

layer

Type:

str

Default Value:

None

Flags:

READABLE

The ID of the style layer of the symbol that this event pertains to.

New in version 1.1.

Shumate.SymbolEvent.props.source_layer
Name:

source-layer

Type:

str

Default Value:

None

Flags:

READABLE

The ID of the source layer of the symbol that this event pertains to.