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

commits at openlayers.org commits at openlayers.org
Mon Mar 5 18:41:58 EST 2007


Author: sderle
Date: 2007-03-05 18:41:51 -0500 (Mon, 05 Mar 2007)
New Revision: 2355

Modified:
   sandbox/vector-2.4/lib/OpenLayers/Geometry/Collection.js
Log:
Add initialize() function to Collection to init this.components.

Modified: sandbox/vector-2.4/lib/OpenLayers/Geometry/Collection.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Geometry/Collection.js	2007-03-05 23:28:18 UTC (rev 2354)
+++ sandbox/vector-2.4/lib/OpenLayers/Geometry/Collection.js	2007-03-05 23:41:51 UTC (rev 2355)
@@ -9,14 +9,24 @@
  */
 OpenLayers.Geometry.Collection = function() {}
 OpenLayers.Geometry.Collection.prototype = OpenLayers.Class.inherit( OpenLayers.Geometry, {
+    /** @type Array(OpenLayers.Geometry) */
+    components: null,
 
     /**
-     * @returns An exact clone of this OpenLayers.Feature
-     * @type OpenLayers.Feature
+    * @constructor
+    **/
+    initialize: function () {
+        OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
+        this.components = [];
+    },
+
+    /**
+     * @returns An exact clone of this collection
+     * @type OpenLayers.Geometry.Collection
      */
     clone: function (obj) {
         if (obj == null) {
-            obj = eval ("new " + this.CLASS_NAME + "()");
+            obj = eval("new " + this.CLASS_NAME + "()");
         }
         
         for (var i = 0; i < this.components.length; i++) {



More information about the Commits mailing list