Class: QgsLayoutItemMapOverview

class qgis.core.QgsLayoutItemMapOverview

Bases: QgsLayoutItemMapItem

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

QgsLayoutItemMapOverview(name: Optional[str], map: Optional[QgsLayoutItemMap]) Constructor for QgsLayoutItemMapOverview.

Parameters:
accept(self, visitor: QgsStyleEntityVisitorInterface | None) bool
Parameters:

visitor (Optional[QgsStyleEntityVisitorInterface])

Return type:

bool

asMapLayer(self) QgsVectorLayer | None

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

Retrieves the blending mode used for drawing the overview.

See also

setBlendMode()

Return type:

QPainter.CompositionMode

centered(self) bool

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

See also

setCentered()

Return type:

bool

childEvent(self, a0: QChildEvent | None)
connectNotify(self, signal: QMetaMethod)
connectSignals(self)

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

customEvent(self, a0: QEvent | None)
disconnectNotify(self, signal: QMetaMethod)
draw(self, painter: QPainter | None)
Parameters:

painter (Optional[QPainter])

finalizeRestoreFromXml(self)
frameSymbol(self) QgsFillSymbol | None

Returns the fill symbol used for drawing the overview extent.

See also

setFrameSymbol()

Return type:

Optional[QgsFillSymbol]

inverted(self) bool

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

isSignalConnected(self, signal: QMetaMethod) bool
linkedMap(self) QgsLayoutItemMap | None

Returns the source map to show the overview extent of.

See also

setLinkedMap()

Return type:

Optional[QgsLayoutItemMap]

mapLayer(self) QgsMapLayer | None
Return type:

Optional[QgsMapLayer]

overviewExtentChanged(self)

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

readObjectPropertiesFromElement(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool

Sets object properties from a DOM element

Parameters:
  • parentElement – is the parent DOM element for the object

  • document – DOM document

  • context – read write context

Returns:

True if read was successful

readXml(self, itemElem: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) bool
Parameters:
Return type:

bool

receivers(self, signal: PYQT_SIGNAL) int
sender(self) QObject | None
senderSignalIndex(self) int
setBlendMode(self, mode: QPainter.CompositionMode)

Sets the blending mode used for drawing the overview.

See also

blendMode()

Parameters:

mode (QPainter.CompositionMode)

setCentered(self, centered: bool)

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)

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)

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)

Sets the map to show the overview extent of.

See also

linkedMap()

Parameters:

map (Optional[QgsLayoutItemMap])

timerEvent(self, a0: QTimerEvent | None)
usesAdvancedEffects(self) bool
Return type:

bool

writeObjectPropertiesToElement(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool

Stores object properties within an XML DOM element.

Parameters:
  • parentElement – is the parent DOM element to store the object’s properties in

  • document – DOM document

  • context – read write context

Returns:

True if write was successful

writeXml(self, elem: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) bool
Parameters:
Return type:

bool