Skip to content

Commit

Permalink
feat: remove blue lines when using GUI
Browse files Browse the repository at this point in the history
fixes #120 

Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
  • Loading branch information
merydian and koebi committed Dec 22, 2023
1 parent 852e1d0 commit 426cd9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ RELEASING:
- Add styling of routing output in main plugin ([#149](https://github.com/GIScience/orstools-qgis-plugin/issues/149))
- make items in centroid list drag and droppable ([#144](https://github.com/GIScience/orstools-qgis-plugin/issues/144))
- Add save button for vertices ([#144](https://github.com/GIScience/orstools-qgis-plugin/issues/144))
- remove blue lines every time the red X button is clicked ([#120](https://github.com/GIScience/orstools-qgis-plugin/issues/120))

## [1.6.0] - 2023-07-25

Expand Down
8 changes: 8 additions & 0 deletions ORStools/gui/ORStoolsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ def _on_clear_listwidget_click(self):
self.routing_fromline_list.clear()
self._clear_annotations()

# Remove blue lines (rubber band)
if self.line_tool:
self.line_tool.canvas.scene().removeItem(self.line_tool.rubberBand)

def _linetool_annotate_point(self, point, idx, crs=None):
if not crs:
crs = self._iface.mapCanvas().mapSettings().destinationCrs()
Expand Down Expand Up @@ -533,6 +537,10 @@ def _clear_annotations(self):

def _on_linetool_init(self):
"""Hides GUI dialog, inits line maptool and add items to line list box."""
# Remove blue lines (rubber band)
if self.line_tool:
self.line_tool.canvas.scene().removeItem(self.line_tool.rubberBand)

self.hide()
self.routing_fromline_list.clear()
# Remove all annotations which were added (if any)
Expand Down

0 comments on commit 426cd9a

Please sign in to comment.