leaflet-polygon-fillPattern icon indicating copy to clipboard operation
leaflet-polygon-fillPattern copied to clipboard

Fix for TypeScript-Support with @types/leaflet

Open Doubi88 opened this issue 3 years ago • 0 comments

Hey, thanks for your work, this was really helpful.

I use leaflet with TypeScript and in @types/leaflet, "fill" is declared as boolean, which is completely correct and should stay so, but that means that I cannot write the String "url(...)" to it. I solved that for my case by changing your code to use "fillImage" and adding this field to the PolylineOptions in a new .d.ts file in my project. I'd like to contribute this to your code, but I don't know, if the way I did this is helpful or it should be done differently. Another approach I'd like to suggest is putting this project on npm and adding an @types entry for it. But I'm not sure if that would work either, because leaflet plugins are a bit difficult to get them to work with typescript.

Doubi88 avatar Oct 04 '22 10:10 Doubi88