Tap-and-drag sketch editor

310
1
Jump to solution
07-05-2021 05:02 AM
kris
by
New Contributor III

Hi!

We are helping a customer migrating from MapBox over to AGS :woman_dancing:

So far, all good, but they have gotten used to MapBox' sketch editor, and they are asking us to support the following "feature":

Using the AGSSketchEditor, you have to tap first to select, then it becomes possible to move a vertex on the next gesture.

They prefer to tap the vertex and just drag to edit in one go.

Does anyone have a good idea how to meet meet their habit? :) 

 

0 Kudos
1 Solution

Accepted Solutions
MarkDostal
Esri Contributor

@kris The tap and drag behavior is supported using the AGSSketchEditConfiguration class.  It has a requireSelectionBeforeDrag property, which defaults to true.  Set this to false to get the behavior you want.

You'll need to create an AGSSketchEditConfigration, set it's requireSelectionBeforeDrag property to false, then pass the configuration into your AGSSketchEditor.start() call:

let config = AGSSketchEditConfiguration()
config.requireSelectionBeforeDrag = false
lineSketchEditor.start(with: AGSSketchCreationMode.polyline,
                       editConfiguration: config)

Let us know if you have any more questions.  And good luck with your project!

Mark

View solution in original post

1 Reply
MarkDostal
Esri Contributor

@kris The tap and drag behavior is supported using the AGSSketchEditConfiguration class.  It has a requireSelectionBeforeDrag property, which defaults to true.  Set this to false to get the behavior you want.

You'll need to create an AGSSketchEditConfigration, set it's requireSelectionBeforeDrag property to false, then pass the configuration into your AGSSketchEditor.start() call:

let config = AGSSketchEditConfiguration()
config.requireSelectionBeforeDrag = false
lineSketchEditor.start(with: AGSSketchCreationMode.polyline,
                       editConfiguration: config)

Let us know if you have any more questions.  And good luck with your project!

Mark

View solution in original post