Skip to content
Permalink
Browse files

[quick] Fix unhandled exception in QgsQuickPositionKit

  • Loading branch information
wonder-sk authored and nyalldawson committed May 7, 2020
1 parent 4b27b5f commit 154c8923c995e85fa873e61256d24d5797eb68fa
Showing with 13 additions and 5 deletions.
  1. +13 −5 src/quickgui/qgsquickpositionkit.cpp
@@ -139,11 +139,19 @@ void QgsQuickPositionKit::updateProjectedPosition()
return;

QgsPointXY srcPoint = QgsPointXY( mPosition.x(), mPosition.y() );
QgsPointXY projectedPositionXY = QgsQuickUtils::transformPoint(
positionCRS(),
mMapSettings->destinationCrs(),
mMapSettings->transformContext(),
srcPoint );
QgsPointXY projectedPositionXY = srcPoint;
try
{
projectedPositionXY = QgsQuickUtils::transformPoint(
positionCRS(),
mMapSettings->destinationCrs(),
mMapSettings->transformContext(),
srcPoint );
}
catch ( const QgsCsException & )
{
QgsDebugMsg( QStringLiteral( "Failed to transform GPS position: " ) + srcPoint.toString() );
}

QgsPoint projectedPosition( projectedPositionXY );
projectedPosition.addZValue( mPosition.z() );

0 comments on commit 154c892

Please sign in to comment.
You can’t perform that action at this time.