brianj

Make point in featureclass from lat long entered in a webform

Discussion created by brianj on Apr 9, 2013
I have a web form which prompts the user for a lat and long.  I simply want the least amount of code required to insert the point into a featureclass if it does not exist and update it if it already does exist.  No map is required by the interface, just text boxes for lat and long.  I will have a primary key on the feature class that I can search on to update a point that already exists.  I found this in the Silverlight forum, but I think it would be cleaner to simply add the javascript to the web form to perform the same thing. Is that possible?

FeatureLayer layer = new FeatureLayer();
layer.Url = myLayerUrl;
layer.AutoSave = false;
Graphic feature = new Graphic();
feature.Geometry = myGeometry;
feature.Attributes.Add("SUMMARY", "hardcoded description 1000");
layer.Graphics.Add(feature);
layer.SaveEdits();

Outcomes