Class: QgsVectorTileBasicLabelingStyle

Configuration of a single style within QgsVectorTileBasicLabeling.

Added in version 3.14.

class qgis.core.QgsVectorTileBasicLabelingStyle[source]

Bases: object

filterExpression(self) str[source]

Returns filter expression (empty filter means that all features match)

Return type:

str

geometryType(self) Qgis.GeometryType[source]

Returns type of the geometry that will be used (point / line / polygon)

Return type:

Qgis.GeometryType

isActive(self, zoomLevel: int) bool[source]

Returns whether the style is active at given zoom level (also checks “enabled” flag)

Parameters:

zoomLevel (int)

Return type:

bool

isEnabled(self) bool[source]

Returns whether this style is enabled (used for rendering)

Return type:

bool

labelSettings(self) QgsPalLayerSettings[source]

Returns labeling configuration of this style

Return type:

QgsPalLayerSettings

layerName(self) str[source]

Returns name of the sub-layer to render (empty layer means that all layers match)

Return type:

str

maxZoomLevel(self) int[source]

Returns the maximum zoom level index (negative number means no limit).

The style will be rendered if the zoom level is less than or equal to the maximum zoom.

Warning

This differs from the handling of the max zoom as defined in the MapBox Style Specifications, where the style is rendered only if the zoom level is less than the maximum zoom.

See also

minZoomLevel()

Return type:

int

minZoomLevel(self) int[source]

Returns the minimum zoom level index (negative number means no limit).

The style will be rendered if the zoom level is greater than or equal to the this level.

See also

maxZoomLevel()

Return type:

int

readXml(self, elem: QDomElement, context: QgsReadWriteContext)[source]

Reads object content from given DOM element

Parameters:
setEnabled(self, enabled: bool)[source]

Sets whether this style is enabled (used for rendering)

Parameters:

enabled (bool)

setFilterExpression(self, expr: str | None)[source]

Sets filter expression (empty filter means that all features match)

Parameters:

expr (Optional[str])

setGeometryType(self, geomType: Qgis.GeometryType)[source]

Sets type of the geometry that will be used (point / line / polygon)

Parameters:

geomType (Qgis.GeometryType)

setLabelSettings(self, settings: QgsPalLayerSettings)[source]

Sets labeling configuration of this style

Parameters:

settings (QgsPalLayerSettings)

setLayerName(self, name: str | None)[source]

Sets name of the sub-layer to render (empty layer means that all layers match)

Parameters:

name (Optional[str])

setMaxZoomLevel(self, maxZoom: int)[source]

Sets maximum zoom level index (negative number means no limit).

The style will be rendered if the zoom level is less than or equal to maxZoom.

Warning

This differs from the handling of the max zoom as defined in the MapBox Style Specifications, where the style is rendered only if the zoom level is less than the maximum zoom.

See also

maxZoomLevel()

Parameters:

maxZoom (int)

setMinZoomLevel(self, minZoom: int)[source]

Sets minimum zoom level index (negative number means no limit).

The style will be rendered if the zoom level is greater than or equal to minZoom.

See also

minZoomLevel()

Parameters:

minZoom (int)

setStyleName(self, name: str | None)[source]

Sets human readable name of this style

Parameters:

name (Optional[str])

styleName(self) str[source]

Returns human readable name of this style

Return type:

str

writeXml(self, elem: QDomElement, context: QgsReadWriteContext)[source]

Writes object content to given DOM element

Parameters: