Merge pull request #19754 from YunS-Stacy/master

[leaflet-draw] Add Draw Handlers
This commit is contained in:
Benjamin Lichtman
2017-09-20 15:44:02 -07:00
committed by GitHub
2 changed files with 58 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
// Type definitions for leaflet-draw 0.4
// Project: https://github.com/Leaflet/Leaflet.draw
// Definitions by: Matt Guest <https://github.com/matt-guest>, Ryan Blace <https://github.com/reblace>
// Definitions by: Matt Guest <https://github.com/matt-guest>
// Ryan Blace <https://github.com/reblace>
// Yun Shi <https://github.com/YunS-Stacy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -252,6 +254,60 @@ declare module 'leaflet' {
const DELETESTART: string;
const DELETESTOP: string;
}
class Feature extends Handler {
initialize(
map: Map,
options: DrawOptions.PolylineOptions | DrawOptions.PolygonOptions | DrawOptions.RectangleOptions | DrawOptions.MarkerOptions | DrawOptions.EditHandlerOptions | DrawOptions.DeleteHandlerOptions
): void;
setOptions(
options: DrawOptions.PolylineOptions | DrawOptions.PolygonOptions | DrawOptions.RectangleOptions | DrawOptions.MarkerOptions | DrawOptions.EditHandlerOptions | DrawOptions.DeleteHandlerOptions
): void;
}
class SimpleShape extends Feature { }
class Marker extends Feature {
constructor(
map: Map,
options?: DrawOptions.MarkerOptions
)
}
class CircleMarker extends Feature {
constructor(
map: Map,
options?: DrawOptions.MarkerOptions
)
}
class Circle extends Feature {
constructor(
map: Map,
options?: DrawOptions.CircleOptions
)
}
class Polyline extends Feature {
constructor(
map: Map,
options?: DrawOptions.PolylineOptions
)
}
class Rectangle extends Feature {
constructor(
map: Map,
options?: DrawOptions.RectangleOptions
)
}
class Polygon extends Feature {
constructor(
map: Map,
options?: DrawOptions.PolygonOptions
)
}
}
namespace DrawEvents {

View File

@@ -7,7 +7,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"