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.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to