Skip to content

Commit 3551a77

Browse files
committed
point digitizer bug fix
1 parent be245e2 commit 3551a77

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

digitizer.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,9 @@ def addFeature(self):
162162
# Transform the input coordinate projection to the layer CRS
163163
x, y = transform.transform(float(lon), float(lat))
164164
geom = QgsGeometry.fromPointXY(QgsPointXY(x, y))
165-
feat = QgsVectorLayerUtils.createFeature(layer, geom, {}, layer.createExpressionContext() )
166-
if layer.fields().count() == 0:
167-
layer.addFeature(feat)
165+
result = self.iface.vectorLayerTools().addFeature( layer, {}, geom)
166+
if result[0]:
168167
self.lltools.zoomTo(srcCrs, lat, lon)
169-
else:
170-
if self.iface.openFeatureForm(layer, feat):
171-
layer.addFeature(feat)
172-
self.lltools.zoomTo(srcCrs, lat, lon)
173168

174169
def labelUpdate(self):
175170
if self.inputProjection == 1: # MGRS projection

metadata.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name=Lat Lon Tools
33
qgisMinimumVersion=3.4
44
description=Tools to capture and zoom to coordinates using decimal, DMS, WKT, GeoJSON, MGRS, UTM, UPS, Geohash, Maidenhead grid, Plus Codes, and ECEF formats. Provides external map support, point digitizing tools, coordinate conversion tools, and conversion functions.
5-
version=3.6.2
5+
version=3.6.3
66
author=C Hamilton
77
88
about=
@@ -29,6 +29,7 @@ hasProcessingProvider=yes
2929
experimental=False
3030
deprecated=False
3131
changelog=
32+
3.6.3 - Bug fix for point digitizer.
3233
3.6.2 - Added llt_dd and llt_yx field calculator functions.
3334
3.6.1 - Fixed bug.
3435
3.6.0 - Added ECEF (Earth-centered, Earth-fixed) coordinate system conversions.

0 commit comments

Comments
 (0)