Skip to content

Commit

Permalink
feat: add start- and endpoint markers
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian committed Dec 18, 2023
1 parent a293b29 commit f34f951
Show file tree
Hide file tree
Showing 4 changed files with 443 additions and 204 deletions.
13 changes: 11 additions & 2 deletions ORStools/gui/ORStoolsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from qgis.core import QgsProject, QgsVectorLayer, QgsTextAnnotation, QgsMapLayerProxyModel
from qgis.gui import QgsMapCanvasAnnotationItem

from PyQt5.QtCore import QSizeF, QPointF, QCoreApplication
from PyQt5.QtCore import QSizeF, QPointF, QCoreApplication, QSettings
from PyQt5.QtGui import QIcon, QTextDocument
from PyQt5.QtWidgets import QAction, QDialog, QApplication, QMenu, QMessageBox, QDialogButtonBox

Expand Down Expand Up @@ -230,8 +230,17 @@ def run_gui_control(self):
layer_out.dataProvider().addAttributes(directions_core.get_fields())
layer_out.updateFields()

basepath = os.path.dirname(__file__)

# add ors svg path
my_new_path = os.path.join(basepath, "img/svg")
svg_paths = QSettings().value("svg/searchPathsForSVG")
if my_new_path not in svg_paths:
svg_paths.append(my_new_path)
QSettings().setValue("svg/searchPathsForSVG", svg_paths)

# style output layer
qml_path = os.path.join(os.path.dirname(__file__), "linestyle.qml")
qml_path = os.path.join(basepath, "linestyle.qml")
layer_out.loadNamedStyle(qml_path, True)
layer_out.triggerRepaint()

Expand Down
9 changes: 9 additions & 0 deletions ORStools/gui/img/svg/endpoint_marker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions ORStools/gui/img/svg/startpoint_marker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f34f951

Please sign in to comment.