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:
QgsSimpleMarkerSymbolLayerBase
Constructor for QgsSimpleMarkerSymbolLayer.
- Parameters
shape (QgsSimpleMarkerSymbolLayerBase.Shape = QgsSimpleMarkerSymbolLayerBase.Circle) – symbol shape
size (float = DEFAULT_SIMPLEMARKER_SIZE) – symbol size (in mm)
angle (float = DEFAULT_SIMPLEMARKER_ANGLE) – symbol rotation angle
scaleMethod (QgsSymbol.ScaleMethod = DEFAULT_SCALE_METHOD) – scaling method for data defined scaling
color (Union[QColor) – fill color for symbol
strokeColor (Union[QColor) – stroke color for symbol
penJoinStyle (Qt.PenJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE) – join style for stroke pen
QgsSimpleMarkerSymbolLayer(
QgsSimpleMarkerSymbolLayer
)Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
Methods
- param point
- rtype
QgsSimpleMarkerSymbolLayer
- rtype
QColor
Creates a new QgsSimpleMarkerSymbolLayer.
Creates a new
QgsSimpleMarkerSymbolLayer
from an SLD XML element.Draws the marker shape in the specified painter.
- rtype
QColor
- rtype
str
- rtype
QgsMapUnitScale
- param mmScaleFactor
- rtype
QgsUnitTypes.RenderUnit
Returns the marker’s stroke join style (e.g., miter, bevel, etc).
Prepares cache image
- rtype
Dict[str, str]
- param point
- param color
- param color
- param scale
- param unit
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.
- param context
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.
- param e
- param doc
-
bounds
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) → QRectF¶ - Parameters
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- Return type
QRectF
-
calculateOffsetAndRotation
()¶
-
calculateSize
()¶
-
clone
(self) → QgsSimpleMarkerSymbolLayer¶ - Return type
-
color
(self) → QColor¶ - Return type
QColor
-
copyDataDefinedProperties
()¶
-
copyPaintEffect
()¶
-
create
(properties: Dict[str, str] = {}) → QgsSymbolLayer¶ Creates a new QgsSimpleMarkerSymbolLayer.
- Parameters
properties (Dict[str) – a property map containing symbol properties (see properties())
- Return type
- Returns
new QgsSimpleMarkerSymbolLayer
-
createFromSld
(element: QDomElement) → QgsSymbolLayer¶ Creates a new
QgsSimpleMarkerSymbolLayer
from an SLD XML element.- Parameters
element (QDomElement) – XML element containing SLD definition of symbol
- Return type
- Returns
new QgsSimpleMarkerSymbolLayer
-
draw
()¶
-
drawMarker
(self, p: QPainter, context: QgsSymbolRenderContext)¶ Draws the marker shape in the specified painter.
- Parameters
p (QPainter) – destination QPainter
context (QgsSymbolRenderContext) – 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¶ - Return type
QColor
-
layerType
(self) → str¶ - Return type
str
-
mapUnitScale
(self) → QgsMapUnitScale¶ - Return type
-
markerOffset
()¶
-
markerOffset2
()¶
-
markerOffsetWithWidthAndHeight
()¶
-
ogrFeatureStyle
(self, mmScaleFactor: float, mapUnitScaleFactor: float) → str¶ - Parameters
mmScaleFactor (float) –
mapUnitScaleFactor (float) –
- Return type
str
-
outputUnit
(self) → QgsUnitTypes.RenderUnit¶ - Return type
-
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.
- Return type
Qt.PenJoinStyle
-
prepareCache
(self, context: QgsSymbolRenderContext) → bool¶ Prepares cache image
- Return type
bool
- Returns
true in case of success, false if cache image size too large
- Parameters
context (QgsSymbolRenderContext) –
-
prepareMarkerPath
()¶
-
prepareMarkerShape
()¶
-
properties
(self) → Dict[str, str]¶ - Return type
Dict[str, str]
-
renderPoint
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)¶ - Parameters
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
-
restoreOldDataDefinedProperties
()¶
-
setColor
(self, color: Union[QColor, Qt.GlobalColor])¶ - Parameters
color (Union[QColor) –
-
setFillColor
(self, color: Union[QColor, Qt.GlobalColor])¶ - Parameters
color (Union[QColor) –
-
setMapUnitScale
(self, scale: QgsMapUnitScale)¶ - Parameters
scale (QgsMapUnitScale) –
-
setOutputUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ - Parameters
unit (QgsUnitTypes.RenderUnit) –
-
setPenJoinStyle
(self, style: Qt.PenJoinStyle)¶ Sets the marker’s stroke join style (e.g., miter, bevel, etc).
- Parameters
style (Qt.PenJoinStyle) – 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 (Union[QColor) – 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 (Qt.PenStyle) – 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 (float) – 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 (QgsMapUnitScale) – 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 (QgsUnitTypes.RenderUnit) – stroke width unit
See also
See also
See also
-
shapeToPolygon
()¶
-
startRender
(self, context: QgsSymbolRenderContext)¶ - Parameters
context (QgsSymbolRenderContext) –
-
strokeColor
(self) → QColor¶ Returns the marker’s stroke color.
See also
See also
See also
- Return type
QColor
-
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.
- Return type
Qt.PenStyle
-
strokeWidth
(self) → float¶ Returns the width of the marker’s stroke.
See also
See also
See also
- Return type
float
-
strokeWidthMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map scale for the width of the marker’s stroke.
See also
See also
See also
- Return type
-
strokeWidthUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the unit for the width of the marker’s stroke.
See also
See also
See also
- Return type
-
writeDxf
(self, e: QgsDxfExport, mmMapUnitScaleFactor: float, layerName: str, context: QgsSymbolRenderContext, shift: Union[QPointF, QPoint] = QPointF(0, 0)) → bool¶ - Parameters
e (QgsDxfExport) –
mmMapUnitScaleFactor (float) –
layerName (str) –
context (QgsSymbolRenderContext) –
shift (Union[QPointF) –
- Return type
bool
-
writeSldMarker
(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str])¶ - Parameters
doc (QDomDocument) –
element (QDomElement) –
props (Dict[str) –