def __init__(self, canvas):
        """Constructor for the map tool.

        :param canvas: Canvas that tool will interact with.
        :type canvas: QgsMapCanvas
        """
        self.canvas = canvas
        self.start_point = None
        self.end_point = None
        self.is_emitting_point = False

        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubber_band = QgsRubberBand(
            self.canvas, geometryType=QgsWkbTypes.LineGeometry)
        self.rubber_band.setColor(QColor(0, 0, 240, 100))
        # Needs QGIS 2.6
        # self.rubber_band.setFillColor(QColor(0, 0, 240, 0))
        self.rubber_band.setWidth(1)

        self.reset()
def __init__ ( self , canvas ) : self . canvas = canvas self . start_point = None self . end_point = None self . is_emitting_point = False QgsMapToolEmitPoint . __init__ ( self , self . canvas ) self . rubber_band = QgsRubberBand ( self . canvas , geometryType = QgsWkbTypes . LineGeometry ) self . rubber_band . setColor ( QColor ( 0 , 0 , 240 , 100 ) ) self . rubber_band . setWidth ( 1 ) self . reset ( )
Constructor for the map tool.

        :param canvas: Canvas that tool will interact with.
        :type canvas: QgsMapCanvas