5

I have an application using the Google Drawing manager to draw polylines and polygons on a map. Although this is an excellent library I got a question from a user if it would be possible to undo the last drawn point WHILE drawing a polyline. I have searched but I found out out this only is possible AFTER the polyline has been drawn. Does anybody have a hack to accomplish this?

Another great option would be to extend an existing polyline.

Stackbever
  • 443
  • 4
  • 15

1 Answers1

-1

Use this function for undu & redu

function undoOverlays(){
        $( "#my_shape" ).hide('slow'); 
        bounds = mapOverlays[(mapOverlays.length)-1].getPath(); console.log(bounds);
        if(bounds.length>1){
        undo_redo.push(bounds.pop());
        }
        else { $('#message_popup').html('Everything is Cleared.');$('#message_popup').show('slow');$('#message_popup').delay(2000).fadeOut('slow'); }
    }

    function redoOverlays(){
        $( "#my_shape" ).hide('slow');
        bounds = mapOverlays[(mapOverlays.length)-1].getPath();
        if(undo_redo.length>0){
        for(var i=0;i<undo_redo.length;i++);
        {
        bounds.push(undo_redo.pop());
        }
        }
        else { $('#message_popup').html('Everything is Recovered.');$('#message_popup').show('slow');$('#message_popup').delay(2000).fadeOut('slow'); }
    }
bijus
  • 161
  • 8