Browse Source

Copie conforme du plugin pinpoint de gsherman pour débuter.

Benjamin Bohard 3 years ago
commit
8799069727
11 changed files with 500 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 61
    0
      Makefile
  3. 47
    0
      __init__.py
  4. 26
    0
      metadata.txt
  5. 86
    0
      resources.py
  6. 5
    0
      resources.qrc
  7. 42
    0
      ui_wifimap.py
  8. 67
    0
      ui_wifimap.ui
  9. BIN
      wifimap.png
  10. 135
    0
      wifimap.py
  11. 30
    0
      wifimapdialog.py

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+*.pyc

+ 61
- 0
Makefile View File

@@ -0,0 +1,61 @@
1
+#/***************************************************************************
2
+#    PinPoint
3
+#
4
+#    Creates a QGIS plugin template for use as a starting point in plugin
5
+#    development.
6
+#                             -------------------
7
+#        begin                : 2011-10-20
8
+#        copyright            : (C) 2011 by GeoApt LLC
9
+#        email                : gsherman@geoapt.com
10
+# ***************************************************************************/
11
+#
12
+#/***************************************************************************
13
+# *                                                                         *
14
+# *   This program is free software; you can redistribute it and/or modify  *
15
+# *   it under the terms of the GNU General Public License as published by  *
16
+# *   the Free Software Foundation; either version 2 of the License, or     *
17
+# *   (at your option) any later version.                                   *
18
+# *                                                                         *
19
+# ***************************************************************************/
20
+# Makefile for a PyQGIS plugin 
21
+#
22
+
23
+DOTQGIS = .qgis2
24
+PLUGINNAME=wifimap
25
+
26
+PY_FILES = __init__.py wifimapdialog.py wifimap.py
27
+
28
+EXTRAS = wifimap.png metadata.txt
29
+
30
+UI_FILES = ui_wifimap.py
31
+
32
+RESOURCE_FILES = resources.py
33
+
34
+default: compile
35
+
36
+compile: $(UI_FILES) $(RESOURCE_FILES)
37
+
38
+%.py : %.qrc
39
+	pyrcc4 -o $@  $<
40
+
41
+%.py : %.ui
42
+	pyuic4 -o $@ $<
43
+
44
+# The deploy  target only works on unix like operating system where
45
+# the Python plugin directory is located at:
46
+# $HOME/$(DOTQGIS)/python/plugins
47
+deploy: compile
48
+	mkdir -p $(HOME)/$(DOTQGIS)/python/plugins/$(PLUGINNAME)
49
+	cp -vf $(PY_FILES) $(HOME)/$(DOTQGIS)/python/plugins/$(PLUGINNAME)
50
+	cp -vf $(UI_FILES) $(HOME)/$(DOTQGIS)/python/plugins/$(PLUGINNAME)
51
+	cp -vf $(RESOURCE_FILES) $(HOME)/$(DOTQGIS)/python/plugins/$(PLUGINNAME)
52
+	cp -vf $(EXTRAS) $(HOME)/$(DOTQGIS)/python/plugins/$(PLUGINNAME)
53
+
54
+# Create a zip package. Requires passing a valid commit or tag as follows:
55
+#   make package VERSION=Version_0.3.2
56
+package: compile
57
+		rm -f wifimap.zip
58
+		git archive --prefix=wifimap/ -o wifimap.zip $(shell git rev-list --max-count=1 HEAD)
59
+
60
+clean:
61
+	rm $(UI_FILES) $(RESOURCE_FILES) *.pyc

+ 47
- 0
__init__.py View File

