jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.49k stars 365 forks source link

Guide for adding a new leaflet plugin? #1012

Closed mangecoeur closed 2 years ago

mangecoeur commented 2 years ago

I would like to add some extra leaflet plugins to the ipyleaflet widget (e.g. leaflet-geoman). I'm assuming I would have to fork ipyleaflet for this to work. Is there a guide or example of how to integrate plugin?

davidbrochart commented 2 years ago

Hi @mangecoeur!

I would like to add some extra leaflet plugins to the ipyleaflet widget (e.g. leaflet-geoman)

That would be awesome! I guess @giswqs would be interested in this one.

I'm assuming I would have to fork ipyleaflet for this to work.

That's the typical git workflow if you want to submit a pull request, yes.

Is there a guide or example of how to integrate plugin?

Not really, but there are examples you can follow. In your case, you might want to look at DrawControl.js, and its Python counterpart.

mangecoeur commented 2 years ago

Great thanks for the quick reply. BTW by 'fork ipyleaflet' I had meant that I assumed you would not want to host extra plugins in the main repo, but it sounds like you actually do so even better! ;)

mangecoeur commented 2 years ago

P.S. I will close the issue now since actually adding this will be a separate PR.

davidbrochart commented 2 years ago

I assumed you would not want to host extra plugins in the main repo, but it sounds like you actually do so even better! ;)

Of course, that would be a great addition.

karelvancamp commented 2 years ago

@mangecoeur FYI Turfpy https://turfpy.readthedocs.io/en/latest/