Wednesday 21 June 2017

Custom functions for SAVE and CANCEL on Leaflet.draw edit control


I have added an edit control on my map which is working fine (On the Frontend);


var editControls = new L.Control.Draw({
draw: false,
edit: {
featureGroup: this.updateGeomLyr
}
}).addTo(this.map);


enter image description here


Now, when I save or cancel my changes, the event "draw:editstop" is called


this.map.on("draw:editstop", e => {
this.updateGeomLyr.clearLayers();
this.overlapLyr.clearLayers();

//if saved;

//if cancelled,

});

But I want separate backend functions to be called on SAVE ad CANCEL. I couldn't find any attribute in the event "e" which shows if save is called or cancel.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...