@@ -0,0 +1,47 @@
1
+"""
2
+/***************************************************************************
3
+ WifiMap
4
+                                 A QGIS plugin
5
+ Place a pin with label on the map
6
+                             -------------------
7
+        begin                : 2011-10-29
8
+        copyright            : (C) 2013 by GeoApt LLC
9
+        email                : gsherman@geoapt.com
10
+ ***************************************************************************/
11
+
12
+/***************************************************************************
13
+ *                                                                         *
14
+ *   This program is free software; you can redistribute it and/or modify  *
15
+ *   it under the terms of the GNU General Public License as published by  *
16
+ *   the Free Software Foundation; either version 2 of the License, or     *
17
+ *   (at your option) any later version.                                   *
18
+ *                                                                         *
19
+ ***************************************************************************/
20
+ This script initializes the plugin, making it known to QGIS.
21
+"""
22
+
23
+def name():
24
+    return "Place a pin on the map"
25
+
26
+def description():
27
+    return "Creates a pin (marker) with an optional description where you click on the map."
28
+
29
+def version():
30
+    return "Version 0.1"
31
+
32
+def icon():
33
+    return "wifimap.png"
34
+
35
+def qgisMinimumVersion():
36
+    return "2.0"
37
+
38
+def author():
39
+    return "Benjamin Bohard"
40
+
41
+def email():
42
+    return "bbohard@cadoles.com"
43
+
44
+def classFactory(iface):
45
+    # load WifiMap class from file WifiMap
46
+    from wifimap import WifiMap
47
+    return WifiMap(iface)

+ 26
- 0
metadata.txt View File

@@ -0,0 +1,26 @@
1
+# This file contains metadata for your plugin. Beginning
2
+# with version 1.8 this is the preferred way to supply information about a
3
+# plugin. The current method of embedding metadata in __init__.py will
4
+# be supported until version 2.0
5
+
6
+# This file should be included when you package your plugin.
7
+
8
+[general]
9
+name=Wifi Map
10
+description=Creates a point feature with wifi information where you click on the map. 
11
+version=Version 0.1
12
+qgisMinimumVersion=2.0
13
+
14
+changelog=2013-06-10: Changes to work with the 2.0 sip (PyQGIS) API.
15
+
16
+homepage=None
17
+tracker=None
18
+repository=None
19
+
20
+icon=wifimap.png
21
+
22
+experimental=True
23
+deprecated=False
24
+
25
+author=Benjamin Bohard
26
+email=bbohard@cadoles.com

+ 86
- 0
resources.py View File

