Class: QgsAnnotationMarkerItem

An annotation item which renders a marker symbol at a point location.

Added in version 3.16.

Class Hierarchy

Inheritance diagram of qgis.core.QgsAnnotationMarkerItem

Base classes

QgsAnnotationItem

Abstract base class for annotation items which are drawn with QgsAnnotationLayers.

Methods

geometry

Returns the point geometry of the marker.

setGeometry

Sets the point geometry location of the marker.

setSymbol

Sets the symbol used to render the marker item.

symbol

Returns the symbol used to render the marker item.

Static Methods

create

Creates a new marker annotation item.

class qgis.core.QgsAnnotationMarkerItem[source]

Bases: QgsAnnotationItem

__init__(point: QgsPoint)

Constructor for QgsAnnotationMarkerItem, at the specified point.

Parameters:

point (QgsPoint)

static create() QgsAnnotationMarkerItem | None[source]

Creates a new marker annotation item.

Return type:

Optional[QgsAnnotationMarkerItem]

geometry(self) QgsPointXY[source]

Returns the point geometry of the marker.

The coordinate reference system for the point will be the parent layer’s QgsAnnotationLayer.crs().

See also

setGeometry()

Return type:

QgsPointXY

setGeometry(self, geometry: QgsPoint)[source]

Sets the point geometry location of the marker.

The coordinate reference system for the point will be the parent layer’s QgsAnnotationLayer.crs().

See also

geometry()

Parameters:

geometry (QgsPoint)

setSymbol(self, symbol: QgsMarkerSymbol | None)[source]

Sets the symbol used to render the marker item.

The item takes ownership of the symbol.

See also

symbol()

Parameters:

symbol (Optional[QgsMarkerSymbol])

symbol(self) QgsMarkerSymbol | None[source]

Returns the symbol used to render the marker item.

See also

setSymbol()

Return type:

Optional[QgsMarkerSymbol]