I’m trying to move a feature to the location I click at on the mouse. For anything other than a point, the mouse click location will be the new center location of the feature.
Originally I was just updating the shape, and it was moved to the mouse location, but I noticed the actual Feature was still at the old location:
var shape = (PolygonShape)myFeature.GetShape(); var centerPolyPoint = shape.GetCenterPoint(); var mousePoint = new PointShape(e.WorldX, e.WorldY); double xOffSet = Math.Abs(mousePoint.X - centerPolyPoint.X); double yOffset = Math.Abs(mousePoint.Y - centerPolyPoint.Y); myLayer.EditTools.BeginTransaction(); shape.TranslateByOffset(xOffSet, yOffset); myLayer.EditTools.Update(shape); myLayer.EditTools.CommitTransaction();
So how can I update the actual feature and not just the shape?