How to edit Polygon/Polyline vertices in Javscipt 4.0+ ?

337
2
Jump to solution
05-05-2021 10:06 PM
SelectivelySocial
New Contributor II

Is there a way to edit Polygon/Polyline (drawn using the Draw API ) vertices in Javacript 4.0+ versions ?Icouldn't find any examples for this, all I could find was examples and documention for older 3.0 versions. Please help if you know anything about this.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

You can use sketch or sketchViewModel to do what you are asking provided that I understood your question correctly. This sample shows how to modify a polygon after it has been created. https://developers.arcgis.com/javascript/latest/sample-code/sketch-update-validation/

If you are creating your geometries using Draw API then please be sure to add those graphics to a graphics layer associated with the sketch view model so that they can be updated via sketch. 

Hope this helps, 

-Undral

 

View solution in original post

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

You can use sketch or sketchViewModel to do what you are asking provided that I understood your question correctly. This sample shows how to modify a polygon after it has been created. https://developers.arcgis.com/javascript/latest/sample-code/sketch-update-validation/

If you are creating your geometries using Draw API then please be sure to add those graphics to a graphics layer associated with the sketch view model so that they can be updated via sketch. 

Hope this helps, 

-Undral

 

View solution in original post

0 Kudos
SelectivelySocial
New Contributor II

Hey thanks for the reply, I'll try this. 

0 Kudos