Skip to content

Commit ca670a6

Browse files
authored
Merge pull request #25 from sanak/hotfix/issue20
Hotfix/issue20
2 parents 67b69ed + 402605c commit ca670a6

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

functions/tsp_euclid.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ def getExportQuery(self, args):
7272

7373
def draw(self, rows, con, args, geomType, canvasItemList, mapCanvas):
7474
resultPathsRubberBands = canvasItemList['path']
75-
rubberBand = None
76-
rubberBand = QgsRubberBand(mapCanvas, Utils.getRubberBandType(False))
77-
rubberBand.setColor(QColor(255, 0, 0, 128))
78-
rubberBand.setWidth(4)
7975
i = 0
8076
for row in rows:
8177
if i == 0:
@@ -103,10 +99,10 @@ def draw(self, rows, con, args, geomType, canvasItemList, mapCanvas):
10399
if geom.wkbType() == QGis.WKBMultiLineString:
104100
for line in geom.asMultiPolyline():
105101
for pt in line:
106-
rubberBand.addPoint(pt)
102+
resultPathsRubberBands.addPoint(pt)
107103
elif geom.wkbType() == QGis.WKBLineString:
108104
for pt in geom.asPolyline():
109-
rubberBand.addPoint(pt)
105+
resultPathsRubberBands.addPoint(pt)
110106
prevrow = row
111107
lastrow = row
112108

@@ -129,10 +125,10 @@ def draw(self, rows, con, args, geomType, canvasItemList, mapCanvas):
129125
if geom.wkbType() == QGis.WKBMultiLineString:
130126
for line in geom.asMultiPolyline():
131127
for pt in line:
132-
rubberBand.addPoint(pt)
128+
resultPathsRubberBands.addPoint(pt)
133129
elif geom.wkbType() == QGis.WKBLineString:
134130
for pt in geom.asPolyline():
135-
rubberBand.addPoint(pt)
131+
resultPathsRubberBands.addPoint(pt)
136132

137133

138134

pgRoutingLayer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,10 @@ def clear(self):
859859
marker.setVisible(False)
860860
self.canvasItemList['markers'] = []
861861
for anno in self.canvasItemList['annotations']:
862-
anno.setVisible(False)
862+
try:
863+
anno.setVisible(False)
864+
except RuntimeError, e:
865+
Utils.logMessage("anno.setVisible(False) failed, " + e.message, QgsMessageLog.WARNING)
863866
self.canvasItemList['annotations'] = []
864867
for path in self.canvasItemList['paths']:
865868
path.reset(Utils.getRubberBandType(False))

0 commit comments

Comments
 (0)