Class: QgsAnimatedMarkerSymbolLayer

class qgis.core.QgsAnimatedMarkerSymbolLayer

Bases: QgsRasterMarkerSymbolLayer

Animated marker symbol layer class.

The QgsAnimatedMarkerSymbolLayer class renders frames from an animated raster image source (e.g. an animated GIF) during temporal animations or map exports.

Added in version 3.26.

QgsAnimatedMarkerSymbolLayer(path: str = ‘’, size: float = DEFAULT_RASTERMARKER_SIZE, angle: float = DEFAULT_RASTERMARKER_ANGLE) Constructor for animated marker symbol layer using the specified source image path.

Methods

clone

rtype:

QgsAnimatedMarkerSymbolLayer

copyCommonProperties

Copies common properties to another layer.

copyDataDefinedProperties

Copies all data defined properties of this layer to another symbol layer.

copyPaintEffect

Copies paint effect of this layer to another symbol layer

create

Creates an animated marker symbol layer from a string map of properties.

frameRate

Returns the marker frame rate in frame per second.

installMasks

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

layerType

rtype:

str

markerOffset

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.

markerOffset2

markerOffsetWithWidthAndHeight

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.

properties

rtype:

Dict[str, Any]

removeMasks

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

restoreOldDataDefinedProperties

Restores older data defined properties from string map.

setCommonProperties

Sets common class properties from a properties map.

setFrameRate

Sets the marker frame rate in frame per second.

shouldRenderUsingSelectionColor

Returns True if the symbol layer should be rendered using the selection color from the render context.

startRender

param context:

clone(self) QgsAnimatedMarkerSymbolLayer
Return type:

QgsAnimatedMarkerSymbolLayer

copyCommonProperties(self, other: QgsRasterMarkerSymbolLayer)

Copies common properties to another layer.

Added in version 3.26.

copyDataDefinedProperties(self, destLayer: QgsSymbolLayer)

Copies all data defined properties of this layer to another symbol layer.

Parameters:

destLayer – destination layer

copyPaintEffect(self, destLayer: QgsSymbolLayer)

Copies paint effect of this layer to another symbol layer

Parameters:

destLayer – destination layer

create(properties: Dict[str, Any] = {}) QgsSymbolLayer

Creates an animated marker symbol layer from a string map of properties.

Parameters:

properties (Dict[str)

Return type:

QgsSymbolLayer

frameRate(self) float

Returns the marker frame rate in frame per second.

See also

setFrameRate()

Return type:

float

installMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

See also

prepareMasks()

See also

removeMasks()

Added in version 3.30.

layerType(self) str
Return type:

str

markerOffset(self, context: QgsSymbolRenderContext) Tuple[float, float]

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point.

Parameters:
  • context – symbol render context

  • offsetX – will be set to required horizontal offset (in painter units)

  • offsetY – will be set to required vertical offset (in painter units)

markerOffset2(self, context: QgsSymbolRenderContext, width: float, height: float, widthUnit: Qgis.RenderUnit, heightUnit: Qgis.RenderUnit, widthMapUnitScale: QgsMapUnitScale, heightMapUnitScale: QgsMapUnitScale) Tuple[float, float]

Note

available in Python bindings as markerOffset2

markerOffsetWithWidthAndHeight(self, context: QgsSymbolRenderContext, width: float, height: float) Tuple[float, float]

Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point.

Parameters:
  • context – symbol render context

  • width – marker width

  • height – marker height

  • offsetX – will be set to required horizontal offset (in painter units)

  • offsetY – will be set to required vertical offset (in painter units)

Note

available in Python as markerOffsetWithWidthAndHeight

properties(self) Dict[str, Any]
Return type:

Dict[str, Any]

removeMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

See also

prepareMasks()

See also

installMasks()

Added in version 3.30.

restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])

Restores older data defined properties from string map.

setCommonProperties(self, properties: Dict[str, Any])

Sets common class properties from a properties map.

Added in version 3.26.

setFrameRate(self, rate: float)

Sets the marker frame rate in frame per second.

See also

frameRate()

Parameters:

rate (float)

shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool

Returns True if the symbol layer should be rendered using the selection color from the render context.

Added in version 3.34.

startRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)