[OpenLayers-Users] Multipolygon to Polygons

vGIS valentino1s73s at gmx.net
Fri Sep 21 01:13:25 PDT 2012


I tried:
                // MPolygon to Polygons
		function cmd_MPoly_to_Polys() {
		var MPolyFeature = wfs_mpolygon.selectedFeatures;
		var features = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Polygon());
		var f = null;
			for( f in MPolyFeature) {
				features[f].geometry = new
OpenLayers.Geometry.Polygon(MPolyFeature.components[f]);
				features[f].attributes.typ = MPolyFeature.attributes.typ;
				features[f].attributes.tst = MPolyFeature.attributes.tst;
				features[f].state = OpenLayers.State.INSERT;
			}
		wfs_polygon.addFeatures(features);
		wfs_mpolygon.removeFeatures(MPolyFeature);
		wfs_polygon.redraw();
		}

FireBug output: "TypeError: MPolyFeature.components is undefined ...
features[f].geometry = new
OpenLayers.Geometry.Polygon(MPolyFeature.components[f]..."



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


More information about the Users mailing list