Skip to content

Commit e2094d8

Browse files
wonder-sknyalldawson
authored andcommittedAug 31, 2023
sandbox 3d: use projected CRS if project's CRS is not projected
3D map views simply don't work with lat/lon CRS
1 parent 4aec105 commit e2094d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎tests/src/3d/sandbox/qgis_3d_sandbox.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ void initCanvas3D( Qgs3DMapCanvas *canvas )
4242
QgsLayerTree *root = QgsProject::instance()->layerTreeRoot();
4343
const QList< QgsMapLayer * > visibleLayers = root->checkedLayers();
4444

45+
QgsCoordinateReferenceSystem crs = QgsProject::instance()->crs();
46+
if ( crs.isGeographic() )
47+
{
48+
// we can't deal with non-projected CRS, so let's just pick something
49+
QgsProject::instance()->setCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3857" ) ) );
50+
}
51+
4552
QgsMapSettings ms;
4653
ms.setDestinationCrs( QgsProject::instance()->crs() );
4754
ms.setLayers( visibleLayers );

0 commit comments

Comments
 (0)
Please sign in to comment.