leaflet draw save event
L.EditToolbar.include({
getActions: function (handler) {
var actions = [
{
title: L.drawLocal.edit.toolbar.actions.save.title,
text: L.drawLocal.edit.toolbar.actions.save.text,
callback: this._save,
context: this
},
{
title: L.drawLocal.edit.toolbar.actions.cancel.title,
text: L.drawLocal.edit.toolbar.actions.cancel.text,
// callback: this.disable, // --- original
callback: this._cancel, // --- changed
context: this
}
];
if (handler.removeAllLayers) {
actions.push({
title: L.drawLocal.edit.toolbar.actions.clearAll.title,
text: L.drawLocal.edit.toolbar.actions.clearAll.text,
callback: this._clearAllLayers,
context: this
});
}
return actions;
},
// --- new -----------------
_cancel: function() {
this.disable();
this._map.fire('draw:editcancel');
}
});
function processCancel(e) {
console.log('draw canceled');
}
map.on('draw:editcancel', processCancel);
Also in JavaScript:
- move file from one folder to another in aws s3 nodejs
- redirect using javascript
- add jquery to wordpress
- uirouter
- jquery get src of image
- clone javascript object
- javascript remove last child element
- get input field inside div jquery
- mixin in styled components
- javascript check if two date ranges overlap
- python turnary
- js set cookie
- js int to string base
- slider js
- emmet react self closing tags
- implement cai webchat in react native
- javascript range of integers
- detect browser javascript
- javascript forEach return
- node-fetch auth basic
- javascript canvas 1px line
- how to right plain text format file in node js
- how to add class to button in javascript
- node start is too slow windows 10