Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Created August 17, 2019 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/e9e3d4541836de6f608d7a02b3dde7ae to your computer and use it in GitHub Desktop.
Save ThomasG77/e9e3d4541836de6f608d7a02b3dde7ae to your computer and use it in GitHub Desktop.
# Execute in the PyQGIS console
def showXY(p):
print(p.x(), p.y())
currentCanvas = iface.mapCanvas()
currentCanvas.xyCoordinates.connect(showXY)
# Below enable to "unregister" listening to click event
# currentCanvas.xyCoordinates.disconnect(showXY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment