[OpenLayers-Commits] r11414 - in sandbox/ahocevar/layercontainer: . lib/OpenLayers tests

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Feb 24 08:39:56 EST 2011


Author: ahocevar
Date: 2011-02-24 05:39:56 -0800 (Thu, 24 Feb 2011)
New Revision: 11414

Modified:
   sandbox/ahocevar/layercontainer/
   sandbox/ahocevar/layercontainer/lib/OpenLayers/Util.js
   sandbox/ahocevar/layercontainer/tests/Util.html
Log:
merging from trunk


Property changes on: sandbox/ahocevar/layercontainer
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11266-11374,11376-11383,11385-11397
   + /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11266-11374,11376-11383,11385-11397,11400-11413

Modified: sandbox/ahocevar/layercontainer/lib/OpenLayers/Util.js
===================================================================
--- sandbox/ahocevar/layercontainer/lib/OpenLayers/Util.js	2011-02-24 13:37:57 UTC (rev 11413)
+++ sandbox/ahocevar/layercontainer/lib/OpenLayers/Util.js	2011-02-24 13:39:56 UTC (rev 11414)
@@ -1849,6 +1849,15 @@
     coordinateseconds =  Math.round(coordinateseconds*10);
     coordinateseconds /= 10;
 
+    if( coordinateseconds >= 60) { 
+        coordinateseconds -= 60; 
+        coordinateminutes += 1; 
+        if( coordinateminutes >= 60) { 
+            coordinateminutes -= 60; 
+            coordinatedegrees += 1; 
+        } 
+    }
+    
     if( coordinatedegrees < 10 ) {
         coordinatedegrees = "0" + coordinatedegrees;
     }

Modified: sandbox/ahocevar/layercontainer/tests/Util.html
===================================================================
--- sandbox/ahocevar/layercontainer/tests/Util.html	2011-02-24 13:37:57 UTC (rev 11413)
+++ sandbox/ahocevar/layercontainer/tests/Util.html	2011-02-24 13:39:56 UTC (rev 11414)
@@ -1101,6 +1101,12 @@
         t.eq(OpenLayers.Util.toFloat(b1), OpenLayers.Util.toFloat(b2),
             "toFloat rounds large floats correctly #2");
     }
+    function test_getFormattedLonLat(t) {
+        t.plan(1);
+        var z = 2 + (4/60) - 0.000002 ;
+        t.eq(OpenLayers.Util.getFormattedLonLat(z,"lon"), "02°04'00\"E",
+            "LonLat does not show 60 seconds.");
+    }
   </script>
 </head>
 <body>



More information about the Commits mailing list