1

I'm trying to create a set of buttons to replace the default L.Control.Draw buttons (only for a polyline, in my case). Using this answer

I have been able to replicate Draw, Edit, Delete and their associated 'Cancel' and 'Save' buttons. What I cannot figure out is how to replicate the 'Delete last point' function for the Draw button.

Community
  • 1
  • 1
MattY
  • 45
  • 4
  • 1
    Please add code and error you have at this point and see http://stackoverflow.com/help/how-to-ask for asking better questions – davejal Nov 20 '15 at 01:28

1 Answers1

3

Call the deleteLastVertex method on your draw instance:

var drawPolyline = new L.Draw.Polyline(map, drawControl.options.polyline).enable();

drawPolyline.deleteLastVertex();
iH8
  • 27,722
  • 4
  • 67
  • 76