[OpenLayers-Users] Multipolygon to Polygons

vGIS valentino1s73s at gmx.net
Fri Sep 21 02:01:45 PDT 2012


Looks like the for-loop wasn't okay, I changed it to:

			for(f in MPolyFeature) {
				for(i in MPolyFeature[f].geometry.components) {
					var feature = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.MultiPolygon());
					var poly = new
OpenLayers.Geometry.Polygon(MPolyFeature[f].geometry.components[i]);
					feature.geometry.components.push(poly);	 
					feature.attributes.typ = MPolyFeature[f].attributes.typ;
					feature.attributes.tst = MPolyFeature[f].attributes.tst;
					feature.state = OpenLayers.State.INSERT;
					features.push(feature);
				}				
			}
			
			wfs_polygon.addFeatures(features);
			wfs_mpolygon.removeFeatures(MPolyFeature);
			wfs_polygon.redraw();
		}

But, that causes an Error: "TypeError: a is undefined ...function(a){var
b=this.createElementNSPlus("gml:interior");this.writeNode("Linea... in
OpenLayers.js Line 383"



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Multipolygon-to-Polygons-tp5003436p5003483.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list