@@ -0,0 +1,86 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+# Resource object code
4
+#
5
+# Created by: The Resource Compiler for PyQt4 (Qt v4.8.7)
6
+#
7
+# WARNING! All changes made in this file will be lost!
8
+
9
+from PyQt4 import QtCore
10
+
11
+qt_resource_data = "\
12
+\x00\x00\x02\x9a\
13
+\x89\
14
+\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
15
+\x00\x00\x0f\x00\x00\x00\x18\x08\x06\x00\x00\x00\x25\x05\xa7\x69\
16
+\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
17
+\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x01\x1c\x00\x00\x01\x1c\
18
+\x01\xdf\xb3\xe8\x9a\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
19
+\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
20
+\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x02\x17\x49\x44\
21
+\x41\x54\x38\x8d\xd5\x92\x31\x4b\x5b\x71\x14\xc5\x7f\xff\xf7\xba\
22
+\x64\x4b\x89\xa2\x83\x46\x97\xc4\x37\x68\x70\x2d\x6d\xd1\x21\x1f\
23
+\x40\x2b\x2e\x2e\x82\x20\x3a\xf5\xd1\xa1\xe0\x90\xd5\x21\xf0\xb0\
24
+\xb5\x9d\xcd\x90\x45\x42\xf2\x09\x82\x4b\xd0\xd5\x4d\x9a\x14\x1c\
25
+\x4a\x92\xc9\x20\xaf\xc3\x33\xef\x75\x88\xa7\x83\xa9\xc4\x40\x52\
26
+\x5a\xba\xf4\x2c\x67\xb8\xf7\xc7\xbd\x9c\x7b\x61\x48\x92\x5e\x4a\
27
+\x3a\x95\xd4\x96\xf4\xa3\xef\xa7\x92\x5e\x0c\xf7\x0e\x42\xb6\xa4\
28
+\x63\x8d\xd6\xbd\xa4\x23\x49\xf6\x20\x67\x01\xdb\x51\x14\x7d\x18\
29
+\x03\x3e\x2a\x8a\x22\x0f\xd8\xee\x73\xbc\x59\x5e\x5e\x56\x10\x04\
30
+\xf2\x3c\x4f\x51\x14\x8d\x82\xe4\x79\x9e\x82\x20\x50\x26\x93\x11\
31
+\xb0\x66\x01\xbb\xfb\xfb\xfb\x9c\x9c\x9c\x70\x76\x76\x46\x10\x04\
32
+\xe4\x72\x39\x7c\xdf\x07\xc0\xf7\x7d\x72\xb9\x1c\x77\x77\x77\x54\
33
+\xab\x55\x0a\x85\x02\x7b\x7b\x7b\x00\xbb\x06\xe8\x5c\x5d\x5d\x4d\
34
+\x1c\x1c\x1c\xb0\xb5\xb5\x45\xbd\x5e\xe7\xfa\xfa\x1a\x49\x94\xcb\
35
+\x65\x36\x37\x37\x91\xc4\xc2\xc2\x02\xe9\x74\x9a\x52\xa9\xc4\xe1\
36
+\xe1\x21\x99\x4c\xe6\xc6\x02\xe2\x89\x44\x82\x56\xab\xc5\xcc\xcc\
37
+\x0c\x8d\x46\x83\x95\x95\x15\x2a\x95\x0a\xbd\x5e\x8f\x4a\xa5\xc2\
38
+\xea\xea\x2a\xf5\x7a\x9d\x64\x32\x49\xb3\xd9\x64\x72\x72\x12\xe0\
39
+\xb9\x05\x7c\xbf\xbd\xbd\x65\x76\x76\x96\x76\xbb\x8d\xe3\x38\xd4\
40
+\x6a\x35\xd6\xd7\xd7\xb1\x6d\x9b\x8d\x8d\x0d\x6a\xb5\x1a\x8e\xe3\
41
+\xd0\x6c\x36\x49\x26\x93\x74\x3a\x1d\x00\xdf\x02\x2e\x2f\x2e\x2e\
42
+\xc8\x66\xb3\x14\x8b\x45\x5c\xd7\x65\x6e\x6e\x0e\xc7\x71\xa8\x56\
43
+\xab\xa4\x52\x29\xe6\xe7\xe7\x71\x5d\x97\x62\xb1\x48\x36\x9b\xe5\
44
+\xfc\xfc\x1c\xe0\xf2\x49\xda\xf9\x7c\x5e\x61\x18\x4a\x92\xa6\xa6\
45
+\xa6\x04\x68\x7a\x7a\x5a\x92\x14\x86\xa1\xf2\xf9\xfc\x93\xb4\x01\
46
+\x6c\x60\xa7\xdb\xed\x7e\x1c\x3c\xcd\xe2\xe2\xa2\x00\x2d\x2d\x2d\
47
+\x3d\x39\x59\xb7\xdb\x3d\x02\x76\x00\xfb\x19\xd0\x03\x0a\xb1\x58\
48
+\xcc\x06\x0c\xf0\x16\xf8\x15\xca\xa3\x03\x02\x8e\x63\xb1\xd8\xfb\
49
+\x3e\xf3\xf0\x25\x00\xc6\x98\x9e\x31\xc6\x05\x5e\x03\xa5\x78\x3c\
50
+\x1e\x02\xf4\xbd\x04\xbc\x32\xc6\xbc\x33\xc6\xf4\x46\xfe\xf8\x80\
51
+\x3e\xf7\xa7\x7d\x1a\xd5\x60\x8d\x2a\x00\x9d\x21\xff\x4f\xe0\x9b\
52
+\x21\xff\xb7\x93\xc7\x69\x82\x87\xb4\x13\x7f\x03\x5b\x40\xc4\x98\
53
+\xed\xc6\xad\x7d\x0f\x7c\xed\xfb\x1f\xc3\x00\x5f\x7e\xb7\xda\x38\
54
+\x7d\x1b\x57\xfc\x09\x04\x0c\x6f\x3e\xf1\x7c\x92\xfd\x00\x00\x00\
55
+\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
56
+"
57
+
58
+qt_resource_name = "\
59
+\x00\x07\
60
+\x07\x3b\xe0\xb3\
61
+\x00\x70\
62
+\x00\x6c\x00\x75\x00\x67\x00\x69\x00\x6e\x00\x73\
63
+\x00\x07\
64
+\x0d\xfd\x03\x60\
65
+\x00\x77\
66
+\x00\x69\x00\x66\x00\x69\x00\x6d\x00\x61\x00\x70\
67
+\x00\x0b\
68
+\x03\x78\xad\x47\
69
+\x00\x77\
70
+\x00\x69\x00\x66\x00\x69\x00\x6d\x00\x61\x00\x70\x00\x2e\x00\x70\x00\x6e\x00\x67\
71
+"
72
+
73
+qt_resource_struct = "\
74
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
75
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
76
+\x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
77
+\x00\x00\x00\x28\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
78
+"
79
+
80
+def qInitResources():
81
+    QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
82
+
83
+def qCleanupResources():
84
+    QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
85
+
86
+qInitResources()

