? 920418_accept_geometrycollection.patch
? includes/behaviors/js/.openlayers_behavior_drawfeatures.js.swp
? js/.openlayers.js.swp
Index: includes/behaviors/js/openlayers_behavior_drawfeatures.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/includes/behaviors/js/Attic/openlayers_behavior_drawfeatures.js,v
retrieving revision 1.1.2.15
diff -u -p -r1.1.2.15 openlayers_behavior_drawfeatures.js
--- includes/behaviors/js/openlayers_behavior_drawfeatures.js	26 Aug 2010 16:23:52 -0000	1.1.2.15
+++ includes/behaviors/js/openlayers_behavior_drawfeatures.js	24 Sep 2010 09:39:07 -0000
@@ -53,8 +53,11 @@ Drupal.behaviors.openlayers_behavior_dra
     if (this.element.text() != '') {
       var wktFormat = new OpenLayers.Format.WKT();
       var features = wktFormat.read(this.element.text());
-      
+
       if (features.constructor == Array) {
+        if (features.length == 1 && features[0] == undefined) {
+          features = [];
+        }
         for (var i in features) {
           features[i].geometry = features[i].geometry.transform(
             new OpenLayers.Projection('EPSG:4326'),
@@ -81,8 +84,6 @@ Drupal.behaviors.openlayers_behavior_dra
     dataLayer.events.register('featuremodified', this,
       openlayers_behavior_drawfeatures_update);
 
-
-    
     var control = new OpenLayers.Control.EditingToolbar(dataLayer);
     data.openlayers.addControl(control);
     control.activate();
Index: js/openlayers.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/js/openlayers.js,v
retrieving revision 1.47.2.37
diff -u -p -r1.47.2.37 openlayers.js
--- js/openlayers.js	14 Sep 2010 07:13:40 -0000	1.47.2.37
+++ js/openlayers.js	24 Sep 2010 09:39:07 -0000
@@ -224,13 +224,17 @@ Drupal.openlayers = {
         var newFeatureSet = [];
 
         // Check to see if it is a new feature, or an array of new features.
-        if (typeof(newFeatureObject[0]) === 'undefined'){
+        if ('geometry' in newFeatureObject){
           newFeatureSet[0] = newFeatureObject;
         }
-        else{
+        else {
           newFeatureSet = newFeatureObject;
         }
 
+        if (newFeatureSet.length == 1 && newFeatureSet[0] == undefined) {
+          newFeatureSet = [];
+        }
+
         // Go through new features
         for (var i in newFeatureSet) {
           var newFeature = newFeatureSet[i];
@@ -266,6 +270,7 @@ Drupal.openlayers = {
 
           // Push new features
           newFeatures.push(newFeature);
+          }
         }
       }
     }
