Select to view content in your preferred language

Sketch editor not receiving points with polygon selection mode

146
1
3 weeks ago
HawkMan
New Contributor

I have an existing app that currently uses .freehandPolygon as the creation mode for its sketch editor (100.15.2). I am trying to add .polygon as a new creation mode, but when I start the sketch editor with .polygon, I am unable to tap to create a new point. The map will zoom on double tap, but nothing happens when I single tap on the screen (simulator).

I am new to .polygon so I can't tell if I am missing something. The .freehand* and .rectangle creation modes are working fine. Do I need to call insertVertexAfterSelectedVertexWithPoint() somewhere? If so, where?

0 Kudos
1 Reply
Ting
by Esri Contributor
Esri Contributor

Thanks for reaching out! As its name suggested, "freehand" polygon follows the cursor (finger) as it moves on the screen. On iOS, that is tap-then-drag gesture. This gesture is to enable a "continuous" path when you draw the polygon, in contrast to the old-fashion polygon where the places you tap become vertices.

You can try the behavior by downloading the 100.x samples app from App Store, or build the app from source from this repo. Use the "Sketch on the map" sample.

Also encourage you to check out the 200.x SDK if you are interested in migrating the app to the newer version using SwiftUI and many new features! We have made many enhancements to the original sketch editor in 100.x, and it becomes the new geometry editor. See this post for an idea.

Let me know if you have more questions.

 

Edit: Oops, I might have misread your question. Checkout the Sketch on the map sample's source code to see if it helps.

- Freehand polygon: tap then drag gesture to create polygon

- Polygon: tap to create vertices

0 Kudos