Skip to content

Commit be7a026

Browse files
committed
fix issue7441 by automatically setting the projection elipsoid to fit
the selected CRS
1 parent 45d9db7 commit be7a026

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/app/qgsprojectproperties.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,11 @@ void QgsProjectProperties::on_cbxProjectionEnabled_toggled( bool onFlyEnabled )
834834
btnGrpMapUnits->setTitle( unitsOnFlyState.arg( tr( "ON" ) ) );
835835
}
836836

837+
setMapUnitsToCurrentProjection();
838+
837839
// Enable/Disable selector and update tool-tip
838-
updateEllipsoidUI( mEllipsoidIndex );
840+
updateEllipsoidUI( mEllipsoidIndex ); // maybe already done by setMapUnitsToCurrentProjection
841+
839842
}
840843

841844
void QgsProjectProperties::cbxWFSPubliedStateChanged( int aIdx )
@@ -906,6 +909,20 @@ void QgsProjectProperties::setMapUnitsToCurrentProjection()
906909
radMeters->setChecked( units == QGis::Meters );
907910
radFeet->setChecked( units == QGis::Feet );
908911
radDegrees->setChecked( units == QGis::Degrees );
912+
913+
// attempt to reset the projection ellipsoid according to the srs
914+
{
915+
int myIndex = 0;
916+
for ( int i = 0; i < mEllipsoidList.length(); i++ )
917+
{
918+
if ( mEllipsoidList[ i ].description == srs.description() )
919+
{
920+
myIndex = i;
921+
break;
922+
}
923+
}
924+
if ( myIndex ) updateEllipsoidUI( myIndex );
925+
}
909926
}
910927
}
911928

0 commit comments

Comments
 (0)