[OpenLayers-Users] Multipolygon to Polygons

Slawomir Messner slawomir.messner at staff.uni-marburg.de
Fri Sep 21 01:19:01 PDT 2012


you must not forget the

MPolyFeature._geometry_.components


Am 21.09.2012 10:13, schrieb vGIS:
> 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.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>


-- 
--------------------------------------------------
Slawomir Messner
Forschungszentrum "Deutscher Sprachatlas"
06421-28-24981

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120921/49107c06/attachment.html>


More information about the Users mailing list