Graphics Reference
In-Depth Information
Creating custom map canvas items
A map canvas item is an item that is placed on top of the map canvas. Standard map canvas
items include text annotations, vertex markers, and the visual highlighting of a feature. It is
also possible to create your own custom map canvas items by subclassing QgsMapCan-
vasItem . To see how this works, let's create a map canvas item that draws a compass rose
onto the map:
We'll start by creating the basic QgsMapCanvasItem subclass:
class CompassRoseItem(QgsMapCanvasItem):
def __init__(self, canvas):
QgsMapCanvasItem.__init__(self, canvas)
Search WWH ::




Custom Search