Select to view content in your preferred language

Edit Geometry Editing event

2131
3
02-01-2012 12:22 PM
Labels (1)
FlorianGimat
Deactivated User
Hi,
I am currently trying to implement a feature using the EditGeometry that consists in snapping the currently edited vertex to any kind of Graphic element on a graphic layer.
The problem is that the only feedback I have while editing is through the GeometryEdit event that is only triggered once the vertex has moved.
However, what I want is to be able to snap the vertex while I am moving it.

I tried to work with the Map control MouseMove event, but the only way to get the changes from the geometry editing is by calling the EditGeometry.StopEdit() method.
I thought I could call this method, get the changes from the editing in order to see if a point has been moved, snap it if necessary and call the EditGeometry.StartEdit() again.
It led me to another problem that is if the StopEdit and StartEdit are called within the mouse move event callback (see following code example), the edited geometry get stucked and the only thing I have access to is to start or stop editing.

 
private void PART_Map_MouseMove(object sender, MouseEventArgs e)
{
     editGeometry.StopEdit();
     //Do some stuff here
     editGeometry.StartEdit((Graphic)editingGraphic);
}


I would really appreciate if someone could help me achieving my goal.
Also, would it possible for a feature version to get an event while the geometry is being edited?
Thank you for your help
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
We are working on including Geometry in the GeometryEditEventArgs, so you wouldn't need to call StopEdit() to get current state of geometry.
These threads are  probably related: http://forums.arcgis.com/threads/46679-NullReferenceException-when-using-EditGeometry, http://forums.arcgis.com/threads/46344-Graphic-disappear-on-save-edits
0 Kudos
FlorianGimat
Deactivated User
Hello,
Well, I had already looked at these posts but that didn't help me.
The problem is that the GeometryEditEventArgs is passed through the GeometryEdit event. However, this event is only triggered once an operation has been successfully completed (vertex moved, geometry moved). In my case, I need to know when the vertex is actually moving while it's moving in order to determine whether I can snap the vertices or not to another graphic element. This would feel more natural to snap the vertex while moving it than waiting for the move to complete and then snap the vertex.
I also looked at the snap possibility offered by the EditGeometry by setting the snap key on the map beforehand. I don't really understand how it works though. Maybe I could use that instead, if I could get some info on it.
Thank you very much 🙂
0 Kudos
JenniferNery
Esri Regular Contributor
Oh sorry I misunderstood. Unfortunately grabbing geometry while moving the vertices, is not supported.
0 Kudos