CliffCloud / Leaflet.EasyButton

leaflet control buttons with icons and callbacks
http://cliffcloud.github.io/Leaflet.EasyButton/v1/
MIT License
520 stars 124 forks source link

Angular2, Installing with NPM result in Property 'easyButton' does not exist on type 'typeof L' #70

Closed TheSegfault closed 7 years ago

TheSegfault commented 7 years ago

I compared the repo and my node_modules, I don't have easy-button.d.ts.

Any suggestions ?

atstp commented 7 years ago

I'm not an active typescript user (paging the typescript binding author @teyc), but I'd assume a typeof L signature should come from the central leaflet library.

Do you have leaflet in your deps?

teyc commented 7 years ago

Hi atsp , it appears TheSegfault is correct. The leaflet-easybutton.d.ts somehow didn't get included in the npm package, when was it last published? The .d.ts file was added in June.

@TheSegfault as a workaround you will have to download the typing file and include that in your sources. It doesn't necessarily have to be in node_modules\leaflet-easybutton\src, Typescript seems to be fairly competent at picking these up if the directory is specified the sourceRoots option.

atstp commented 7 years ago

thanks teyc!

TheSegfault, i just added it to an npm release. Everything should work properly with the latest leaflet-easybutton@2.2.2 from npm.