[Leaflet] Making an L.Control class that extends L.Class so you can extend Control (#13954)

* Need to make static Class functions available on Control so you can extend Control class

* The latest leaflet 0.7.x added the PositionString type to the L namespace

* Specifying Control to only be a class that extends Class

* Synching back the mapzen changes
This commit is contained in:
Ryan Blace
2017-01-13 09:29:53 -08:00
committed by Andy
parent 08e9679d95
commit 20235151e8
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -963,7 +963,7 @@ declare namespace L {
position?: ControlPosition;
}
export interface Control {
export class Control extends Class {
getPosition(): ControlPosition;
setPosition(position: ControlPosition): this;
getContainer(): HTMLElement;
+7
View File
@@ -390,3 +390,10 @@ class MyDivIcon extends L.DivIcon {
super();
}
}
let myControlClass = L.Control.extend({});
let myControl = new myControlClass();
L.Control.include({});
L.Control.mergeOptions({});
L.Control.addInitHook(() => {});