Shumate.MapLayer

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Shumate.Layer Shumate.Layer Gtk.Widget->Shumate.Layer Shumate.MapLayer Shumate.MapLayer Shumate.Layer->Shumate.MapLayer

Subclasses:

None

Methods

Inherited:

Shumate.Layer (1), Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (18), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (map_source, viewport)

get_map_source ()

refresh ()

retry_failed ()

set_map_source (map_source)

Virtual Methods

Inherited:

Shumate.Layer (1), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (7), Gtk.Buildable (9)

Properties

Inherited:

Shumate.Layer (1), Gtk.Widget (35), Gtk.Accessible (1)

Name

Type

Flags

Short Description

map-source

Shumate.MapSource

r/w/en

The Map Source

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

map-loaded

Emitted when all the tiles in the map view are finished loading.

symbol-clicked

Emitted when a symbol in the map layer is clicked.

tile-error

Emitted when a tile fails to load.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Shumate.MapLayer(**kwargs)
Bases:

Shumate.Layer

Abstract:

No

Structure:

Shumate.MapLayerClass

A [class`Shumate`.Layer] implementation that fetches tiles from a [class`Shumate`.MapSource] and draws them as a grid.

CSS nodes

ShumatePoint has a single CSS node with the name “map-layer”.

classmethod new(map_source, viewport)
Parameters:
Return type:

Shumate.MapLayer

get_map_source()
Returns:

the [class`MapSource`]

Return type:

Shumate.MapSource

Gets the [class`MapSource`] providing tiles for this map layer.

Added in version 1.7.

refresh()

Refreshes all tiles from the current map source.

Added in version 1.7.

retry_failed()

Attempts to reload any tiles in an error state.

This can be used to recover from temporary errors. For example, you could use [iface`Gio`.NetworkMonitor] to listen for changes in network connectivity, and call this function when the network becomes available again.

Added in version 1.7.

set_map_source(map_source)
Parameters:

map_source (Shumate.MapSource) – a [class`MapSource`]

Sets the [class`MapSource`] that provides tiles for this map layer to display.

Setting a new map source will refresh all tiles from the new source.

Added in version 1.7.

Signal Details

Shumate.MapLayer.signals.map_loaded(map_layer, errors)
Signal Name:

map-loaded

Flags:

RUN_LAST

Parameters:
  • map_layer (Shumate.MapLayer) – The object which received the signal

  • errors (bool) – TRUE if any visible tiles failed to load

Emitted when all the tiles in the map view are finished loading.

As the map is panned or zoomed, this signal may be emitted multiple times.

Added in version 1.4.

Shumate.MapLayer.signals.symbol_clicked(map_layer, event)
Signal Name:

symbol-clicked

Flags:

RUN_LAST

Parameters:

Emitted when a symbol in the map layer is clicked.

Added in version 1.1.

Shumate.MapLayer.signals.tile_error(map_layer, tile, error)
Signal Name:

tile-error

Flags:

RUN_LAST

Parameters:

Emitted when a tile fails to load.

Added in version 1.4.

Property Details

Shumate.MapLayer.props.map_source
Name:

map-source

Type:

Shumate.MapSource

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The source of the tiles this map layer displays.