[OpenLayers-Commits] r2334 - sandbox/vector-2.4/lib/OpenLayers/Geometry

commits at openlayers.org commits at openlayers.org
Mon Mar 5 14:32:33 EST 2007


Author: euzuro
Date: 2007-03-05 14:32:32 -0500 (Mon, 05 Mar 2007)
New Revision: 2334

Modified:
   sandbox/vector-2.4/lib/OpenLayers/Geometry/Curve.js
Log:
begin code standardsing Curve.js

Modified: sandbox/vector-2.4/lib/OpenLayers/Geometry/Curve.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Geometry/Curve.js	2007-03-05 19:17:07 UTC (rev 2333)
+++ sandbox/vector-2.4/lib/OpenLayers/Geometry/Curve.js	2007-03-05 19:32:32 UTC (rev 2334)
@@ -12,6 +12,9 @@
 OpenLayers.Geometry.Curve.prototype = 
   OpenLayers.Class.inherit(OpenLayers.Geometry, {
 
+    /** @type Array(OpenLayers.Geometry.Point) */
+    path: null,
+
     /**
     * @constructor
     *
@@ -29,8 +32,6 @@
         }
                 
         this.bounds = this.getBounds();
-//        this.bbox = new OpenLayers.Geometry.Rectangle();
-//        this.bbox.geometry = this;
     },
     
     /**
@@ -57,6 +58,7 @@
      * @return {OpenLayers.Bounds}
      */
     getBounds: function(){
+        var bounds = null;
         if (this.path.length > 0) {
             var xmin, ymin, xmax, ymax = null;
             for (var i=0; i < this.path.length; i++) {
@@ -74,11 +76,9 @@
                     ymax = point.lat;
                 }
             }
-            var bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
-            return bounds;
-        } else {
-            return null;
+            bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
         }
+        return bounds;
     },
 
     /**
@@ -112,10 +112,17 @@
         this.path = OpenLayers.Util.removeItem(this.path, point);
     },
     
+    /**
+     * @returns 
+     * @type float
+     */
     getLength: function() {
         return OpenLayers.Util.length(this.path);
     },
-    
+
+    /**
+     * 
+     */    
     destroy: function () {
         this.path.length = 0;
         this.path = null;



More information about the Commits mailing list