[OpenLayers-Commits] r2010 - sandbox/vector/lib/OpenLayers

commits at openlayers.org commits at openlayers.org
Tue Dec 5 19:46:10 EST 2006


Author: camerons
Date: 2006-12-05 19:46:09 -0500 (Tue, 05 Dec 2006)
New Revision: 2010

Modified:
   sandbox/vector/lib/OpenLayers/Feature.js
Log:
Call internal setGeometry() function from initialize() instead of setting locally. (Previously this didnt handle multiple geometries)

Modified: sandbox/vector/lib/OpenLayers/Feature.js
===================================================================
--- sandbox/vector/lib/OpenLayers/Feature.js	2006-12-05 11:37:37 UTC (rev 2009)
+++ sandbox/vector/lib/OpenLayers/Feature.js	2006-12-06 00:46:09 UTC (rev 2010)
@@ -59,7 +59,7 @@
      */
     initialize: function(layer, geometry, data) {
         this.layer = layer;
-        this.geometry = geometry;
+		this.setGeometry(geometry);
         this.data = (data != null) ? data : new Object();
         this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); 
         this.state = null;
@@ -168,10 +168,11 @@
      * @param {OpenLayers.Geometry} geometry to set
      */
     setGeometry: function(geometry) {
-        this.geometry = geometry;
-        this.geometry.feature = this;
-        
-        this._setGeometryFeatureReference(this.geometry, this);
+		if(geometry){
+	        this.geometry = geometry;
+	        this.geometry.feature = this;
+	        this._setGeometryFeatureReference(this.geometry, this);
+		}
     },
     
     /**



More information about the Commits mailing list