Class: QgsLayoutItemMapOverviewStack¶
- class qgis.core.QgsLayoutItemMapOverviewStack¶
Bases:
QgsLayoutItemMapItemStack
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.See also
QgsLayoutItemMapOverviewStack(map:
QgsLayoutItemMap
) Constructor forQgsLayoutItemMapOverviewStack
, attached to the specifiedmap
.QgsLayoutItemMapOverviewStack(
QgsLayoutItemMapOverviewStack
)Methods
Adds a new map item to the stack and takes ownership of the item.
Adds a new map
overview
to the stack and takes ownership of the overview.Returns a list of
QgsLayoutItemMapOverviews
contained by the stack.Returns a reference to the item at the specified
index
within the stack.Alters the list of map
layers
which will be rendered for the link map item, inserting temporary layers which represent overview extents as required.Moves an item which matching
itemId
up the stack, causing it to be rendered above other items.Moves an item which matching
itemId
up the stack, causing it to be rendered above other items.Moves an overview with matching overviewId down the stack, causing it to be rendered below other overviews.
Moves an overview with matching overviewId up the stack, causing it to be rendered above other overviews.
Returns a reference to an overview with matching overviewId within the stack.
- param elem:
Removes an item which matching
itemId
from the stack and deletes the correspondingQgsLayoutItemMapItem
Clears the item stack and deletes all
QgsLayoutItemMapItems
contained by the stackRemoves 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 theQgsLayoutItemMap
to prevent rendering artifacts.See also
- 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 theQgsLayoutItemMap
to prevent rendering artifacts.See also
- 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 theQgsLayoutItemMap
to redraw the map with the new item stack order.See also
- 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 theQgsLayoutItemMap
to redraw the map with the new item stack order.See also
- 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 theQgsLayoutItemMap
to redraw the map with the new overview stack order.See also
- 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 theQgsLayoutItemMap
to redraw the map with the new overview stack order.See also
- 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:
- readXml(self, elem: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) bool ¶
- Parameters:
elem (QDomElement) –
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool
- removeItem(self, itemId: str)¶
Removes an item which matching
itemId
from the stack and deletes the correspondingQgsLayoutItemMapItem
Note
After removing an item from the stack,
update()
should be called for theQgsLayoutItemMap
to prevent rendering artifacts.See also
- 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 theQgsLayoutItemMap
to prevent rendering artifacts.See also
- Parameters:
overviewId (str) –