File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -108,10 +108,21 @@ void Qgs3DMapToolIdentify::onTerrainPicked( Qt3DRender::QPickEvent *event )
108
108
109
109
// transform the point and search radius to CRS of the map canvas (if they are different)
110
110
QgsCoordinateTransform ct ( mCanvas ->map ()->crs (), canvas2D->mapSettings ().destinationCrs (), canvas2D->mapSettings ().transformContext () );
111
- QgsPointXY mapPointCanvas2D = ct.transform ( mapPoint );
112
- QgsPointXY mapPointSearchRadius ( mapPoint.x () + searchRadiusMapUnits, mapPoint.y () );
113
- QgsPointXY mapPointSearchRadiusCanvas2D = ct.transform ( mapPointSearchRadius );
114
- double searchRadiusCanvas2D = mapPointCanvas2D.distance ( mapPointSearchRadiusCanvas2D );
111
+
112
+ QgsPointXY mapPointCanvas2D = mapPoint;
113
+ double searchRadiusCanvas2D = searchRadiusMapUnits;
114
+ try
115
+ {
116
+ mapPointCanvas2D = ct.transform ( mapPoint );
117
+ QgsPointXY mapPointSearchRadius ( mapPoint.x () + searchRadiusMapUnits, mapPoint.y () );
118
+ QgsPointXY mapPointSearchRadiusCanvas2D = ct.transform ( mapPointSearchRadius );
119
+ searchRadiusCanvas2D = mapPointCanvas2D.distance ( mapPointSearchRadiusCanvas2D );
120
+ }
121
+ catch ( QgsException &e )
122
+ {
123
+ Q_UNUSED ( e );
124
+ QgsDebugMsg ( QStringLiteral ( " Caught exception %1" ).arg ( e.what () ) );
125
+ }
115
126
116
127
identifyTool2D->identifyAndShowResults ( QgsGeometry::fromPointXY ( mapPointCanvas2D ), searchRadiusCanvas2D );
117
128
}
You can’t perform that action at this time.
0 commit comments