geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.23k stars 433 forks source link

Types fix (for crucial for react-leaflet users) #1515

Open roigarmi33 opened 2 months ago

roigarmi33 commented 2 months ago

Hey! I'm using the free version with react-leaflet, and all seems to work quite well but there is one main problem which is types of event handlers. The type definitions for pm event is on interface Evented, while for react-leaflet users, the event handler's prop type (which are passed to each layer's component) are inferred LeafletEventHandlerFnMap. So far, I have built my own leaflet.d.ts file to extend the type infer to match what geoman is adding. I'd for it to come by default or listen to other possible solutions from the community

Falke-Design commented 2 months ago

Hi, we are happy to add solutions but we are nor TypeScript developers, so we are limited with our knowledge.

Any help is welcome

roigarmi33 commented 2 months ago

So basically what I did was adding another file on my own of leaflet.d.ts in my project, which is nice but it is not where it really should be placed since I'm not really supposed to define the types of the external library I am using. I think I will be able to provide some help but I only know my use cases with this library.

raprocks commented 1 month ago

@roigarmi33 could you try creating a PR with you code? ive been facing the same issue and maybe i can contribute to the PR with what you have currently built

roigarmi33 commented 4 weeks ago

Hey, it is going to take me a while to get to it (at least next week). It really should be in geoman's responsibility but I'll do my best to help in the next week or two

‫בתאריך יום ד׳, 23 באוק׳ 2024 ב-8:28 מאת ‪Rohit Patil‬‏ <‪ @.***‬‏>:‬

@roigarmi33 https://github.com/roigarmi33 could you try creating a PR with you code? ive been facing the same issue and maybe i can contribute to the PR with what you have currently built

— Reply to this email directly, view it on GitHub https://github.com/geoman-io/leaflet-geoman/issues/1515#issuecomment-2430940165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL3U47PNS7ESY3LKZ3R4PGLZ44XZDAVCNFSM6AAAAABOPLKJ6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZQHE2DAMJWGU . You are receiving this because you were mentioned.Message ID: @.***>

--

Roi Garmizo Community Connections, Maccabi Ironi Ashdod +972509066031 | ironi-ashdod.co.il/ http://ironi-ashdod.co.il/ @. @.> https://www.facebook.com/ironiashdod/ https://www.instagram.com/ironiashdod/?hl=en https://twitter.com/IroniAshdodFC?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor https://www.youtube.com/c/IroniAshdod

Create your own email signature https://www.wisestamp.com/create-own-email-signature/?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own&srcid=

roigarmi33 commented 4 weeks ago

I will see if I can get to that in the next week or so.. hope I'll have enough time