Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm interested in passing a geometry object with certain attributes to an exposed feature class for committed edits. Essentially, I want to manually create a new feature without the template pane or editor widget. The geometry and attributes are both pre-defined, and the user just needs to select one pair from a group and push an "Add to Geodatabase" button.

I'm reading through the documentation and I can't see a clear way to do this. I see that if I don't want the pane or widget, then I need to use a geometry service, but I don't see a "create feature" method, or something that accepts a geometry object or attributes.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

have you seen this sample?

in general, whether you use the TemplatePicker or not, the approach you should take is the same. That is to instantiate a Graphic object using your geometry and attributes and pass the graphic within FeatureLayer.applyEdits().

depending on the argument position of the graphic, this method allows adding new features, editing existing feature geometry or attributes and deleting as well.

share|improve this answer
    
Thanks John, this is exactly what was needed. I think I breezed over this sample because it included the template picker, but I see that's not a vital part of the process. –  user30052 Jun 28 '14 at 13:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.