AnsweredAssumed Answered

SketchEditor.GeometryChanged not firing consistently when moving a point by dragging it

Question asked by azatrain on Aug 23, 2018
Latest reply on Aug 24, 2018 by azatrain

I'm writing a tool that allows my users to click on a point in the map and then drag it and drop it on a new location.  This works perfectly in the WPF API, but in the Xamarin API there are times where the sketch editor does not appear to know that a geometry edit has occurred.  I've tried to force a complete on the sketch editor as well and in the same fashion CompleteCommand.CanExecute is false at times right after I complete the drag and drop.  If I don't drag and I simply select the point then tap on the new location it seems to work fine.


Here is a snippet of my code:


SketchEditConfiguration sec = new SketchEditConfiguration();
sec.AllowMove = true;
sec.AllowRotate = false;
sec.AllowVertexEditing = false;
sec.RequireSelectionBeforeDrag = false;



SketchCreationMode sketchCreationMode = SketchCreationMode.Point;
Geometry editGeom = null;



ApplicationManager.MainMapView.SketchEditor.GeometryChanged += async (s, e) =>
moveFeature.Geometry = e.NewGeometry;
await moveFeature.FeatureTable.UpdateFeatureAsync(moveFeature);


editGeom = moveFeature.Geometry;
sketchCreationMode = (SketchCreationMode)Enum.Parse(typeof(SketchCreationMode), moveFeature.Geometry.GeometryType.ToString());

await ApplicationManager.MainMapView.SketchEditor.StartAsync(editGeom, sketchCreationMode, sec);