Select to view content in your preferred language

Flex API Editing Feature in One Layer as a New Feature in Another Layer

766
2
04-02-2014 05:48 AM
TylerWaring
Frequent Contributor
Greetings Everyone,
I plan to extend some editing capabilities to a application that I created. The user will be adding parcel features to a parcel feature layer that is derived from out master parcel layer. Rather than have the user digitize a new parcel when they add the feature, I would like to give them the ability to select a parcel from our master parcel layer and use it's geometry for the new feature. I can get the parcel graphic from the master parcel layer just fine. However, is it possible to use this graphic to create a new feature in a separate feature layer? I'm trying to do something similar to the Edit-->Copy and Edit-->Paste functionality in ArcGIS Desktop. 
Thanks, Tyler
Tags (2)
0 Kudos
2 Replies
AndreasRuloffs1
Occasional Contributor
Hi,
if the schema of both layers are equal, then you can simply do:
secondLayer.applyEdits(firstLayer.selectedFeatures, null ,null, new AsyncResponder(copyDone, copyFailed))

firstLayer and secondLayer are both FeatureLayers and copyDone, copyFailed are methods that handle the event that edit is ready or edit failed.
Bye,
Andreas
0 Kudos
TylerWaring
Frequent Contributor
Thanks Andreas,
I'm just getting back to this project after clearing my plate of some other work. The requirements for this application demand that the schemas be slightly different. The pasteLayer will only have one additional field. Otherwise they are the same.
Thanks, Tyler
0 Kudos