I would like to use easy-buttons plugin with Typescript https://github.com/CliffCloud/Leaflet.EasyButton/blob/master/src/easy-button.js and but it doesn\'t come with Typescript
class EasyButton extends L.Control {
constructor(options?: EasyButtonOptions)
}
Your new L.EasyButton takes a 'EasyButtonOptions' object for the constructor. This does not match the 'L.easyButton' examples
A L.easyButton has the following options:
function easyButton(icon: string, onClick: (btn: any, map: any)=>void, title?: string, id?: string) : Control.EasyButton;
An EasyButtonOptions doesn't have a 'icon', 'onClick', 'title' or 'id' instead it takes:
interface EasyButtonOptions {
position?: ControlPosition
id?: string
type?: 'replace'|'animate'
states?: EasyButtonState[]
leafletClasses?: boolean
tagName?: string
}
So therefore, what is the equivalent of new L.EasyButton() that matches L.easyButton('fa fa-icon', () => '..', 'title) ?