[OpenLayers-Users] copy feature

Sergeant_york electronicpanda at gmail.com
Sun Feb 3 09:33:05 PST 2013


assuming the origin layer is a OpenLayers.Layer.Vector and named as "layer1"
and another layer is from same class and named "layer2":


var featuresToCopy= layer1.features;
layer2.addFeatures(featuresToCopy);

assuming origin layer is a OpenLayers.Layer.WMS and your edit layer is
OpenLayers.Layer.Vector:
Take features like in example requests:
http://docs.geoserver.org/stable/en/user/services/wfs/reference.html#getfeature
then add them to layer2 as it was written above

http://dev.openlayers.org/docs/files/OpenLayers/Layer/Vector-js.html



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/copy-feature-tp5031612p5031805.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list