Commit 789f4b81 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files
parent 64d22e57
......@@ -37,21 +37,20 @@ if os.path.exists(path):
multiprocessing.set_executable(path)
sys.argv = [ None ]
"""
import sys
import qgis.utils
from qgis.core import *
from qgis.core import QgsMapLayer, QgsRasterLayer, QgsVectorLayer, QgsMessageOutput, QgsCoordinateReferenceSystem, \
Qgis, QgsWkbTypes, QgsTask, QgsProviderRegistry, QgsMapLayerStore, QgsFeature, QgsField, \
QgsTextFormat, QgsProject, QgsSingleSymbolRenderer, QgsGeometry, QgsApplication, QgsFillSymbol, \
QgsProjectArchive, QgsZipUtils, QgsPointXY
from qgis.gui import *
from qgis.gui import QgsMapCanvas, QgsStatusBar, QgsFileWidget, \
QgsMessageBar, QgsMessageViewer, QgsDockWidget, QgsTaskManagerWidget, QgisInterface
import qgis.utils
from eotimeseriesviewer import LOG_MESSAGE_TAG
from eotimeseriesviewer.utils import *
from eotimeseriesviewer import LOG_MESSAGE_TAG, settings
from eotimeseriesviewer.utils import SpatialPoint, datetime64, fixMenuButtons, file_search
from eotimeseriesviewer.timeseries import *
from eotimeseriesviewer.settings import Keys as SettingKeys
from eotimeseriesviewer.mapcanvas import MapCanvas
......@@ -64,6 +63,7 @@ from .externals.qps.speclib.gui import SpectralLibraryPanel
from .externals.qps.maptools import MapTools, CursorLocationMapTool, QgsMapToolSelect, QgsMapToolSelectionHandler
from .externals.qps.cursorlocationvalue import CursorLocationInfoModel, CursorLocationInfoDock
from .externals.qps.vectorlayertools import VectorLayerTools
from .externals.qps.maptools import MapTools
import eotimeseriesviewer.labeling
from eotimeseriesviewer import debugLog
......@@ -1282,9 +1282,6 @@ class EOTimeSeriesViewer(QgisInterface, QObject):
def onShowProfile(self, spatialPoint, mapCanvas, mapToolKey):
assert isinstance(spatialPoint, SpatialPoint)
assert isinstance(mapCanvas, QgsMapCanvas)
from eotimeseriesviewer.mapcanvas import MapTools
assert mapToolKey in MapTools.mapToolValues()
if mapToolKey == MapTools.TemporalProfile:
......
......@@ -29,7 +29,7 @@ import qgis.utils
from qgis.PyQt.QtGui import QIcon, QContextMenuEvent, QMouseEvent, QPainter, QFont, QColor
from qgis.PyQt.QtWidgets import QApplication, QDialog, QMenu, QFileDialog, QSizePolicy, QStyle, QStyleOptionProgressBar
from qgis.PyQt.QtCore import QSize, QDate, QDateTime, QDir, QFile, QMimeData, pyqtSignal, Qt, \
QPoint, QObject, QRectF, QPointF, QRect, QTimer
QPoint, QObject, QRectF, QPointF, QRect, QTimer, QTime
from qgis.core import QgsMapLayer, QgsRasterLayer, QgsVectorLayer, QgsContrastEnhancement, \
QgsDateTimeRange, QgsProject, QgsTextRenderer, QgsApplication, QgsCoordinateReferenceSystem, \
......
......@@ -1006,7 +1006,8 @@ class MapWidget(QFrame):
sigCurrentCanvasChanged = pyqtSignal(MapCanvas)
sigCurrentMapViewChanged = pyqtSignal(MapView)
sigCurrentDateChanged = pyqtSignal(TimeSeriesDate)
sigCurrentLocationChanged = pyqtSignal(QgsCoordinateReferenceSystem, QgsPointXY)
sigCurrentLocationChanged = pyqtSignal([QgsCoordinateReferenceSystem, QgsPointXY],
[QgsCoordinateReferenceSystem, QgsPointXY, QgsMapCanvas])
sigVisibleDatesChanged = pyqtSignal(list)
sigViewModeChanged = pyqtSignal(ViewMode)
......@@ -1746,8 +1747,8 @@ class MapWidget(QFrame):
# self.sigCurrentLocationChanged)
def onCanvasLocationRequest(self, canvas: QgsMapCanvas, crs: QgsCoordinateReferenceSystem, pt: QgsPointXY):
spt = SpatialPoint(crs, pt)
self.sigCurrentLocationChanged.emit(spt, canvas)
self.sigCurrentLocationChanged[QgsCoordinateReferenceSystem, QgsPointXY].emit(crs, pt)
self.sigCurrentLocationChanged[QgsCoordinateReferenceSystem, QgsPointXY, QgsMapCanvas].emit(crs, pt, canvas)
def onCanvasClicked(self, event: QMouseEvent):
canvas = self.sender()
......
......@@ -22,7 +22,7 @@ MDF_TEXT_HTML = 'text/html'
MDF_TEXT_PLAIN = 'text/plain'
def attributesd2dict(attributes):
def attributes2dict(attributes):
d = {}
assert isinstance(attributes, QDomNamedNodeMap)
for i in range(attributes.count()):
......@@ -86,7 +86,7 @@ def toLayerList(mimeData):
for i in range(childs.count()):
child = childs.at(i).toElement()
if child.tagName() == 'layer-tree-layer':
attributesLUT[child.attribute('id')] = attributesd2dict(child.attributes())
attributesLUT[child.attribute('id')] = attributes2dict(child.attributes())
for treeLayer in layerTree.findLayers():
assert isinstance(treeLayer, QgsLayerTreeLayer)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment