Select to view content in your preferred language

Sketch Widget Snapping get Snapped Point's data

03-15-2023 12:59 PM
New Contributor II

I'm using the Sketch Widget for an application and it has a Point graphics layer as the feature source layer, which the Sketch Widget uses to snap to when hovering around the map. I need to grab the coordinates of the point being snapped to.

I created a basic Code Pen to demonstrate the snapping:

In the Code Pen, click the "Draw Point" button in the top-right of the map. Cursor should change to crosshairs. When you move the cursor around the map, you can see the lat/long values on the left. When the cursor is close enough to snap to the black point, the point turns orange. While the point is orange, you can see that the lat/long values continue to change as you move around the point, but I need to make it to where if the Sketch tool has snapped to a point, it will grab that point's coordinates.

Does anyone know how to accomplish that?

0 Kudos
0 Replies