PointMapTool.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. """
  2. ***************************************************************************
  3. PointMapTool.py
  4. ---------------------
  5. Date : February 2016
  6. Copyright : (C) 2016 by Alexander Bruy
  7. Email : alexander dot bruy at gmail dot com
  8. ***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************
  16. """
  17. __author__ = 'Alexander Bruy'
  18. __date__ = 'February 2016'
  19. __copyright__ = '(C) 2016, Alexander Bruy'
  20. from qgis.PyQt.QtCore import Qt, pyqtSignal
  21. from qgis.gui import QgsMapToolEmitPoint
  22. class PointMapTool(QgsMapToolEmitPoint):
  23. complete = pyqtSignal()
  24. def __init__(self, canvas):
  25. QgsMapToolEmitPoint.__init__(self, canvas)
  26. self.canvas = canvas
  27. self.cursor = Qt.CrossCursor
  28. def activate(self):
  29. self.canvas.setCursor(self.cursor)
  30. def canvasReleaseEvent(self, event):
  31. self.complete.emit()