Class: QgsLayoutItemMapOverviewStack

A collection of overviews which are drawn above the map content in a QgsLayoutItemMap. The overview stack controls which overviews are drawn and the order they are drawn in.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutItemMapOverviewStack

Base classes

QgsLayoutItemMapItemStack

A collection of map items which are drawn above the map content in a QgsLayoutItemMap. The item stack controls which items are drawn and the order they are drawn in.

Methods

addOverview

Adds a new map overview to the stack and takes ownership of the overview.

asList

Returns a list of QgsLayoutItemMapOverviews contained by the stack.

modifyMapLayerList

Alters the list of map layers which will be rendered for the link map item, inserting temporary layers which represent overview extents as required.

moveOverviewDown

Moves an overview with matching overviewId down the stack, causing it to be rendered below other overviews.

moveOverviewUp

Moves an overview with matching overviewId up the stack, causing it to be rendered above other overviews.

overview

Returns a reference to an overview with matching overviewId within the stack.

removeOverview

Removes an overview with matching overviewId from the stack and deletes the corresponding QgsLayoutItemMapOverview

class qgis.core.QgsLayoutItemMapOverviewStack[source]

Bases: QgsLayoutItemMapItemStack

__init__(map: QgsLayoutItemMap | None)

Constructor for QgsLayoutItemMapOverviewStack, attached to the specified map.

Parameters:

map (Optional[QgsLayoutItemMap])

__init__(a0: QgsLayoutItemMapOverviewStack)
Parameters:

a0 (QgsLayoutItemMapOverviewStack)

addOverview(self, overview: QgsLayoutItemMapOverview | None)[source]

Adds a new map overview to the stack and takes ownership of the overview. The overview will be added to the end of the stack, and rendered above any existing map overviews already present in the stack.

Note

After adding a overview to the stack, update() should be called for the QgsLayoutItemMap to prevent rendering artifacts.

See also

removeOverview()

Parameters:

overview (Optional[QgsLayoutItemMapOverview])

asList(self) List[QgsLayoutItemMapOverview]

Returns a list of QgsLayoutItemMapOverviews contained by the stack.

Return type:

List[QgsLayoutItemMapOverview]

modifyMapLayerList(self, layers: Iterable[QgsMapLayer]) List[QgsMapLayer]

Alters the list of map layers which will be rendered for the link map item, inserting temporary layers which represent overview extents as required.

Added in version 3.6.

Parameters:

layers (Iterable[QgsMapLayer])

Return type:

List[QgsMapLayer]

moveOverviewDown(self, overviewId: str | None)[source]

Moves an overview with matching overviewId down the stack, causing it to be rendered below other overviews.

Note

After moving an overview within the stack, update() should be called for the QgsLayoutItemMap to redraw the map with the new overview stack order.

See also

moveOverviewUp()

Parameters:

overviewId (Optional[str])

moveOverviewUp(self, overviewId: str | None)[source]

Moves an overview with matching overviewId up the stack, causing it to be rendered above other overviews.

Note

After moving an overview within the stack, update() should be called for the QgsLayoutItemMap to redraw the map with the new overview stack order.

Parameters:

overviewId (Optional[str])

overview(self, overviewId: str | None) QgsLayoutItemMapOverview | None[source]

Returns a reference to an overview with matching overviewId within the stack.

Parameters:

overviewId (Optional[str])

Return type:

Optional[QgsLayoutItemMapOverview]

overview(self, index: int) QgsLayoutItemMapOverview | None[source]

Returns a reference to an overview at the specified index within the stack.

Parameters:

index (int)

Return type:

Optional[QgsLayoutItemMapOverview]

removeOverview(self, overviewId: str | None)[source]

Removes an overview with matching overviewId from the stack and deletes the corresponding QgsLayoutItemMapOverview

Note

After removing an overview from the stack, update() should be called for the QgsLayoutItemMap to prevent rendering artifacts.

See also

addOverview()

Parameters:

overviewId (Optional[str])