Added IControl interface in add/remove Control (#23187)

The API documentation specifies that controls only need to implement IControl interface, however the current addControl requires Control class.

Suggestion is to overload the addControl and removeControl methods to allow for this, while to not break the existing controls like NavigationControl.
This commit is contained in:
BrennanCB
2018-01-29 22:41:59 +02:00
committed by Sheetal Nandi
parent 3dca396263
commit d8c895891b

View File

@@ -26,8 +26,12 @@ declare namespace mapboxgl {
constructor(options?: MapboxOptions);
addControl(control: Control, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this;
addControl(control: IControl, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this;
removeControl(control: Control): this;
removeControl(control: IControl): this;
addClass(klass: string, options?: mapboxgl.StyleOptions): this;