Cut line in to two segments

06-14-2017 04:47 AM
New Contributor II

I am looking for an example or if there is a custom code that allows an user to drop a point on a line segment and to split the line into two segments and I need to find the geometry of those two line segments and apply the edits to the feature layer.

I see a geometryengine cut method. Any examples?

Thank you!

0 Kudos
1 Reply
MVP Legendary Contributor

esri user,

   Allowing the user to place a point would require extreme precision by the end user and they would not likely intersect the line with their click location. This is why the GeometryEngine uses a polyline as the cutter. There is really no need for a sample as the method is extremely simple you specify the input geometry (polyline or polygon) and the cutter geometry (must be polyline) and the async result will be two geometries. You would them delete the original geometry and add the two new ones using applyEdits.