ThinkGeo.com    |     Documentation    |     Premium Support

Editing Lineshape Shapefile

Greetings,


I need to allow the user to edit a shapefile containing lines by dragging a vertex, adding a vertex, and removing a vertex.  Furthermore, I need it so that two different lineshapes share a vertex (one starts exactly where the other ends, like a road network), that when the user moves a vertex of one line, all the other verticies of all the other lines stay "locked" with that vertex and move with it.


Any pointers or samples that would help me achieve this would be appreciated.


Thanks for your time and help,


.Ryan.



 In the Code Community, we have several projects related to editing shapes by dragging vertices, snapping to other vertices etc. While we don't have a project showing the exact case you have, we have something pretty similar in Snap To Layer. You will see how you can drag a vertex of a line and snap it to a vertex of a polygon within a certain tolerance. I think that from this sample, you can easily adapt for your case.


code.thinkgeo.com/projects/show/snaptolayer


You can also check other projects related to editing layers showing other techniques such as:


code.thinkgeo.com/projects/show/draggedpointstyle


code.thinkgeo.com/projects/s...stylelabel


code.thinkgeo.com/projects/show/snappingtovertex


You will find different techniques for manipulating and editing layer. Keep in mind that for all your editing need the key class here is the EditInteractiveOverlay.


I realize that one of your requirements is to have the ability to add and remove vertices from a a line. We don't have a project showing specifically that but this is a good idea for a new project in the Code Community. We will soon work on publishing a project for that in the Code Community. Thank you for your idea.