Class: QgsVectorTileBasicRenderer

class qgis.core.QgsVectorTileBasicRenderer

Bases: QgsVectorTileRenderer

Constructs renderer with no styles

QgsVectorTileBasicRenderer(QgsVectorTileBasicRenderer)

The default vector tile renderer implementation. It has an ordered list of “styles”, each defines a rendering rule.

Methods

clone

rtype

QgsVectorTileBasicRenderer

readXml

param elem

renderTile

param tile

requiredLayers

param context

setStyle

Updates style definition at the paricular index of the list (the index must be in interval [0,N-1] otherwise this function does nothing)

setStyles

Sets list of styles of the renderer

simpleStyle

Returns a list of styles to render all layers with the given fill/stroke colors, stroke widths and marker sizes

simpleStyleWithRandomColors

Returns a list of styles to render all layers, using random colors

startRender

param context

stopRender

param context

style

Returns style definition at the particular index

styles

Returns list of styles of the renderer

type

rtype

str

writeXml

param elem

clone(self)QgsVectorTileBasicRenderer
Return type

QgsVectorTileBasicRenderer

readXml(self, elem: QDomElement, context: QgsReadWriteContext)
Parameters
renderTile(self, tile: QgsVectorTileRendererData, context: QgsRenderContext)
Parameters
requiredLayers(self, context: QgsRenderContext, tileZoom: int) → Set[str]
Parameters
Return type

Set[str]

setStyle(self, index: int, style: QgsVectorTileBasicRendererStyle)

Updates style definition at the paricular index of the list (the index must be in interval [0,N-1] otherwise this function does nothing)

Parameters
setStyles(self, styles: Iterable[QgsVectorTileBasicRendererStyle])

Sets list of styles of the renderer

Parameters

styles (Iterable[QgsVectorTileBasicRendererStyle]) –

simpleStyle(polygonFillColor: Union[QColor, Qt.GlobalColor], polygonStrokeColor: Union[QColor, Qt.GlobalColor], polygonStrokeWidth: float, lineStrokeColor: Union[QColor, Qt.GlobalColor], lineStrokeWidth: float, pointFillColor: Union[QColor, Qt.GlobalColor], pointStrokeColor: Union[QColor, Qt.GlobalColor], pointSize: float) → List[QgsVectorTileBasicRendererStyle]

Returns a list of styles to render all layers with the given fill/stroke colors, stroke widths and marker sizes

Parameters
  • polygonFillColor (Union[QColor) –

  • polygonStrokeColor (Union[QColor) –

  • polygonStrokeWidth (float) –

  • lineStrokeColor (Union[QColor) –

  • lineStrokeWidth (float) –

  • pointFillColor (Union[QColor) –

  • pointStrokeColor (Union[QColor) –

  • pointSize (float) –

Return type

List[QgsVectorTileBasicRendererStyle]

simpleStyleWithRandomColors() → List[QgsVectorTileBasicRendererStyle]

Returns a list of styles to render all layers, using random colors

Return type

List[QgsVectorTileBasicRendererStyle]

startRender(self, context: QgsRenderContext, tileZoom: int, tileRange: QgsTileRange)
Parameters
stopRender(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

style(self, index: int)QgsVectorTileBasicRendererStyle

Returns style definition at the particular index

Parameters

index (int) –

Return type

QgsVectorTileBasicRendererStyle

styles(self) → List[QgsVectorTileBasicRendererStyle]

Returns list of styles of the renderer

Return type

List[QgsVectorTileBasicRendererStyle]

type(self) → str
Return type

str

writeXml(self, elem: QDomElement, context: QgsReadWriteContext)
Parameters