Class: QgsMapUnitScale

Struct for storing maximum and minimum scales for measurements in map units.

For measurements in map units, a minimum and a maximum scale can be defined. Outside this range, the measurements aren’t scaled anymore proportionally to the map scale.

class qgis.core.QgsMapUnitScale[source]

Bases: object

__init__(minScale: float = 0, maxScale: float = 0)

Constructor for QgsMapUnitScale

Parameters:
  • minScale (float = 0) – minimum allowed scale, or 0.0 if no minimum scale set

  • maxScale (float = 0) – maximum allowed scale, or 0.0 if no maximum scale set The scale values indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

__init__(a0: QgsMapUnitScale)
Parameters:

a0 (QgsMapUnitScale)

computeMapUnitsPerPixel(self, c: QgsRenderContext) float[source]

Computes a map units per pixel scaling factor, respecting the minimum and maximum scales set for the object.

Parameters:

c (QgsRenderContext) – render context

Return type:

float

Returns:

map units per pixel, limited between minimum and maximum scales

isNull(self) bool[source]

Returns True if the scale is null, i.e. it is a default constructed QgsMapUnitScale.

Added in version 3.44.

Return type:

bool

maxScale: float
maxSizeMM: float
maxSizeMMEnabled: bool
minScale: float
minSizeMM: float
minSizeMMEnabled: bool