I have changed it from a graphic.geometry to a polygon and it is still doing the same thing.
It works the first time I reshape then when I select the feature, assign that to my selected graphic object and then try and reshape I get this error. Here is a code snippit.
It returns the error on the reshapecompletehandler.
private function reshapepolygon():void
{
map.removeEventListener(MapMouseEvent.MAP_CLICK, map_mapClickHandler);
reshapedrawTool.activate(DrawTool.POLYLINE);
}
protected function reshape_drawEndHandler(event:DrawEvent):void
{
var drawnLine:Polyline = Polyline(event.graphic.geometry);
myGeometryService.addEventListener(GeometryServiceEvent.RESHAPE_COMPLETE, reshapeCompleteHandler);
var myPolygon:Polygon = Polygon(selectedGraphic.geometry);
myGeometryService.reshape(myPolygon,drawnLine)
reshapedrawTool.deactivate();
map.addEventListener(MapMouseEvent.MAP_CLICK, map_mapClickHandler);
}
private function reshapeCompleteHandler(event:GeometryServiceEvent):void
{
Alert.show("reshape Complete")
var newAtttrs:* = ObjectUtil.copy(selectedGraphic.attributes);
var myPolygon:Polygon = new Polygon;
myPolygon.rings = event.result.rings;
var newGraphic:Graphic = new Graphic(myPolygon, null, newAtttrs);
incidentsPolygonLayer.addEventListener(FeatureLayerEvent.EDITS_COMPLETE,editscomplete)
incidentsPolygonLayer.applyEdits([ newGraphic ], null,incidentsPolygonLayer.selectedFeatures);
}
The geometryservice.reshapeLastResult is the same as the event returns.
com.esri.ags.geometry.Geometry (@afd16b9)
defaultSymbol <exception thrown by getter>
extent <exception thrown by getter>
spatialReference null
type <exception thrown by getter>
The mypolygon and drawnline both seem to look OK.