Class: QgsLayoutItemMapOverview

An individual overview which is drawn above the map content in a QgsLayoutItemMap, and shows the extent of another QgsLayoutItemMap.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutItemMapOverview

Base classes

QgsLayoutItemMapItem

An item which is drawn inside a QgsLayoutItemMap, e.g., a grid or map overview.

QgsLayoutObject

A base class for objects which belong to a layout.

QObject

QgsExpressionContextGenerator

Abstract interface for generating an expression context.

class qgis.core.QgsLayoutItemMapOverview[source]

Bases: QgsLayoutItemMapItem

__init__(name: str | None, map: QgsLayoutItemMap | None)

Constructor for QgsLayoutItemMapOverview.

Parameters:
asMapLayer(self) QgsVectorLayer | None[source]

Returns a vector layer to render as part of the QgsLayoutItemMap render, containing a feature representing the overview extent (and with an appropriate renderer set matching the overview’s frameSymbol() ).

Ownership of the layer remain with the overview item.

Added in version 3.6.

Return type:

Optional[QgsVectorLayer]

blendMode(self) QPainter.CompositionMode[source]

Retrieves the blending mode used for drawing the overview.

See also

setBlendMode()

Return type:

QPainter.CompositionMode

centered(self) bool[source]

Returns whether the extent of the map is forced to center on the overview.

See also

setCentered()

Return type:

bool

connectSignals(self)[source]

Reconnects signals for overview map, so that overview correctly follows changes to source map’s extent.

frameSymbol(self) QgsFillSymbol | None[source]

Returns the fill symbol used for drawing the overview extent.

See also

setFrameSymbol()

Return type:

Optional[QgsFillSymbol]

inverted(self) bool[source]

Returns whether the overview frame is inverted, ie, whether the shaded area is drawn outside the extent of the overview map.

See also

setInverted()

Return type:

bool

linkedMap(self) QgsLayoutItemMap | None[source]

Returns the source map to show the overview extent of.

See also

setLinkedMap()

Return type:

Optional[QgsLayoutItemMap]

overviewExtentChanged(self)[source]

Handles recentering of the map and redrawing of the map’s overview

setBlendMode(self, mode: QPainter.CompositionMode)[source]

Sets the blending mode used for drawing the overview.

See also

blendMode()

Parameters:

mode (QPainter.CompositionMode)

setCentered(self, centered: bool)[source]

Sets whether the extent of the map is forced to center on the overview

See also

centered()

Parameters:

centered (bool)

setFrameSymbol(self, symbol: QgsFillSymbol | None)[source]

Sets the fill symbol used for drawing the overview extent. Ownership is transferred to the overview.

See also

frameSymbol()

Parameters:

symbol (Optional[QgsFillSymbol])

setInverted(self, inverted: bool)[source]

Sets whether the overview frame is inverted, ie, whether the shaded area is drawn outside the extent of the overview map.

See also

inverted()

Parameters:

inverted (bool)

setLinkedMap(self, map: QgsLayoutItemMap | None)[source]

Sets the map to show the overview extent of.

See also

linkedMap()

Parameters:

map (Optional[QgsLayoutItemMap])