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;
316 static void parseSymbolLayer(
const QVariantMap &jsonLayer,
333 static bool parseSymbolLayerAsRenderer(
const QVariantMap &jsonLayer,
366 static QgsProperty parseInterpolateOpacityByZoom(
const QVariantMap &json,
int maxOpacity );
374 static QString parseOpacityStops(
double base,
const QVariantList &stops,
int maxOpacity );
391 const QVariantMap &conversionMap,
392 QString *defaultString
SIP_OUT =
nullptr );
424 const QVariantMap &conversionMap,
425 QString *defaultString
SIP_OUT =
nullptr );
434 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
443 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 );
476 static void colorAsHslaComponents(
const QColor &color,
int &hue,
int &saturation,
int &lightness,
int &alpha );
484 static QString interpolateExpression(
double zoomMin,
double zoomMax,
double valueMin,
double valueMax,
double base,
double multiplier = 1 );
491 static Qt::PenCapStyle parseCapStyle(
const QString &style );
498 static Qt::PenJoinStyle parseJoinStyle(
const QString &style );
521 static QString retrieveSpriteAsBase64(
const QVariant &value,
QgsMapBoxGlStyleConversionContext &context, QSize &spriteSize, QString &spriteProperty, QString &spriteSizeProperty );
530 static QString parseKey(
const QVariant &value );
533 QStringList mWarnings;
535 std::unique_ptr< QgsVectorTileRenderer > mRenderer;
536 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)