Giter VIP home page Giter VIP logo

Comments (7)

martinRenou avatar martinRenou commented on June 2, 2024 1

Hey Maarten! 😃

Thanks for opening an issue.

Sounds good to me. We can probably start by introducing a geoman control as you suggest, and add a note in the documentation to suggest using this one instead of the old leaflet-draw.

Happy to review a PR!

from ipyleaflet.

maartenbreddels avatar maartenbreddels commented on June 2, 2024 1

So, you are asking, can we replace leaflet-draw with geoman?

from ipyleaflet.

maartenbreddels avatar maartenbreddels commented on June 2, 2024

Awesome, yes, we should mention in the docs why both are there and direct people to the new one.

from ipyleaflet.

martinRenou avatar martinRenou commented on June 2, 2024

I always hate breaking changes, so I suggest we add Geoman draw controls to ipyleaflet, and keep the current draw controls as they are right now.

Would we be able to keep the same Python API while using geoman instead of leaflet-draw in the front-end?

It seems that having leaflet-draw there could break ipyleaflet entirely. leaflet-draw makes use of the initHook feature of LeafletJS, which allows them to patch the creation of e.g. markers. This seems to cause some issues in some cases (I have difficulties spotting the exact cases for now). So not having leaflet-draw in the page may be good.

Also I'm wondering if those plugins will not collide.

from ipyleaflet.

martinRenou avatar martinRenou commented on June 2, 2024

Yes

from ipyleaflet.

iisakkirotko avatar iisakkirotko commented on June 2, 2024

Hey @martinRenou and @maartenbreddels! I took a look at this a while ago, so here are some of my thoughts on the discussion:

Would we be able to keep the same Python API while using geoman instead of leaflet-draw in the front-end?

The one thing where I don't think there is at least feature parity is polyline, which I don't think Geoman has. Otherwise I don't foresee any issues with this that can't be overcome.

leaflet-draw makes use of the initHook feature of LeafletJS, which allows them to patch the creation of e.g. markers. This seems to cause some issues in some cases (I have difficulties spotting the exact cases for now).

Correct me if I'm wrong, but I think that Geoman also uses the initHook, since it initializes itself automatically. There is an option to not automatically initialize, but initHook is still used on layers/maps where we want to enable Geoman. Let me know if you manage to pin down any particular issues / what kinds of issues you think might come up.

Also I'm wondering if those plugins will not collide.

In my (admittedly brief) exploration of this I didn't run into any issues. I don't know if this might be the case when both are activated.

from ipyleaflet.

maartenbreddels avatar maartenbreddels commented on June 2, 2024

The company requesting/funding this feature asked if it was possible to advertise that they sponsor ipyleaflet. Would this be possible?
I think it's really good that people see a project like this can be sponsored, and I think it's fair to them.

Would a sponsor section in the main readme be ok?

from ipyleaflet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.