code: def canvasPressEvent(self, e):
          
          self.start_point = self.toMapCoordinates(e.pos())
          self.end_point = self.start_point
          self.is_emitting_point = True
  
          self.show_rectangle(self.start_point, self.end_point)
docs: Handle canvas press events so we know when user is capturing the rect.
  
          :param e: A Qt event object.
          :type: QEvent