code: def drag_rectangle_on_map_canvas(self):
          
  
          self.hide()
          self.rectangle_map_tool.reset()
          self.canvas.unsetMapTool(self.pan_tool)
          self.canvas.setMapTool(self.rectangle_map_tool)
docs: Hide the dialog and allow the user to draw a rectangle.