Class: QgsMapBoxGlStyleConversionContext¶
- class qgis.core.QgsMapBoxGlStyleConversionContext¶
Bases:
sip.wrapper
Context for a MapBox GL style conversion operation.
Warning
This is private API only, and may change in future QGIS versions
New in version 3.16:
Methods
Clears the list of warning messages.
Returns the layer ID of the layer currently being converted.
Returns the pixel size conversion factor, used to scale the original pixel sizes when converting styles.
Pushes a
warning
message generated during the conversion.Sets the layer ID of the layer currently being converted.
Sets the pixel size conversion factor, used to scale the original pixel sizes when converting styles.
Sets the sprite
image
anddefinitions
JSON to use during conversion.Sets the target unit type.
Returns the sprite definitions to use during conversion.
Returns the sprite image to use during conversion, or an invalid image if this is not set.
Returns the target unit type.
Returns a list of warning messages generated during the conversion.
- clearWarnings(self)¶
Clears the list of warning messages.
- layerId(self) str ¶
Returns the layer ID of the layer currently being converted.
See also
- Return type
str
- pixelSizeConversionFactor(self) float ¶
Returns the pixel size conversion factor, used to scale the original pixel sizes when converting styles.
See also
- Return type
float
- pushWarning(self, warning: str)¶
Pushes a
warning
message generated during the conversion.- Parameters
warning (str) –
- setLayerId(self, value: str)¶
Sets the layer ID of the layer currently being converted.
See also
- Parameters
value (str) –
- setPixelSizeConversionFactor(self, sizeConversionFactor: float)¶
Sets the pixel size conversion factor, used to scale the original pixel sizes when converting styles.
See also
- Parameters
sizeConversionFactor (float) –
- setSprites(self, image: QImage, definitions: Dict[str, Any])¶
Sets the sprite
image
anddefinitions
JSON to use during conversion.See also
See also
setSprites(self, image: QImage, definitions: str) Sets the sprite
image
anddefinitions
JSON string to use during conversion.See also
See also
- Parameters
image (QImage) –
definitions (Dict[str) –
- setTargetUnit(self, targetUnit: QgsUnitTypes.RenderUnit)¶
Sets the target unit type.
By default this is
QgsUnitTypes
.RenderPixels in order to exactly match the original style rendering. But rendering in pixels can cause issues on hidpi displays or with print layouts, so setting a target unit ofQgsUnitTypes
.Millimeters or another real-world unit type is often more appropriate.If setting to a non-pixel unit, be sure to call
setPixelSizeConversionFactor()
in order to setup an appropriate pixel-to-unit conversion factor to scale converted sizes using. E.g. if the target unit is millimeters, the size conversion factor should be set to a pixel-to-millimeter value.See also
- Parameters
targetUnit (QgsUnitTypes.RenderUnit) –
- spriteDefinitions(self) Dict[str, Any] ¶
Returns the sprite definitions to use during conversion.
See also
See also
- Return type
Dict[str, Any]
- spriteImage(self) QImage ¶
Returns the sprite image to use during conversion, or an invalid image if this is not set.
See also
See also
- Return type
QImage
- targetUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the target unit type.
By default this is
QgsUnitTypes
.RenderPixels in order to exactly match the original style rendering. But rendering in pixels can cause issues on hidpi displays or with print layouts, so setting a target unit ofQgsUnitTypes
.Millimeters or another real-world unit type is often more appropriate.See also
- Return type
- warnings(self) List[str] ¶
Returns a list of warning messages generated during the conversion.
- Return type
List[str]