16 #ifndef QGSMAPBOXGLSTYLECONVERTER_H
17 #define QGSMAPBOXGLSTYLECONVERTER_H
19 #include "qgis_core.h"
22 #include <QVariantMap>
44 void pushWarning(
const QString &warning );
49 QStringList
warnings()
const {
return mWarnings; }
91 double pixelSizeConversionFactor()
const;
99 void setPixelSizeConversionFactor(
double sizeConversionFactor );
107 QImage spriteImage()
const;
115 QVariantMap spriteDefinitions()
const;
123 void setSprites(
const QImage &image,
const QVariantMap &definitions );
131 void setSprites(
const QImage &image,
const QString &definitions );
138 QString layerId()
const;
145 void setLayerId(
const QString &value );
149 QStringList mWarnings;
155 double mSizeConversionFactor = 1.0;
158 QVariantMap mSpriteDefinitions;
318 static void parseSymbolLayer(
const QVariantMap &jsonLayer,
335 static bool parseSymbolLayerAsRenderer(
const QVariantMap &jsonLayer,
393 const QVariantMap &conversionMap,
394 QString *defaultString
SIP_OUT =
nullptr );
433 const QVariantMap &conversionMap,
434 QString *defaultString
SIP_OUT =
nullptr );
443 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
452 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
460 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
494 static void colorAsHslaComponents(
const QColor &color,
int &hue,
int &saturation,
int &lightness,
int &alpha );
502 static QString interpolateExpression(
double zoomMin,
double zoomMax, QVariant valueMin, QVariant valueMax,
double base,
double multiplier = 1,
QgsMapBoxGlStyleConversionContext *contextPtr = 0 );
509 static Qt::PenCapStyle parseCapStyle(
const QString &style );
516 static Qt::PenJoinStyle parseJoinStyle(
const QString &style );
539 static QString retrieveSpriteAsBase64(
const QVariant &value,
QgsMapBoxGlStyleConversionContext &context, QSize &spriteSize, QString &spriteProperty, QString &spriteSizeProperty );
559 static bool numericArgumentsOnly(
const QVariant &bottomVariant,
const QVariant &topVariant,
double &bottom,
double &top );
562 QStringList mWarnings;
564 std::unique_ptr< QgsVectorTileRenderer > mRenderer;
565 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)