Skip to content

Commit

Permalink
Few bits from the review
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk authored and nyalldawson committed Apr 14, 2020
1 parent a3807cf commit 8ec0dc5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Expand Up @@ -131,7 +131,7 @@ sub-layer name, geometry type, filter expression, zoom range and label settings.

virtual QString type() const;

virtual QgsVectorTileLabeling *clone() const;
virtual QgsVectorTileLabeling *clone() const /Factory/;

virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;

Expand Down
3 changes: 3 additions & 0 deletions src/core/expression/qgsexpression.cpp
Expand Up @@ -772,6 +772,9 @@ void QgsExpression::initVariableHelp()
sVariableHelpTexts()->insert( QStringLiteral( "map_end_time" ), QCoreApplication::translate( "variable_help", "End of the map's temporal time range (as a datetime value)" ) );
sVariableHelpTexts()->insert( QStringLiteral( "map_interval" ), QCoreApplication::translate( "variable_help", "Duration of the map's temporal time range (as an interval value)" ) );

// vector tile layer variables
sVariableHelpTexts()->insert( QStringLiteral( "zoom_level" ), QCoreApplication::translate( "variable_help", "Zoom level of the tile that is being rendered (derived from the current map scale). Normally in interval [0, 20]." ) );

sVariableHelpTexts()->insert( QStringLiteral( "row_number" ), QCoreApplication::translate( "variable_help", "Stores the number of the current row." ) );
sVariableHelpTexts()->insert( QStringLiteral( "grid_number" ), QCoreApplication::translate( "variable_help", "Current grid annotation value." ) );
sVariableHelpTexts()->insert( QStringLiteral( "grid_axis" ), QCoreApplication::translate( "variable_help", "Current grid annotation axis (e.g., 'x' for longitude, 'y' for latitude)." ) );
Expand Down
13 changes: 13 additions & 0 deletions src/core/labeling/qgspallabeling.cpp
Expand Up @@ -499,6 +499,19 @@ QSet<QString> QgsPalLayerSettings::referencedFields() const
}

referenced.unite( mDataDefinedProperties.referencedFields( QgsExpressionContext(), true ) );

if ( geometryGeneratorEnabled )
{
QgsExpression geomGeneratorExpr( geometryGenerator );
referenced.unite( geomGeneratorExpr.referencedColumns() );
}

if ( mCallout )
{
// TODO: this needs further attention
referenced.unite( mCallout->referencedFields( QgsRenderContext() ) );
}

return referenced;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/vectortile/qgsvectortilebasiclabeling.h
Expand Up @@ -110,7 +110,7 @@ class CORE_EXPORT QgsVectorTileBasicLabeling : public QgsVectorTileLabeling
QgsVectorTileBasicLabeling();

QString type() const override;
QgsVectorTileLabeling *clone() const override;
QgsVectorTileLabeling *clone() const override SIP_FACTORY;
QgsVectorTileLabelProvider *provider( QgsVectorTileLayer *layer ) const override SIP_SKIP;
void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
Expand Down

0 comments on commit 8ec0dc5

Please sign in to comment.