Guest User

Untitled

a guest
Dec 17th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. def run2(self):
  2. # a reference to our map canvas
  3. canvas = iface.mapCanvas()
  4.  
  5. # this QGIS tool emits as QgsPoint after each click on the map canvas
  6. pointTool = QgsMapToolEmitPoint(canvas)
  7. # Checkpoint
  8. print("S 1")
  9. pointTool.canvasClicked.connect( self.display_point )
  10. canvas.setMapTool( pointTool )
  11. # Checkpoint
  12. print("S 3")
  13.  
  14. def display_point( pointTool ):
  15.  
  16. print('({:.4f}, {:.4f})'.format(pointTool[0], pointTool[1]))
  17. # Checkpoint
  18. print("S 2")
Add Comment
Please, Sign In to add comment