Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

120 removing blue lines in ors tool #192

Merged
merged 4 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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