Select to view content in your preferred language

Editor widget

707
0
11-09-2012 09:56 AM
ChadBartman
Deactivated User
All

I am having issues with the editorwidget, I need to recalulate the area of a polygon when the editor widget edits the graphic.
I am using the area and parimeter example: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AreasAndLengths
and this thread: http://forums.arcgis.com/threads/25902-How-to-update-Acreage-field-after-edit-the-polygon-s-geometry...
When I edit a graphic the AreasAndLength geometry service does not fire, how is it done? And yes I am new at the programing side.
Privatevoid Editor_EditCompleted(object sender, Editor.EditEventArgs e)
{
if (e.Action == Editor.EditAction.EditVertices)
{
foreach (var edit in e.Edits)
{
ESRI.ArcGIS.Client.Geometry.
Polygon polygon = e.Edits as ESRI.ArcGIS.Client.Geometry.Polygon;
polygon.SpatialReference = map1.SpatialReference;
Graphic graphic = newGraphic();
GeometryService geometryService =
newGeometryService("http://geoservices.dnr.illinois.gov/ArcGIS/rest/services/Geometry/GeometryServer");
geometryService.AreasAndLengthsCompleted += GeometryService_AreasAndLengthsCompleted;
geometryService.Failed += GeometryService_Failed;
GraphicsLayer graphicsLayer = map1.Layers["Field Edit"] asGraphicsLayer;
graphicsLayer.Graphics.Add(graphic);
List<Graphic> graphicList = newList<Graphic>();
graphicList.Add(graphic);
geometryService.AreasAndLengthsAsync(graphicList);
// GeometryService.AreasAndLengths returns distances and areas in the units of the spatial reference.
}
}
}
Any help is greatly appreciated.
Chad
0 Kudos
0 Replies