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

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


Hi,
every vector layer has a selectedFeatures attribute. It's a list/array 
of all selected features in this layer ;)
var features = wfs_polygon.selectedFeatures;
wfs_polygon.removeFeatures(features);
other_layer.addFeatures(features );
This should work. I didn't test it.
Regards
Slawomir

Am 20.09.2012 14:15, schrieb vGIS:
> I'd like to select some features with:
>
> var choice = new OpenLayers.Control.SelectFeature(
>                  wfs_polygon,
>                  {
> 		    title: "Auswahl",
>                      displayClass: "olControlSelectFeature",
>                      clickout: true, toggle: false,
>                      multiple: false, hover: false,
>                      multipleKey: "ctrlKey"
>                  }
> );
>
> and move selected features (poly) to another vector layer with another
> geometry (multipoly).
> Therefore I'd delete the Poly geom and create multipoly geom.
>
> *But to choose only selected features, my question is:
> Where do I know from, that a feature is selected?*
>
> Kind regards,
> vGIS
>
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Move-selected-Features-to-another-geometry-layer-tp5003226.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
>



More information about the Users mailing list