I have a tool on the map that lets the user draw a line. Now I want to give the user the option to split the line to multiple lines, to join them back together to one line later.

How can I do that ?

  • Aare you asking how to split the line, put it back together, or both?
    – nagytech
    May 28, 2015 at 12:41

2 Answers 2


Hi for spatial operations on the client side, take a look at the turf JS library,
else deal with it server side !

turf js

  • Eventually I used draw tool and did the split and merge on the server side and upon callback redrew the layer
    – Alophind
    May 28, 2015 at 14:29

This might help with splitting. split

Not sure about merging lines.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.