Skip to content

Commit

Permalink
Disable degree / minute / second format if map units are not degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Aug 9, 2012
1 parent d0b4fc1 commit 5821e2b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -1989,11 +1989,18 @@ void QgsComposerMap::createDefaultOverviewFrameSymbol()
void QgsComposerMap::initGridAnnotationFormatFromProject()
{
QString format = QgsProject::instance()->readEntry( "PositionPrecision", "/DegreeFormat", "D" );
if ( format == "DM" )

bool degreeUnits = true;
if ( mMapRenderer )
{
degreeUnits = ( mMapRenderer->mapUnits() == QGis::Degrees );
}

if ( format == "DM" && degreeUnits )
{
mGridAnnotationFormat = DegreeMinute;
}
else if ( format == "DMS" )
else if ( format == "DMS" && degreeUnits )
{
mGridAnnotationFormat = DegreeMinuteSecond;
}
Expand Down

0 comments on commit 5821e2b

Please sign in to comment.