Coder Social home page Coder Social logo

Comments (4)

sandropibia avatar sandropibia commented on May 27, 2024

Hi Alex,

I can add the functionality, but time is sparse. So it would in the next release, say first quarter of 2018. Do you have any additional suggestions?

Thanks in advance

from leaflet.selectareafeature.

Alex870 avatar Alex870 commented on May 27, 2024

Hi, I certainly understand about limited time! Yes I did have another suggestion: I had to add a custom hook to the end of the _doMouseUp function, so I could trigger some code to disable further shape selection and also run some other housekeeping functions within the application.

Some details on the use case should make the reason for doing this clearer: when the user ctrl-clicks on the map, it enables your plugin to allow the drawing of a one-time region. Once the region is drawn, then the drawing mode automatically disables (selectfeature.disable called) until the user does another ctrl-click to begin a new selection.

I think this highlights the potential utility of adding some call-back hooks at the end of the various mouse events you're consuming: MouseUp and MouseDown would seem to be the most useful.

Perhaps something like this could be invoked to register custom hook functions to be called:

selectfeature.eventRegister({
   onMouseUp: <custom function #1>,
   onMouseDown: <custom function #2>
});

To unregister a custom function, passing in a null could work. Anyway, it's just a post implementation thought to consider..

Many thanks
-Alex

from leaflet.selectareafeature.

sandropibia avatar sandropibia commented on May 27, 2024

Hi Alex, about the features you describe to use predefined shapes, maybe I could trigger you to contribute to the project if you like.

from leaflet.selectareafeature.

sandropibia avatar sandropibia commented on May 27, 2024

I think a free shape to select objects is more convinient.
Closing this issue

from leaflet.selectareafeature.

Related Issues (8)

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.