[Mapbender-commits] r5202 - branches/2.6/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Dec 17 06:02:08 EST 2009


Author: christoph
Date: 2009-12-17 06:02:07 -0500 (Thu, 17 Dec 2009)
New Revision: 5202

Modified:
   branches/2.6/http/javascripts/geometry.js
Log:
merged from trunk

Modified: branches/2.6/http/javascripts/geometry.js
===================================================================
--- branches/2.6/http/javascripts/geometry.js	2009-12-17 10:08:22 UTC (rev 5201)
+++ branches/2.6/http/javascripts/geometry.js	2009-12-17 11:02:07 UTC (rev 5202)
@@ -967,9 +967,15 @@
 			this.list.length -= 1;
 		
 			if (this.geomType == geomType.polygon){
-				if (i == tmpLength) {this.list[0] = this.list[tmpLength-1];}
-				else if (i === 0) {this.list[tmpLength-1] = this.list[0];}
-				if (this.list.length == 1){return false;}
+				if (i == tmpLength && this.complete) {
+					this.list[0] = this.list[tmpLength-1];
+				}
+				else if (i === 0) {
+					this.list[tmpLength-1] = this.list[0];
+				}
+				if (this.list.length == 1){
+					return false;
+				}
 			}
 			updateDist();
 			if(this.list.length === 0) {return false;}
@@ -1098,6 +1104,18 @@
 		}
 		return true;
 	};
+	
+	this.reopen = function () {
+		if (!complete) {
+			return false;
+		}
+		complete = false;
+		if (this.geomType == geomType.polygon){
+			this.del(-1);
+		}
+		return true;
+	};
+	
 	/**
 	 * checks if this {@link Geometry} has been closed. 
 	 *
@@ -1555,7 +1573,7 @@
 			}		
 			var key = this.getName(i);
 			var value = this.getValue(i);
-			str += "\"" + key + "\":\"" + value + "\"";
+			str += "\"" + key + "\":\"" + (value+'').replace(/([\\"'])/g, "\\$1").replace(/\u0000/g, "\\0") + "\"";
 		}
 		str += "}";
 	}



More information about the Mapbender_commits mailing list