[OpenLayers-Commits] r2369 - in sandbox/vector-2.4: lib/OpenLayers/Geometry tests/Geometry

commits at openlayers.org commits at openlayers.org
Mon Mar 5 20:34:27 EST 2007


Author: sderle
Date: 2007-03-05 20:34:26 -0500 (Mon, 05 Mar 2007)
New Revision: 2369

Modified:
   sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiLineString.js
   sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPoint.js
   sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPolygon.js
   sandbox/vector-2.4/lib/OpenLayers/Geometry/Polygon.js
   sandbox/vector-2.4/tests/Geometry/test_Polygon.html
Log:
Now that Collection has an initialize() function, its subclasses should call that rather than initialize on the Geometry superclass.

Modified: sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiLineString.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiLineString.js	2007-03-06 01:33:55 UTC (rev 2368)
+++ sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiLineString.js	2007-03-06 01:34:26 UTC (rev 2369)
@@ -18,7 +18,7 @@
     * @param {Array|OpenLayers.Geometry.LineString}
     */
     initialize: function(components) {
-    	OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
+    	OpenLayers.Geometry.Collection.prototype.initialize.apply(this, arguments);
     	this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
         
         if (components != null) {

Modified: sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPoint.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPoint.js	2007-03-06 01:33:55 UTC (rev 2368)
+++ sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPoint.js	2007-03-06 01:34:26 UTC (rev 2369)
@@ -18,7 +18,7 @@
     * @param {Array|OpenLayers.Geometry.Point}
     */
     initialize: function(components) {
-    	OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
+    	OpenLayers.Geometry.Collection.prototype.initialize.apply(this, arguments);
     	this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
         
         if (components != null) {

Modified: sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPolygon.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPolygon.js	2007-03-06 01:33:55 UTC (rev 2368)
+++ sandbox/vector-2.4/lib/OpenLayers/Geometry/MultiPolygon.js	2007-03-06 01:34:26 UTC (rev 2369)
@@ -18,7 +18,7 @@
     * @param {Array|OpenLayers.Geometry.Polygon}
     */
     initialize: function(components) {
-    	OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
+    	OpenLayers.Geometry.Collection.prototype.initialize.apply(this, arguments);
     	this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
         
         if (components != null) {

Modified: sandbox/vector-2.4/lib/OpenLayers/Geometry/Polygon.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Geometry/Polygon.js	2007-03-06 01:33:55 UTC (rev 2368)
+++ sandbox/vector-2.4/lib/OpenLayers/Geometry/Polygon.js	2007-03-06 01:34:26 UTC (rev 2369)
@@ -17,7 +17,7 @@
     * @param {Array|OpenLayers.Geometry.Polygon}
     */
     initialize: function(components) {
-    	OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
+    	OpenLayers.Geometry.Collection.prototype.initialize.apply(this, arguments);
     	this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
         
         if (components != null) {

Modified: sandbox/vector-2.4/tests/Geometry/test_Polygon.html
===================================================================
--- sandbox/vector-2.4/tests/Geometry/test_Polygon.html	2007-03-06 01:33:55 UTC (rev 2368)
+++ sandbox/vector-2.4/tests/Geometry/test_Polygon.html	2007-03-06 01:34:26 UTC (rev 2369)
@@ -13,7 +13,7 @@
         polygon = new OpenLayers.Geometry.Polygon();
         t.ok( polygon instanceof OpenLayers.Geometry.Polygon, "new OpenLayers.Geometry.Polygon returns polygon object" );
         t.eq( polygon.CLASS_NAME, "OpenLayers.Geometry.Polygon", "polygon.CLASS_NAME is set correctly");
-        t.eq( polygon.components, undefined, "polygon.components is set correctly");
+        t.eq( polygon.components.length, 0, "polygon.components is set correctly");
     }
 
     function test_01a_Polygon_constructor (t) {



More information about the Commits mailing list