forked from warrieka/geopunt4Qgis
/
reverseAdresMapTool.py
40 lines (35 loc) · 1.6 KB
/
reverseAdresMapTool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
"""
/***************************************************************************
reverseAdresMapTool
A QGIS plugin
"Tool om geopunt in QGIS te gebruiken"
-------------------
begin : 2013-12-08
copyright : (C) 2013 by Kay Warrie
email : kaywarrie@gmail.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *
class reverseAdresMapTool(QgsMapTool):
def __init__(self, iface, callback):
QgsMapTool.__init__(self,iface.mapCanvas())
self.iface = iface
self.callback = callback
self.canvas = iface.mapCanvas()
return None
def canvasReleaseEvent(self,e):
"""Raise the Callback to return point to sender"""
point = self.toMapCoordinates(e.pos())
self.callback(point)
return None