From cf5a6d80b0d16417f73cb948a762339846330ee2 Mon Sep 17 00:00:00 2001 From: Kevin Hughes Date: Mon, 27 Aug 2018 11:12:20 +0100 Subject: [PATCH] add commitDrawing to leaflet-editable editTools --- types/leaflet-editable/index.d.ts | 5 +++++ types/leaflet-editable/leaflet-editable-tests.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/types/leaflet-editable/index.d.ts b/types/leaflet-editable/index.d.ts index 932ca33fd2..f73befb161 100644 --- a/types/leaflet-editable/index.d.ts +++ b/types/leaflet-editable/index.d.ts @@ -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; diff --git a/types/leaflet-editable/leaflet-editable-tests.ts b/types/leaflet-editable/leaflet-editable-tests.ts index 23bcc988fb..e804fcc250 100644 --- a/types/leaflet-editable/leaflet-editable-tests.ts +++ b/types/leaflet-editable/leaflet-editable-tests.ts @@ -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();