Class: QgsVectorTileRenderer

class qgis.core.QgsVectorTileRenderer

Bases: sip.wrapper

Abstract base class for all vector tile renderer implementations.

For rendering it is expected that client code calls:

# startRender() to prepare renderer # renderTile() for each tile # stopRender() to clean up renderer and free resources

Methods

clone

Returns a clone of the renderer

readXml

Reads renderer’s properties from given XML element

renderTile

Renders given vector tile.

requiredLayers

Returns a list of the layers required for rendering.

resolveReferences

Resolves references to other objects - second phase of loading - after readXml()

startRender

Initializes rendering.

stopRender

Finishes rendering and cleans up any resources

type

Returns unique type name of the renderer implementation

writeXml

Writes renderer’s properties to given XML element

clone(self)QgsVectorTileRenderer

Returns a clone of the renderer

Return type

QgsVectorTileRenderer

readXml(self, elem: QDomElement, context: QgsReadWriteContext)

Reads renderer’s properties from given XML element

Parameters
renderTile(self, tile: QgsVectorTileRendererData, context: QgsRenderContext)

Renders given vector tile. Must be called between startRender/stopRender.

Parameters
requiredLayers(self, context: QgsRenderContext, tileZoom: int) → Set[str]

Returns a list of the layers required for rendering.

Only layers which are visible at the specified tileZoom should be included in this list.

An empty string present in the list indicates that all layer in the tiles are required.

New in version 3.16.

Parameters
Return type

Set[str]

resolveReferences(self, project: QgsProject)

Resolves references to other objects - second phase of loading - after readXml()

Parameters

project (QgsProject) –

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

Initializes rendering. It should be paired with a stopRender() call.

Parameters
stopRender(self, context: QgsRenderContext)

Finishes rendering and cleans up any resources

Parameters

context (QgsRenderContext) –

type(self) → str

Returns unique type name of the renderer implementation

Return type

str

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

Writes renderer’s properties to given XML element

Parameters