Hey all,
I am struggling with an error on trying to add a point in code. The code is in a viewmodel as I was going to do the adds through a service, but then read all the amazing autoeditting capabilities of the Silverlight API, so I am trying them out... I must be missing something. The error I get is
Code 400: Unable to Complete Task.
Here is the code, the error I capture on the SaveEditsFailed event.
SimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol()
{
Size = 5,
Style = SimpleMarkerSymbol.SimpleMarkerStyle.Circle,
Color = new SolidColorBrush(Colors.Green)
};
MapPoint newPoint = new MapPoint(Double.Parse(Longitude), Double.Parse(Latitude));
scoutingEvents.SaveEditsFailed += new EventHandler<ESRI.ArcGIS.Client.Tasks.TaskFailedEventArgs>(scoutingEvents_SaveEditsFailed);
scoutingEvents.EndSaveEdits += new EventHandler<ESRI.ArcGIS.Client.Tasks.EndEditEventArgs>(scoutingEvents_EndSaveEdits);
Graphic newGraphic = new Graphic()
{
Symbol = markerSymbol,
Geometry = mercator.FromGeographic(newPoint)
};
newGraphic.Attributes.Add("ScoutingEventsId", 1);
newGraphic.Attributes.Add("Title", Title);
newGraphic.Attributes.Add("Description", Description);
if (scoutingEvents.Graphics == null)
{
scoutingEvents.Graphics = new GraphicCollection();
}
scoutingEvents.Graphics.Add(newGraphic);
scoutingEvents.SaveEdits();
any help is greatly appreciated