Is there any code reference to allow a user to select a line segment and then click a point along that selected line segment to split the line into two pieces? split location is user defined by a click.....
Any thoughts on my last post...the example did not seem to keep both portions on the line it was splitting....seemed to jsut be cutting it and ditching the other portion.
I was trying to example but it looks like it cuts and only keeps the right side? Need both parts kept....
example: Edit fiddle - JSFiddle
I did see your example Wee Yeo...this is doing exactly what I want....although its a polygon...
example: Geometry Engine Showcase
1. does this work for polylines as well?
2. I have not grabbed code from Github before.....it looks like the above exmaple is using the "ge-demo" how do I grab this and bring it to my server?
Samples:
GitHub - ekenes/esri-js-samples: Some select samples using the ArcGIS API for JavaScript
Demo: GiGeometry Engine Showcase https://github.com/ekenes/esri-js-samples
Any working examples of this? or a jsfiddle?
You can use the API's geometry engine, which has a cut method:
esri/geometry/geometryEngine | API Reference | ArcGIS API for JavaScript
The user will need to draw a line rather than just clicking to create a point, but it works in the same way.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.