QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
16 #ifndef QGSVECTORTILEBASICLABELING_H
17 #define QGSVECTORTILEBASICLABELING_H
78 return mEnabled && ( mMinZoomLevel == -1 || zoomLevel >= mMinZoomLevel ) && ( mMaxZoomLevel == -1 || zoomLevel <= mMaxZoomLevel );
92 int mMinZoomLevel = -1;
93 int mMaxZoomLevel = -1;
112 QString
type()
const override;
119 void setStyles(
const QList<QgsVectorTileBasicLabelingStyle> &styles ) { mStyles = styles; }
121 QList<QgsVectorTileBasicLabelingStyle>
styles()
const {
return mStyles; }
129 QList<QgsVectorTileBasicLabelingStyle> mStyles;
147 QList<QgsAbstractLabelProvider *>
subProviders()
override;
154 void setFields(
const QMap<QString, QgsFields> &perLayerFields )
override;
157 QList<QgsVectorTileBasicLabelingStyle> mStyles;
160 QList<QgsVectorLayerLabelProvider *> mSubProviders;
171 #endif // QGSVECTORTILEBASICLABELING_H
void setGeometryType(QgsWkbTypes::GeometryType geomType)
Sets type of the geometry that will be used (point / line / polygon)
Implements a map layer that is dedicated to rendering of vector tiles.
QSet< QString > requiredLayers(QgsRenderContext &context, int tileZoom) const override
Returns a list of the layers required for labeling.
bool isActive(int zoomLevel) const
Returns whether the style is active at given zoom level (also checks "enabled" flag)
The class is used as a container of context for various read/write operations on other objects.
void registerTileFeatures(const QgsVectorTileRendererData &tile, QgsRenderContext &context) override
Registers label features for given tile to the labeling engine.
void setLabelSettings(const QgsPalLayerSettings &settings)
Sets labeling configuration of this style.
Configuration of a single style within QgsVectorTileBasicLabeling.
Internal base class for implementation of label providers for vector tile labeling.
Contains information about the context of a rendering operation.
Basic labeling configuration for vector tile layers.
QgsWkbTypes::GeometryType geometryType() const
Returns type of the geometry that will be used (point / line / polygon)
Contains decoded features of a single vector tile and any other data necessary for rendering of it.
void setMaxZoomLevel(int maxZoom)
Sets maximum zoom level index (negative number means no limit)
void setStyle(int index, const QgsVectorTileBasicLabelingStyle &style)
Updates style definition at the paricular index of the list (the index must be in interval [0,...
QString filterExpression() const
Returns filter expression (empty filter means that all features match)
virtual QgsVectorTileLabelProvider * provider(QgsVectorTileLayer *layer) const SIP_SKIP
Factory for label provider implementation.
Implementation class for QgsVectorTileBasicLabeling.
void setEnabled(bool enabled)
Sets whether this style is enabled (used for rendering)
void setLayerName(const QString &name)
Sets name of the sub-layer to render (empty layer means that all layers match)
int maxZoomLevel() const
Returns maxnimum zoom level index (negative number means no limit)
QString styleName() const
Returns human readable name of this style.
QList< QgsAbstractLabelProvider * > subProviders() override
Returns list of child providers - useful if the provider needs to put labels into more layers with di...
QgsVectorTileBasicLabelProvider(QgsVectorTileLayer *layer, const QList< QgsVectorTileBasicLabelingStyle > &styles)
Constructs a label provider for the given vector tile layer and using styling from QgsVectorTileBasic...
bool isEnabled() const
Returns whether this style is enabled (used for rendering)
QgsVectorTileBasicLabelingStyle style(int index) const
Returns style definition at the particular index.
void setFields(const QMap< QString, QgsFields > &perLayerFields) override
Sets fields for each sub-layer.
virtual QgsVectorTileLabeling * clone() const =0SIP_FACTORY
Returns a new copy of the object.
QMap< QString, QgsFields > mPerLayerFields
Names of required fields for each sub-layer (only valid between startRender/stopRender calls)
void setStyleName(const QString &name)
Sets human readable name of this style.
void setFilterExpression(const QString &expr)
Sets filter expression (empty filter means that all features match)
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
virtual QString type() const =0
Unique type string of the labeling configuration implementation.
QgsMapLayer * layer() const
Returns the associated layer, or nullptr if no layer is associated with the provider.
QList< QgsVectorTileBasicLabelingStyle > styles() const
Returns list of styles of the renderer.
Base class for labeling configuration classes for vector tile layers.
QgsPalLayerSettings labelSettings() const
Returns labeling configuration of this style.
QMap< QString, QSet< QString > > usedAttributes(const QgsRenderContext &context, int tileZoom) const override
Returns field names for each sub-layer that are required for labeling.
void setMinZoomLevel(int minZoom)
Sets minimum zoom level index (negative number means no limit)
bool prepare(QgsRenderContext &context, QSet< QString > &attributeNames) override
Prepare for registration of features.
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads labeling properties from given XML element.
int minZoomLevel() const
Returns minimum zoom level index (negative number means no limit)
QString layerName() const
Returns name of the sub-layer to render (empty layer means that all layers match)
virtual void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const =0
Writes labeling properties to given XML element.
void setStyles(const QList< QgsVectorTileBasicLabelingStyle > &styles)
Sets list of styles of the renderer.