Commit 78929c62 authored by Benjamin Jakimow's avatar Benjamin Jakimow

export of spatial extent / center to QGIS map canvas with refresh QGIS map canvas

Signed-off-by: Benjamin Jakimow's avatarBenjamin Jakimow benjamin.jakimow@geo.hu-berlin.de <benjamin.jakimow@geo.hu-berlin.de>
parent 143f758f
Pipeline #16151 failed with stage
in 5 seconds
......@@ -1083,13 +1083,24 @@ class EOTimeSeriesViewer(QgisInterface, QObject):
self.ui.actionImportExtent.triggered.connect(
lambda: self.setSpatialExtent(SpatialExtent.fromMapCanvas(iface.mapCanvas())))
self.ui.actionExportExtent.triggered.connect(lambda: iface.mapCanvas().setExtent(
self.spatialExtent().toCrs(iface.mapCanvas().mapSettings().destinationCrs())))
self.ui.actionExportCenter.triggered.connect(lambda: iface.mapCanvas().setCenter(
self.spatialCenter().toCrs(iface.mapCanvas().mapSettings().destinationCrs())))
self.ui.actionImportCenter.triggered.connect(
lambda: self.setSpatialCenter(SpatialPoint.fromMapCanvasCenter(iface.mapCanvas())))
def setQGISCenter(*args):
c = iface.mapCanvas()
if isinstance(c, QgsMapCanvas):
c.setCenter(self.spatialCenter().toCrs(c.mapSettings().destinationCrs()))
c.refresh()
def setQGISExtent(*args):
c = iface.mapCanvas()
if isinstance(c, QgsMapCanvas):
c.setExtent(self.spatialExtent().toCrs(c.mapSettings().destinationCrs()))
c.refresh()
self.ui.actionExportExtent.triggered.connect(setQGISExtent)
self.ui.actionExportCenter.triggered.connect(setQGISCenter)
self.mapWidget().setCrs(iface.mapCanvas().mapSettings().destinationCrs())
def onShowLayerProperties(self, lyr=None):
......
Markdown is supported
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