Select to view content in your preferred language

A way to disable Vertex Add on Vertex Editing in iOS SDK

1393
5
06-10-2021 02:55 PM
EricKirk
Occasional Contributor

In attempting to prevent unintentional vertex additions when a user is trying to pan the map during a polygon geometry edit, is there any way to disable this default behavior of vertex adds on all touch events when a polygon edit session is active (allowVertexEditing) within the iOS SDK?  We want to allow them to move vertices within the polygon but there is no need to add new vertices outside of the ones generated on existing vertex moves.

Tags (1)
0 Kudos
5 Replies
MarkDostal
Esri Regular Contributor

Adding a new vertex should only happen on a single-tap event.  Panning the map is a tap and drag, which should not trigger the adding of a vertex.

You can take a look a the MeasureToolbar in the ArcGIS Runtime Toolkit for iOS for an example implementation of the `AGSSketchEditor` that exhibits the above behavior.

If that doesn't help let me know.

Mark

0 Kudos
EricKirk
Occasional Contributor

Thanks for the reply Mark.  It's definitely understood that the tap and drag is for panning. We have found there are sort of two scenarios where this default behavior of new vertex add on single-tap causes problems.  First is when attempting to select an existing vertex to move it, they miss it and get a new vertex instead. Secondly when trying to pan, they don't hold their touch long enough and then unexpectedly get a new vertex instead.  This results in a bad UX for these edit sessions where the chances of wanting a new vertex add is very low.   The rare chance they would want to add a vertex during an edit is better suited for  it's own workflow vs. a different touch event.  Here is the javascript example and you can see they don't add a vertex on a single click.  https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement/

So our hope here is to have a way to disable that new vertex add on a single-tap event to avoid this UX problem. 

Eric

0 Kudos
MarkDostal
Esri Regular Contributor

Eric,

Thank you for the clarification.  After a quick look, I don't see anything that will immediately solve your problem, but let me dig into it a bit more and get back to you.

Cheers,

Mark

0 Kudos
RyanOlson1
Esri Contributor

There is an `editConfiguration` property of the sketch editor. On that property you can set the `vertexEditMode` to `AGSSketchVertexEditModeSelectOnly` (`.selectOnly` if using Swift). I think that should do what you want:

 

 

/**

 Specifies permitted operations on the vertices of the geometry.

 @since 100.2

 */

typedef NS_ENUM(NSInteger, AGSSketchVertexEditMode) {

    AGSSketchVertexEditModeInteractionEdit, /*!< Users can interactively select, add, remove, and move vertices. */

    AGSSketchVertexEditModeSelectOnly       /*!< Users can interactively only select vertices. Vertices cannot be added, moved, or removed interactively. */

};

 

0 Kudos
RyanOlson1
Esri Contributor

Nevermind - I realize that you still want to be able to move vertices. I don't think we have anything at this time that allows you to move but not add vertices.