[OpenLayers-Commits] r12092 - sandbox/tschaub/editing/tests/Geometry

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Jun 16 13:00:37 EDT 2011


Author: tschaub
Date: 2011-06-16 10:00:36 -0700 (Thu, 16 Jun 2011)
New Revision: 12092

Modified:
   sandbox/tschaub/editing/tests/Geometry/Polygon.html
Log:
Test for polygon from bounds.

Modified: sandbox/tschaub/editing/tests/Geometry/Polygon.html
===================================================================
--- sandbox/tschaub/editing/tests/Geometry/Polygon.html	2011-06-16 16:41:22 UTC (rev 12091)
+++ sandbox/tschaub/editing/tests/Geometry/Polygon.html	2011-06-16 17:00:36 UTC (rev 12092)
@@ -373,7 +373,21 @@
         
     }
     
+    function test_fromBounds(t) {
+        
+        t.plan(1);
 
+        var bounds = new OpenLayers.Bounds(0, 0, 100, 50);
+        var polygon = OpenLayers.Geometry.Polygon.fromBounds(bounds);
+        
+        var format = new OpenLayers.Format.WKT();
+        var wkt = format.write(new OpenLayers.Feature.Vector(polygon));
+        
+        t.eq(wkt, "POLYGON((0 50,100 50,100 0,0 0,0 50))", "correct polygon from bounds");
+        
+    }
+    
+
   </script>
 </head>
 <body>



More information about the Commits mailing list