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.New 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
- rtype:
QgsAnimatedMarkerSymbolLayer
Copies common properties to another layer.
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Creates an animated marker symbol layer from a string map of
properties
.Returns the marker frame rate in frame per second.
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layers- rtype:
str
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.
- rtype:
Dict[str, Any]
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layersRestores older data defined properties from string map.
Sets common class properties from a
properties
map.Sets the marker frame
rate
in frame per second.Returns
True
if the symbol layer should be rendered using the selection color from the render context.- param context:
- clone(self) QgsAnimatedMarkerSymbolLayer ¶
- Return type:
- copyCommonProperties(self, other: QgsRasterMarkerSymbolLayer)¶
Copies common properties to another layer.
New 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:
- frameRate(self) float ¶
Returns the marker frame rate in frame per second.
See also
- Return type:
float
- installMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layersSee also
prepareMasks()
See also
New 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 ifrecursive
isTrue
masks are removed recursively for all children symbol layersSee also
prepareMasks()
See also
New 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.New in version 3.26.
- setFrameRate(self, rate: float)¶
Sets the marker frame
rate
in frame per second.See also
- 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.New in version 3.34.
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –