[OpenLayers-Users] Move selected Features to another geometry layer

Slawomir Messner slawomir.messner at staff.uni-marburg.de
Thu Sep 20 07:42:34 PDT 2012


How about:
function cmd_Poly_add() {
  var features = wfs_polygon.selectedFeatures;
  wfs_polygon.removeFeatures(features);
var polygons = [];
var f = null;
for( f in features) {
         polygons.push(features[f].geometry);
}
var myCombinedFeature = new OpenLayers.Feature.Vector(new 
OpenLayers.Geometry.MultiPolygon(polygons ));
  myCombinedFeature .state = OpenLayers.State.INSERT;
  wfs_mpolygon.addFeatures([myCombinedFeature]);
}

Am 20.09.2012 16:13, schrieb vGIS:
> This code works perfectly :)
>
> But, still a little thing to solve: The polygons should be used to create
> one multypolygon.
>
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Move-selected-Features-to-another-geometry-layer-tp5003226p5003257.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



More information about the Users mailing list