[fusion-commits] r1908 - trunk/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Sep 24 14:29:42 EDT 2009


Author: madair
Date: 2009-09-24 14:29:41 -0400 (Thu, 24 Sep 2009)
New Revision: 1908

Modified:
   trunk/widgets/Measure.js
Log:
re #247: convert meters to specified measure units

Modified: trunk/widgets/Measure.js
===================================================================
--- trunk/widgets/Measure.js	2009-09-24 15:32:41 UTC (rev 1907)
+++ trunk/widgets/Measure.js	2009-09-24 18:29:41 UTC (rev 1908)
@@ -285,10 +285,16 @@
             to = this.getMap().geoToPix(v[1].x,v[1].y);
             at = {x: (from.x + to.x) / 2, y: (from.y + to.y) / 2};
             quantity = geom.getGeodesicLength(proj);
+            
+            measureUnits = Fusion.METERS;
+            if (measureUnits != this.units) {
+              quantity = Fusion.convert(measureUnits, this.units, quantity);
+            }
         } else {
             var cg = geom.getCentroid();
             at = this.getMap().geoToPix(cg.x, cg.y);
             quantity = geom.getGeodesicArea(proj);
+            //TODO: result is in square meters - convert to other units?
         }
         if (quantity > 1) {
             marker.setQuantity(quantity);



More information about the fusion-commits mailing list