Class: QgsLayoutItemMapOverviewStack

class qgis.core.QgsLayoutItemMapOverviewStack(map: QgsLayoutItemMap)

Bases: QgsLayoutItemMapItemStack

Constructor for QgsLayoutItemMapOverviewStack, attached to the specified map.

QgsLayoutItemMapOverviewStack(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.

Methods

addItem

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

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.

item

Returns a reference to the item at the specified index within 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.

moveItemDown

Moves an item which matching itemId up the stack, causing it to be rendered above other items.

moveItemUp

Moves an item which matching itemId up the stack, causing it to be rendered above other items.

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.

readXml

param elem

removeItem

Removes an item which matching itemId from the stack and deletes the corresponding QgsLayoutItemMapItem

removeItems

Clears the item stack and deletes all QgsLayoutItemMapItems contained by the stack

removeOverview

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

addItem(self, item: QgsLayoutItemMapItem)

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

Note

After adding an item to the stack update() should be called for the QgsLayoutItemMap to prevent rendering artifacts.

See also

removeItem()

addOverview(self, overview: QgsLayoutItemMapOverview)

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 (QgsLayoutItemMapOverview) –

asList(self)List[QgsLayoutItemMapOverview]

Returns a list of QgsLayoutItemMapOverviews contained by the stack.

Return type

List[QgsLayoutItemMapOverview]

item(self, index: int)QgsLayoutItemMapItem

Returns a reference to the item at the specified index within the stack.

item(self, itemId: str) -> QgsLayoutItemMapItem Returns a reference to an item which matching itemId within the stack.

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.

New in version 3.6.

Parameters

layers (Iterable[QgsMapLayer]) –

Return type

List[QgsMapLayer]

moveItemDown(self, itemId: str)

Moves an item which matching itemId up the stack, causing it to be rendered above other items.

Note

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

See also

moveItemUp()

moveItemUp(self, itemId: str)

Moves an item which matching itemId up the stack, causing it to be rendered above other items.

Note

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

See also

moveItemDown()

moveOverviewDown(self, overviewId: str)

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 (str) –

moveOverviewUp(self, overviewId: str)

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 (str) –

overview(self, overviewId: str)QgsLayoutItemMapOverview

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

overview(self, index: int) -> QgsLayoutItemMapOverview Returns a reference to an overview at the specified index within the stack.

Parameters

overviewId (str) –

Return type

QgsLayoutItemMapOverview

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

bool

removeItem(self, itemId: str)

Removes an item which matching itemId from the stack and deletes the corresponding QgsLayoutItemMapItem

Note

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

See also

addItem()

removeItems(self)

Clears the item stack and deletes all QgsLayoutItemMapItems contained by the stack

removeOverview(self, overviewId: str)

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 (str) –