MarkerLayer#

class MarkerLayer(**properties: Any)#

Superclasses: Layer, Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget

Displays markers on the map. It is responsible for positioning markers correctly, marker selections and group marker operations.

Constructors#

class MarkerLayer
classmethod new(viewport: Viewport) MarkerLayer#

Creates a new instance of MarkerLayer.

Parameters:

viewport – the ShumateViewport

classmethod new_full(viewport: Viewport, mode: SelectionMode) MarkerLayer#

Creates a new instance of MarkerLayer with the specified selection mode.

Parameters:
  • viewport – the ShumateViewport

  • mode – Selection mode

Methods#

class MarkerLayer
add_marker(marker: Marker) None#

Adds the marker to the layer.

Parameters:

marker – a Marker

get_markers() list[Marker]#

Gets a copy of the list of all markers inserted into the layer. You should free the list but not its contents.

get_selected() list[Marker]#

Gets a list of selected markers in the layer.

get_selection_mode() SelectionMode#

Gets the selection mode of the layer.

remove_all() None#

Removes all markers from the layer.

remove_marker(marker: Marker) None#

Removes the marker from the layer.

Parameters:

marker – a Marker

select_all_markers() None#

Selects all selectable markers in the layer.

select_marker(marker: Marker) bool#

Selects a marker in this layer.

If MarkerLayer:selection-mode is %GTK_SELECTION_SINGLE or %GTK_SELECTION_BROWSE, all other markers will be unselected. If the mode is %GTK_SELECTION_NONE or marker is not selectable, nothing will happen.

Parameters:

marker – a Marker that is a child of self

set_selection_mode(mode: SelectionMode) None#

Sets the selection mode of the layer.

NOTE: changing selection mode to %GTK_SELECTION_NONE, %GTK_SELECTION_SINGLE or %GTK_SELECTION_BROWSE will clear all previously selected markers.

Parameters:

mode – a SelectionMode value

unselect_all_markers() None#

Unselects all markers in the layer.

unselect_marker(marker: Marker) None#

Unselects a marker in this layer.

This works even if MarkerLayer:selection-mode is %GTK_SELECTION_BROWSE. Browse mode only prevents user interaction, not the program, from unselecting a marker.

Parameters:

marker – a Marker that is a child of self

Properties#

class MarkerLayer
props.selection_mode: SelectionMode#

The type of the None singleton.

Signals#

class MarkerLayer.signals
marker_selected(marker: Marker) None#

The type of the None singleton.

Parameters:

marker – The marker that was selected

marker_unselected(marker: Marker) None#

The type of the None singleton.

Parameters:

marker – The marker that was unselected