[OpenLayers-Commits] r3176 - sandbox/tschaub/geojson/lib/OpenLayers/Format

commits at openlayers.org commits at openlayers.org
Thu May 24 10:25:38 EDT 2007


Author: tschaub
Date: 2007-05-24 10:25:38 -0400 (Thu, 24 May 2007)
New Revision: 3176

Modified:
   sandbox/tschaub/geojson/lib/OpenLayers/Format/GeoJSON.js
Log:
box shmox

Modified: sandbox/tschaub/geojson/lib/OpenLayers/Format/GeoJSON.js
===================================================================
--- sandbox/tschaub/geojson/lib/OpenLayers/Format/GeoJSON.js	2007-05-24 13:46:50 UTC (rev 3175)
+++ sandbox/tschaub/geojson/lib/OpenLayers/Format/GeoJSON.js	2007-05-24 14:25:38 UTC (rev 3176)
@@ -319,16 +319,16 @@
          * @private
          */
         "box": function(array) {
-            if(array.length != 4) {
-                throw "GeoJSON box coordinates must have 4 elements";
+            if(array.length != 2) {
+                throw "GeoJSON box coordinates must have 2 elements";
             }
             return new OpenLayers.Geometry.Polygon([
                 new OpenLayers.Geometry.LinearRing([
-                    new OpenLayers.Geometry.Point(array[0], array[1]),
-                    new OpenLayers.Geometry.Point(array[2], array[1]),
-                    new OpenLayers.Geometry.Point(array[2], array[3]),
-                    new OpenLayers.Geometry.Point(array[0], array[3]),
-                    new OpenLayers.Geometry.Point(array[0], array[1])
+                    new OpenLayers.Geometry.Point(array[0][0], array[0][1]),
+                    new OpenLayers.Geometry.Point(array[1][0], array[0][1]),
+                    new OpenLayers.Geometry.Point(array[1][0], array[1][1]),
+                    new OpenLayers.Geometry.Point(array[0][0], array[1][1]),
+                    new OpenLayers.Geometry.Point(array[0][0], array[0][1])
                 ])
             ]);
         }



More information about the Commits mailing list