Class: QgsSimpleMarkerSymbolLayer¶
-
class
qgis.core.
QgsSimpleMarkerSymbolLayer
(shape: QgsSimpleMarkerSymbolLayerBase.Shape = QgsSimpleMarkerSymbolLayerBase.Circle, size: float = DEFAULT_SIMPLEMARKER_SIZE, angle: float = DEFAULT_SIMPLEMARKER_ANGLE, scaleMethod: QgsSymbol.ScaleMethod = DEFAULT_SCALE_METHOD, color: Union[QColor, Qt.GlobalColor] = DEFAULT_SIMPLEMARKER_COLOR, strokeColor: Union[QColor, Qt.GlobalColor] = DEFAULT_SIMPLEMARKER_BORDERCOLOR, penJoinStyle: Qt.PenJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE)¶ Bases:
qgis._core.QgsSimpleMarkerSymbolLayerBase
Constructor for QgsSimpleMarkerSymbolLayer.
- Parameters
shape – symbol shape
size – symbol size (in mm)
angle – symbol rotation angle
scaleMethod – scaling method for data defined scaling
color – fill color for symbol
strokeColor – stroke color for symbol
penJoinStyle – join style for stroke pen
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
Enums
Methods
Creates a new QgsSimpleMarkerSymbolLayer.
Creates a new QgsSimpleMarkerSymbolLayer from an SLD XML element.
Draws the marker shape in the specified painter.
Returns the marker’s stroke join style (e.g., miter, bevel, etc).
Prepares cache image
Sets the marker’s stroke join style (e.g., miter, bevel, etc).
Sets the marker’s stroke color.
Sets the marker’s stroke style (e.g., solid, dashed, etc)
Sets the width of the marker’s stroke.
Sets the map scale for the width of the marker’s stroke.
Sets the unit for the width of the marker’s stroke.
Returns the marker’s stroke color.
Returns the marker’s stroke style (e.g., solid, dashed, etc)
Returns the width of the marker’s stroke.
Returns the map scale for the width of the marker’s stroke.
Returns the unit for the width of the marker’s stroke.
Signals
Attributes
-
bounds
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) → QRectF¶
-
calculateOffsetAndRotation
()¶
-
calculateSize
()¶
-
clone
(self) → QgsSimpleMarkerSymbolLayer¶
-
color
(self) → QColor¶
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶ Creates a new QgsSimpleMarkerSymbolLayer.
- Parameters
properties – a property map containing symbol properties (see properties())
- Returns
new QgsSimpleMarkerSymbolLayer
-
createFromSld
(element: QDomElement) → QgsSymbolLayer¶ Creates a new QgsSimpleMarkerSymbolLayer from an SLD XML element.
- Parameters
element – XML element containing SLD definition of symbol
- Returns
new QgsSimpleMarkerSymbolLayer
-
draw
()¶
-
drawMarker
(self, p: QPainter, context: QgsSymbolRenderContext)¶ Draws the marker shape in the specified painter.
- Parameters
p – destination QPainter
context – symbol context
Note
this method does not handle setting the painter pen or brush to match the symbol’s fill or stroke
-
fillColor
(self) → QColor¶
-
layerType
(self) → str¶
-
mapUnitScale
(self) → QgsMapUnitScale¶
-
markerOffset
()¶
-
markerOffset2
()¶
-
markerOffsetWithWidthAndHeight
()¶
-
ogrFeatureStyle
(self, mmScaleFactor: float, mapUnitScaleFactor: float) → str¶
-
outputUnit
(self) → QgsUnitTypes.RenderUnit¶
-
penJoinStyle
(self) → Qt.PenJoinStyle¶ Returns the marker’s stroke join style (e.g., miter, bevel, etc).
See also
See also
See also
New in version 2.16.
-
prepareCache
(self, context: QgsSymbolRenderContext) → bool¶ Prepares cache image
- Returns
True
in case of success,False
if cache image size too large
-
prepareMarkerPath
()¶
-
prepareMarkerShape
()¶
-
properties
(self) → Dict[str, str]¶
-
renderPoint
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)¶
-
restoreOldDataDefinedProperties
()¶
-
setColor
(self, color: Union[QColor, Qt.GlobalColor])¶
-
setFillColor
(self, color: Union[QColor, Qt.GlobalColor])¶
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶
-
setOutputUnit
(self, unit: QgsUnitTypes.RenderUnit)¶
-
setPenJoinStyle
(self, style: Qt.PenJoinStyle)¶ Sets the marker’s stroke join style (e.g., miter, bevel, etc).
- Parameters
style – join style
See also
See also
See also
New in version 2.16.
-
setStrokeColor
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets the marker’s stroke color.
- Parameters
color – stroke color
See also
See also
See also
-
setStrokeStyle
(self, strokeStyle: Qt.PenStyle)¶ Sets the marker’s stroke style (e.g., solid, dashed, etc)
- Parameters
strokeStyle – style
See also
See also
See also
New in version 2.4.
-
setStrokeWidth
(self, w: float)¶ Sets the width of the marker’s stroke.
- Parameters
w – stroke width. See strokeWidthUnit() for units.
See also
See also
See also
-
setStrokeWidthMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map scale for the width of the marker’s stroke.
- Parameters
scale – stroke width map unit scale
See also
See also
See also
-
setStrokeWidthUnit
(self, u: QgsUnitTypes.RenderUnit)¶ Sets the unit for the width of the marker’s stroke.
- Parameters
u – stroke width unit
See also
See also
See also
-
shapeToPolygon
()¶
-
startRender
(self, context: QgsSymbolRenderContext)¶
-
strokeColor
(self) → QColor¶ Returns the marker’s stroke color.
See also
See also
See also
-
strokeStyle
(self) → Qt.PenStyle¶ Returns the marker’s stroke style (e.g., solid, dashed, etc)
See also
See also
See also
New in version 2.4.
-
strokeWidth
(self) → float¶ Returns the width of the marker’s stroke.
See also
See also
See also
-
strokeWidthMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map scale for the width of the marker’s stroke.
See also
See also
See also
-
strokeWidthUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the unit for the width of the marker’s stroke.
See also
See also
See also
-
writeDxf
(self, e: QgsDxfExport, mmMapUnitScaleFactor: float, layerName: str, context: QgsSymbolRenderContext, shift: Union[QPointF, QPoint] = QPointF(0, 0)) → bool¶
-
writeSldMarker
(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])¶