+ 5
- 0
resources.qrc View File

@@ -0,0 +1,5 @@
1
+<RCC>
2
+    <qresource prefix="/plugins/wifimap" >
3
+        <file>wifimap.png</file>
4
+    </qresource>
5
+</RCC>

+ 42
- 0
ui_wifimap.py View File

@@ -0,0 +1,42 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+# Form implementation generated from reading ui file 'ui_wifimap.ui'
4
+#
5
+# Created by: PyQt4 UI code generator 4.11.4
6
+#
7
+# WARNING! All changes made in this file will be lost!
8
+
9
+from PyQt4 import QtCore, QtGui
10
+
11
+try:
12
+    _fromUtf8 = QtCore.QString.fromUtf8
13
+except AttributeError:
14
+    def _fromUtf8(s):
15
+        return s
16
+
17
+try:
18
+    _encoding = QtGui.QApplication.UnicodeUTF8
19
+    def _translate(context, text, disambig):
20
+        return QtGui.QApplication.translate(context, text, disambig, _encoding)
21
+except AttributeError:
22
+    def _translate(context, text, disambig):
23
+        return QtGui.QApplication.translate(context, text, disambig)
24
+
25
+class Ui_WifiMap(object):
26
+    def setupUi(self, WifiMap):
27
+        WifiMap.setObjectName(_fromUtf8("WifiMap"))
28
+        WifiMap.resize(400, 300)
29
+        self.buttonBox = QtGui.QDialogButtonBox(WifiMap)
30
+        self.buttonBox.setGeometry(QtCore.QRect(30, 240, 341, 32))
31
+        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
32
+        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
33
+        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
34
+
35
+        self.retranslateUi(WifiMap)
36
+        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), WifiMap.accept)
37
+        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), WifiMap.reject)
38
+        QtCore.QMetaObject.connectSlotsByName(WifiMap)
39
+
40
+    def retranslateUi(self, WifiMap):
41
+        WifiMap.setWindowTitle(_translate("WifiMap", "WifiMap", None))
42
+

+ 67
- 0
ui_wifimap.ui View File

@@ -0,0 +1,67 @@
1
+<ui version="4.0" >
2
+ <class>WifiMap</class>
3
+ <widget class="QDialog" name="WifiMap" >
4
+  <property name="geometry" >
5
+   <rect>
6
+    <x>0</x>
7
+    <y>0</y>
8
+    <width>400</width>
9
+    <height>300</height>
10
+   </rect>
11
+  </property>
12
+  <property name="windowTitle" >
13
+   <string>WifiMap</string>
14
+  </property>
15
+  <widget class="QDialogButtonBox" name="buttonBox" >
16
+   <property name="geometry" >
17
+    <rect>
18
+     <x>30</x>
19
+     <y>240</y>
20
+     <width>341</width>
21
+     <height>32</height>
22
+    </rect>
23
+   </property>
24
+   <property name="orientation" >
25
+    <enum>Qt::Horizontal</enum>
26
+   </property>
27
+   <property name="standardButtons" >
28
+    <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
29
+   </property>
30
+  </widget>
31
+ </widget>
32
+ <resources/>
33
+ <connections>
34
+  <connection>
35
+   <sender>buttonBox</sender>
36
+   <signal>accepted()</signal>
37
+   <receiver>WifiMap</receiver>
38
+   <slot>accept()</slot>
39
+   <hints>
40
+    <hint type="sourcelabel" >
41
+     <x>248</x>
42
+     <y>254</y>
43
+    </hint>
44
+    <hint type="destinationlabel" >
45
+     <x>157</x>
46
+     <y>274</y>
47
+    </hint>
48
+   </hints>
49
+  </connection>
50
+  <connection>
51
+   <sender>buttonBox</sender>
52
+   <signal>rejected()</signal>
53
+   <receiver>WifiMap</receiver>
54
+   <slot>reject()</slot>
55
+   <hints>
56
+    <hint type="sourcelabel" >
57
+     <x>316</x>
58
+     <y>260</y>
59
+    </hint>
60
+    <hint type="destinationlabel" >
61
+     <x>286</x>
62
+     <y>274</y>
63
+    </hint>
64
+   </hints>
65
+  </connection>
66
+ </connections>
67
+</ui>

