[fusion-commits] r2279 - trunk/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Fri Nov 19 11:28:24 EST 2010


Author: madair
Date: 2010-11-19 08:28:23 -0800 (Fri, 19 Nov 2010)
New Revision: 2279

Modified:
   trunk/widgets/Measure.js
Log:
re ofsc #70: store area quantity and round off total length

Modified: trunk/widgets/Measure.js
===================================================================
--- trunk/widgets/Measure.js	2010-11-19 16:17:55 UTC (rev 2278)
+++ trunk/widgets/Measure.js	2010-11-19 16:28:23 UTC (rev 2279)
@@ -360,6 +360,7 @@
                 var rate = Fusion.convert(measureUnits, this.units, 1);
                 quantity = quantity * rate * rate;
             }
+            this.areaMarker.quantity = quantity;
 
             //calculate the area in square pixels
             var resolution = this.getMap().getResolution();
@@ -609,6 +610,12 @@
         }
         this.totalDistanceMarker.domObj.style.display = 'block';
         this.totalDistanceMarker.setQuantity(totalDistance);
+        
+	if (this.distancePrecision == 0) {
+		totalDistance = Math.floor(totalDistance);
+	} else {
+		totalDistance = totalDistance.toPrecision(this.areaPrecision);
+	}
         this.totalLength = totalDistance;
       }
       if (this.measureType & Fusion.Constant.MEASURE_TYPE_AREA) {



More information about the fusion-commits mailing list