Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def run2(self):
- # a reference to our map canvas
- canvas = iface.mapCanvas()
- # this QGIS tool emits as QgsPoint after each click on the map canvas
- pointTool = QgsMapToolEmitPoint(canvas)
- # Checkpoint
- print("S 1")
- pointTool.canvasClicked.connect( self.display_point )
- canvas.setMapTool( pointTool )
- # Checkpoint
- print("S 3")
- def display_point( pointTool ):
- print('({:.4f}, {:.4f})'.format(pointTool[0], pointTool[1]))
- # Checkpoint
- print("S 2")
Add Comment
Please, Sign In to add comment