[Mapbender-commits] r2075 - branches/2.5/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Feb 8 09:14:38 EST 2008


Author: verenadiewald
Date: 2008-02-08 09:14:38 -0500 (Fri, 08 Feb 2008)
New Revision: 2075

Modified:
   branches/2.5/http/javascripts/geometry.js
Log:
added geomtypes multilinestring and multipolygon to function importGeoJSON()

Modified: branches/2.5/http/javascripts/geometry.js
===================================================================
--- branches/2.5/http/javascripts/geometry.js	2008-02-08 12:56:06 UTC (rev 2074)
+++ branches/2.5/http/javascripts/geometry.js	2008-02-08 14:14:38 UTC (rev 2075)
@@ -342,6 +342,20 @@
 																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		this.close();
 																		break;
+																		
+																	case "MultiLineString":
+																		//
+																		// MULTILINESTRING
+																		//
+																		this.addMember(geomType.line);
+																		this.get(-1).addGeometry();
+																		for (var m = 0; m < coordinates.length; m++) {
+																			var currentPoint = coordinates[m];
+																			this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+																		}
+																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
+																		this.close();
+																		break;
 																	
 																	case "Polygon":
 																		//
@@ -359,6 +373,23 @@
 																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		this.close();
 																		break;
+																		
+																	case "MultiPolygon":
+																		//
+																		// MULTIPOLYGON
+																		//
+																		this.addMember(geomType.polygon);
+																		for (var m = 0; m < coordinates.length; m++) {
+																			this.get(-1).addGeometry();
+																			var currentPolygon = coordinates[m];
+																			for (var n = 0; n < currentPolygon.length; n++) {
+																				var currentPoint = currentPolygon[n];
+																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+																			}
+																		}
+																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
+																		this.close();
+																		break;
 							
 																	case "GeometryCollection":
 																		var exc = new Mb_exception("Geometry: GeometryCollections are not yet supported");



More information about the Mapbender_commits mailing list