Skip to content
Snippets Groups Projects
Commit 17c4ef52 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files

bugixes

parent f1adfdaf
No related branches found
No related tags found
No related merge requests found
2018-11-13
- fixed bugs caused by CRS-changes
2018-11-09 2018-11-09
- uses QgsTaskManager for background loading - uses QgsTaskManager for background loading
- own QgsMapLayerStore to not mix-up with (main) QGIS layers - own QgsMapLayerStore to not mix-up with (main) QGIS layers
......
...@@ -581,10 +581,20 @@ class SpatialExtent(QgsRectangle): ...@@ -581,10 +581,20 @@ class SpatialExtent(QgsRectangle):
return self return self
def setCenter(self, centerPoint, crs=None): def setCenter(self, centerPoint:SpatialPoint, crs=None):
"""
Sets the center. Can be used to move the SpatialExtent
:param centerPoint:
:param crs: QgsCoordinateReferenceSystem
:return:
"""
if isinstance(centerPoint, SpatialPoint):
crs = centerPoint.crs()
if crs and crs != self.crs(): if isinstance(crs, QgsCoordinateReferenceSystem) and crs != self.crs():
trans = QgsCoordinateTransform(crs, self.crs()) trans = QgsCoordinateTransform()
trans.setSourceCrs(crs)
trans.setDestinationCrs(self.crs())
centerPoint = trans.transform(centerPoint) centerPoint = trans.transform(centerPoint)
delta = centerPoint - self.center() delta = centerPoint - self.center()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment