Raruto / leaflet-rotate

Leaflet plugin that allows to add rotation functionality to map tiles
GNU General Public License v3.0
77 stars 21 forks source link

Typescript support #17

Closed nakrout closed 1 year ago

nakrout commented 1 year ago

Is it possible to provide leaflet-rotate.d.ts? I am working on it. But, it needs more effort since I have to understand first the source code of the plugin to implement it correctly.

Thanks for your help!

Raruto commented 1 year ago

Hi @nakrout,

Is it possible to provide leaflet-rotate.d.ts?

I don't think I ever will, but any help is welcome.

I am working on it. But, it needs more effort since I have to understand first the source code of the plugin to implement it correctly.

This project makes an extensive use of a technique also known as Monkey Patching, in this regard, you can also find some information in the official leaflet documentation: Extending Leaflet - Class Theory

Once you understand that, just navigate the folder structure of both projects to know which classes/methods/properties are being changed or added:

as you can see the files in here should be pretty much the same.

Have a nice day, Raruto

nakrout commented 1 year ago

Hello @Raruto,

Thanks for your support and the useful links. I find an existing DefinitelyTyped package @types/leaflet-rotate. It worked with no issue, at least for now.

Regards.