The last major functionality we will examine is the ability to edit LineString and Polygon features. Just as the
CaptureTool allowed the user to click and drag to create new lines and polygons, we will implement
EditTool, which lets the user click and drag to move the existing feature's vertices. The following image shows what the user will see when they use this tool to move a vertex:
Our editing tool will also let the user add new vertices by double-clicking on a line segment, and delete vertices by right-clicking on the same line segment.
Let's define our
class EditTool(QgsMapTool): def __init__(self, mapCanvas, ...