Class: QgsMarkerLineSymbolLayer

class qgis.core.QgsMarkerLineSymbolLayer(rotateMarker: bool = DEFAULT_MARKERLINE_ROTATE, interval: float = DEFAULT_MARKERLINE_INTERVAL)

Bases: QgsTemplatedLineSymbolLayerBase

Constructor for QgsMarkerLineSymbolLayer. Creates a marker line with a default marker symbol, placed at the specified interval (in millimeters).

The rotateMarker argument specifies whether individual marker symbols should be rotated to match the line segment alignment.

Line symbol layer type which draws repeating marker symbols along a line feature.

Parameters
  • rotateMarker (bool = DEFAULT_MARKERLINE_ROTATE) –

  • interval

CentralPoint = 4
CurvePoint = 5
FirstVertex = 3
Interval = 0
LastVertex = 2
Vertex = 1
clone(self)QgsMarkerLineSymbolLayer
Return type

QgsMarkerLineSymbolLayer

color(self) → QColor
Return type

QColor

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

New in version 2.9.

copyTemplateSymbolProperties(self, destLayer: QgsTemplatedLineSymbolLayerBase)

Copies all common properties of this layer to another templated symbol layer.

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

Creates a new QgsMarkerLineSymbolLayer, using the settings serialized in the properties map (corresponding to the output from QgsMarkerLineSymbolLayer.properties() ).

Parameters

properties (Dict[str) –

Return type

QgsSymbolLayer

createFromSld(element: QDomElement)QgsSymbolLayer

Creates a new QgsMarkerLineSymbolLayer from an SLD XML DOM element.

Parameters

element (QDomElement) –

Return type

QgsSymbolLayer

estimateMaxBleed(self, context: QgsRenderContext) → float
Parameters

context (QgsRenderContext) –

Return type

float

hasDataDefinedProperties(self) → bool
Return type

bool

layerType(self) → str
Return type

str

renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters
renderSymbol(self, point: Union[QPointF, QPoint], feature: QgsFeature, context: QgsRenderContext, layer: int = - 1, selected: bool = False)
Parameters
  • point (Union[QPointF) –

  • feature (QgsFeature) –

  • context (QgsRenderContext) –

  • layer (int = -1) –

  • selected (bool = False) –

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

Restores older data defined properties from string map.

New in version 3.0.

rotateMarker(self) → bool

Shall the marker be rotated.

Return type

bool

Returns

True if the marker should be rotated.

Deprecated since version Use: rotateSymbols() instead.

setColor(self, color: Union[QColor, Qt.GlobalColor])
Parameters

color (Union[QColor) –

setCommonProperties(destLayer: QgsTemplatedLineSymbolLayerBase, properties: Dict[str, str])

Sets all common symbol properties in the destLayer, using the settings serialized in the properties map.

setDataDefinedProperty(self, key: QgsSymbolLayer.Property, property: QgsProperty)
Parameters
setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)
Parameters

unit (QgsUnitTypes.RenderUnit) –

setRotateMarker(self, rotate: bool)

Shall the marker be rotated.

Deprecated since version Use: setRotateSymbols() instead.

Parameters

rotate (bool) –

setSubSymbol(self, symbol: QgsSymbol) → bool
Parameters

symbol (QgsSymbol) –

Return type

bool

setSymbolAngle(self, angle: float)
Parameters

angle (float) –

setSymbolLineAngle(self, angle: float)
Parameters

angle (float) –

setWidth(self, width: float)
Parameters

width (float) –

startRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

stopRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

subSymbol(self)QgsSymbol
Return type

QgsSymbol

symbolAngle(self) → float
Return type

float

toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])
Parameters
  • doc (QDomDocument) –

  • element (QDomElement) –

  • props (Dict[str) –

usedAttributes(self, context: QgsRenderContext) → Set[str]
Parameters

context (QgsRenderContext) –

Return type

Set[str]

usesMapUnits(self) → bool
Return type

bool

width(self) → float

width(self, context: QgsRenderContext) -> float

Return type

float