BIN
wifimap.png View File


+ 135
- 0
wifimap.py View File

@@ -0,0 +1,135 @@
1
+"""
2
+/***************************************************************************
3
+ WifiMap
4
+                                 A QGIS plugin
5
+ Place a pin with label on the map
6
+                              -------------------
7
+        begin                : 2011-10-29
8
+        copyright            : (C) 2013 by GeoApt LLC
9
+        email                : gsherman@geoapt.com
10
+ ***************************************************************************/
11
+
12
+/***************************************************************************
13
+ *                                                                         *
14
+ *   This program is free software; you can redistribute it and/or modify  *
15
+ *   it under the terms of the GNU General Public License as published by  *
16
+ *   the Free Software Foundation; either version 2 of the License, or     *
17
+ *   (at your option) any later version.                                   *
18
+ *                                                                         *
19
+ ***************************************************************************/
20
+"""
21
+# Import the PyQt and QGIS libraries
22
+from PyQt4.QtCore import *
23
+from PyQt4.QtGui import *
24
+from qgis.core import *
25
+from qgis.gui import * #g
26
+# Initialize Qt resources from file resources.py
27
+import resources
28
+# Import the code for the dialog
29
+from wifimapdialog import WifiMapDialog
30
+
31
+class WifiMap:
32
+
33
+    def __init__(self, iface):
34
+        # Save reference to the QGIS interface
35
+        self.iface = iface
36
+        #g reference to the canvas
37
+        self.canvas = self.iface.mapCanvas()
38
+
39
+        #g pin tool
40
+        self.pinTool = QgsMapToolEmitPoint(self.canvas)
41
+
42
+        #g boolean for memory layer state
43
+        self.have_layer = False
44
+
45
+    def initGui(self):
46
+        # Create action that will start plugin configuration
47
+        self.action = QAction(QIcon(":/plugins/wifimap/wifimap.png"), \
48
+            "Pinpoint wifi infos...", self.iface.mainWindow())
49
+        # connect the action to the run method
50
+        QObject.connect(self.action, SIGNAL("triggered()"), self.run)
51
+        # connect signal that the canvas was clicked
52
+        result = QObject.connect(self.pinTool, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.place_pin)
53
+        #QMessageBox.information( self.iface.mainWindow(),"Info", "connect = %s"%str(result) )
54
+
55
+        # Add toolbar button and menu item
56
+        self.iface.addToolBarIcon(self.action)
57
+        self.iface.addPluginToMenu("&Pinpoint wifi infos...", self.action)
58
+
59
+        # set the default pin label
60
+        self.last_desc = 'My Pin'
61
+
62
+    def unload(self):
63
+        # Remove the plugin menu item and icon
64
+        self.iface.removePluginMenu("&Pinpoint wifi infos...",self.action)
65
+        self.iface.removeToolBarIcon(self.action)
66
+
67
+    # get the x,y and create the pin
68
+    def place_pin(self, point, button):
69
+        # user might remove the layer so we have to check each time
70
+        # to see if it exists
71
+        if self.have_layer == False:
72
+            #QMessageBox.information(self.iface.mainWindow(),"Memory Provider", "No provider yet")
73
+            self.create_pin_layer()
74
+
75
+
76
+        ok = False
77
+
78
+        (desc,ok) = QInputDialog.getText(
79
+                self.iface.mainWindow(),
80
+                "Description",
81
+                "Description for pin at %.2f, %.2f" % (float(str(point.x())),float(str(point.y()))),
82
+                QLineEdit.Normal,
83
+                self.last_desc)
84
+
85
+        if(ok):
86
+            self.last_desc = desc
87
+
88
+
89
+            fc = int(self.provider.featureCount())
90
+            #QMessageBox.information( self.iface.mainWindow(),"Feature Count", str(fc)) #"X,Y = %s,%s" % (str(point.x()),str(point.y())) )
91
+            # create the feature
92
+            feature = QgsFeature()
93
+            feature.setGeometry(QgsGeometry.fromPoint(point))
94
+            if QGis.QGIS_VERSION_INT > 10800:
95
+                feature.setAttributes([fc, desc, point.x(), point.y()])
96
+                self.pinLayer.startEditing()
97
+                self.pinLayer.addFeature(feature, True)
98
+                self.pinLayer.commitChanges()
99
+            else:
100
+                feature.setAttributeMap( {0 : QVariant(fc),
101
+                    1 : QVariant(desc),
102
+                    2 : QVariant(point.x()),
103
+                    3 : QVariant(point.y())})
104
+                self.provider.addFeatures([feature])
105
+                self.pinLayer.updateExtents()
106
+            #QMessageBox.information(self.iface.mainWindow(), "Feature/field count", "%s / %s" % (str(self.provider.featureCount()), str(self.provider.fieldCount())))
107
+            #self.pinLayer.reload()
108
+            self.pinLayer.setCacheImage(None)
109
+            self.pinLayer.triggerRepaint()
110
+
111
+            #self.canvas.refresh()
112
+
113
+    # run method that performs all the real work
114
+    def run(self):
115
+        # Check to see if the memory layer has been created and if not,
116
+        # create it
117
+        if self.have_layer == False:
118
+            #QMessageBox.information(self.iface.mainWindow(),"Memory Provider", "No provider yet")
119
+            self.create_pin_layer()
120
+        # set the map tool
121
+        self.canvas.setMapTool(self.pinTool)
122
+
123
+    def create_pin_layer(self):
124
+      self.pinLayer =  QgsVectorLayer(
125
+              "Point?field=id:integer&field=description:string(120)&field=x:double&field=y:double&index=yes",
126
+              "Pins",
127
+              "memory")
128
+      self.provider = self.pinLayer.dataProvider()
129
+      self.pinLayer.setDisplayField("description")
130
+      QgsMapLayerRegistry.instance().addMapLayer(self.pinLayer)
131
+      result = QObject.connect(self.pinLayer, SIGNAL("layerDeleted()"), self.layer_deleted)
132
+      self.have_layer = True
133
+
134
+    def layer_deleted(self):
135
+      self.have_layer = False

