mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
Merge pull request #28422 from kevinhughes27/leaflet-editable-commit-drawing
add commitDrawing to leaflet-editable editTools
This commit is contained in:
5
types/leaflet-editable/index.d.ts
vendored
5
types/leaflet-editable/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user