add commitDrawing to leaflet-editable editTools

This commit is contained in:
Kevin Hughes 2018-08-27 11:12:20 +01:00
parent 5e58f71c5e
commit cf5a6d80b0
No known key found for this signature in database
GPG Key ID: 47531019ABDAFEE7
2 changed files with 6 additions and 0 deletions

View File

@ -124,6 +124,11 @@ declare module 'leaflet' {
* When you need to stop any ongoing drawing, without needing to know which editor is active.
*/
stopDrawing(): void;
/**
* When you need to commit any ongoing drawing, without needing to know which editor is active.
*/
commitDrawing(): void;
}
let Editable: EditableStatic;

View File

@ -31,6 +31,7 @@ const map: L.Map = L.map('div', {
const currentPoly: L.Polygon|L.Polyline| L.Marker = map.editTools.currentPolygon;
map.editTools.stopDrawing();
map.editTools.commitDrawing();
const marker: L.Marker = map.editTools.startMarker(L.latLng(0, 0), { draggable: true });
marker.disable();