@@ -643,13 +643,13 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
643
643
644
644
mWMSMaxAtlasFeaturesSpinBox ->setValue ( QgsProject::instance ()->readNumEntry ( QStringLiteral ( " WMSMaxAtlasFeatures" ), QStringLiteral ( " /" ), 1 ) );
645
645
646
+ // connect this to crs change
646
647
mWMSDefaultMapUnitsPerMm = new QDoubleSpinBox ();
647
- mWMSDefaultMapUnitsPerMm ->setDecimals ( 3 );
648
+ mWMSDefaultMapUnitsPerMm ->setDecimals ( 4 );
649
+ mWMSDefaultMapUnitsPerMm ->setSingleStep ( 0.001 );
648
650
mWMSDefaultMapUnitsPerMm ->setValue ( QgsProject::instance ()->readDoubleEntry ( QStringLiteral ( " WMSDefaultMapUnitsPerMm" ), QStringLiteral ( " /" ), 1 ) );
649
-
650
- // care for map units mm, km, inches etc...
651
651
mWMSDefaultMapUnitScale = new QgsScaleWidget ();
652
- mWMSDefaultMapUnitScale ->setScale ( QgsProject::instance ()->readDoubleEntry ( QStringLiteral ( " WMSDefaultMapUnitsPerMm" ), QStringLiteral ( " /" ), 1 ) * 1000 );
652
+ mWMSDefaultMapUnitScale ->setScale ( QgsProject::instance ()->readDoubleEntry ( QStringLiteral ( " WMSDefaultMapUnitsPerMm" ), QStringLiteral ( " /" ), 1 ) * QgsUnitTypes::fromUnitToUnitFactor ( QgsProject::instance ()-> crs (). mapUnits (), QgsUnitTypes::DistanceMillimeters ) );
653
653
654
654
if ( QgsProject::instance ()->crs ().isGeographic () )
655
655
{
@@ -1324,7 +1324,7 @@ void QgsProjectProperties::apply()
1324
1324
}
1325
1325
else
1326
1326
{
1327
- defaultMapUnitsPerMm = mWMSDefaultMapUnitScale ->scale () / 1000 ;
1327
+ defaultMapUnitsPerMm = mWMSDefaultMapUnitScale ->scale () / QgsUnitTypes::fromUnitToUnitFactor ( QgsProject::instance ()-> crs (). mapUnits (), QgsUnitTypes::DistanceMillimeters ) ;
1328
1328
}
1329
1329
1330
1330
QgsProject::instance ()->writeEntry ( QStringLiteral ( " WMSDefaultMapUnitsPerMm" ), QStringLiteral ( " /" ), defaultMapUnitsPerMm );
0 commit comments