16 #ifndef QGSMAPBOXGLSTYLECONVERTER_H
17 #define QGSMAPBOXGLSTYLECONVERTER_H
19 #include "qgis_core.h"
22 #include <QVariantMap>
43 void pushWarning(
const QString &warning );
48 QStringList
warnings()
const {
return mWarnings; }
90 double pixelSizeConversionFactor()
const;
98 void setPixelSizeConversionFactor(
double sizeConversionFactor );
106 QImage spriteImage()
const;
114 QVariantMap spriteDefinitions()
const;
122 void setSprites(
const QImage &image,
const QVariantMap &definitions );
130 void setSprites(
const QImage &image,
const QString &definitions );
137 QString layerId()
const;
144 void setLayerId(
const QString &value );
148 QStringList mWarnings;
154 double mSizeConversionFactor = 1.0;
157 QVariantMap mSpriteDefinitions;
317 static void parseSymbolLayer(
const QVariantMap &jsonLayer,
334 static bool parseSymbolLayerAsRenderer(
const QVariantMap &jsonLayer,
392 const QVariantMap &conversionMap,
393 QString *defaultString
SIP_OUT =
nullptr );
432 const QVariantMap &conversionMap,
433 QString *defaultString
SIP_OUT =
nullptr );
442 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
451 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
459 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
493 static void colorAsHslaComponents(
const QColor &color,
int &hue,
int &saturation,
int &lightness,
int &alpha );
501 static QString interpolateExpression(
double zoomMin,
double zoomMax, QVariant valueMin, QVariant valueMax,
double base,
double multiplier = 1,
QgsMapBoxGlStyleConversionContext *contextPtr = 0 );
508 static Qt::PenCapStyle parseCapStyle(
const QString &style );
515 static Qt::PenJoinStyle parseJoinStyle(
const QString &style );
538 static QString retrieveSpriteAsBase64(
const QVariant &value,
QgsMapBoxGlStyleConversionContext &context, QSize &spriteSize, QString &spriteProperty, QString &spriteSizeProperty );
558 static bool numericArgumentsOnly(
const QVariant &bottomVariant,
const QVariant &topVariant,
double &bottom,
double &top );
561 QStringList mWarnings;
563 std::unique_ptr< QgsVectorTileRenderer > mRenderer;
564 std::unique_ptr< QgsVectorTileLabeling > mLabeling;
Context for a MapBox GL style conversion operation.
QStringList warnings() const
Returns a list of warning messages generated during the conversion.
void clearWarnings()
Clears the list of warning messages.
Handles conversion of MapBox GL styles to QGIS vector tile renderers and labeling settings.
PropertyType
Property types, for interpolated value conversion.
@ Numeric
Numeric property (e.g. line width, text size)
@ Opacity
Opacity property.
@ Point
Point/offset property.
~QgsMapBoxGlStyleConverter()
Result
Result of conversion.
QgsMapBoxGlStyleConverter & operator=(const QgsMapBoxGlStyleConverter &other)=delete
QgsMapBoxGlStyleConverter cannot be copied.
QString errorMessage() const
Returns a descriptive error message if an error was encountered during the style conversion,...
QStringList warnings() const
Returns a list of user-friendly warnings generated during the conversion, e.g.
QgsMapBoxGlStyleConverter(const QgsMapBoxGlStyleConverter &other)=delete
QgsMapBoxGlStyleConverter cannot be copied.
A store for object properties.
RenderUnit
Rendering size units.
Configuration of a single style within QgsVectorTileBasicLabeling.
Definition of map rendering of a subset of vector tile data.
Base class for labeling configuration classes for vector tile layers.
Abstract base class for all vector tile renderer implementations.
QgsExpressionNode * parseExpression(const QString &str, QString &parserErrorMsg, QList< QgsExpression::ParserError > &parserErrors)