+ 30
- 0
wifimapdialog.py View File

@@ -0,0 +1,30 @@
1
+"""
2
+/***************************************************************************
3
+ WifiMapDialog
4
+                                 A QGIS plugin
5
+ Place a pin with label on the map
6
+                             -------------------
7
+        begin                : 2011-10-29
8
+        copyright            : (C) 2013 by GeoApt LLC
9
+        email                : gsherman@geoapt.com
10
+ ***************************************************************************/
11
+
12
+/***************************************************************************
13
+ *                                                                         *
14
+ *   This program is free software; you can redistribute it and/or modify  *
15
+ *   it under the terms of the GNU General Public License as published by  *
16
+ *   the Free Software Foundation; either version 2 of the License, or     *
17
+ *   (at your option) any later version.                                   *
18
+ *                                                                         *
19
+ ***************************************************************************/
20
+"""
21
+
22
+from PyQt4 import QtCore, QtGui
23
+from ui_wifimap import Ui_WifiMap
24
+# create the dialog for zoom to point
25
+class WifiMapDialog(QtGui.QDialog):
26
+    def __init__(self):
27
+        QtGui.QDialog.__init__(self)
28
+        # Set up the user interface from Designer.
29
+        self.ui = Ui_WifiMap()
30
+        self.ui.setupUi(self)