Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predefined shapes - Enhancement suggestion #1

Closed
Alex870 opened this issue Nov 18, 2017 · 4 comments
Closed

Predefined shapes - Enhancement suggestion #1

Alex870 opened this issue Nov 18, 2017 · 4 comments

Comments

@Alex870
Copy link
Contributor

Alex870 commented Nov 18, 2017

I'd like to suggest an enhancement of locking the drawing process to using predefined shapes like circles and rectangles etc, This would be in addition to the existing capability of drawing a free-form area.

There might be a new API method added for selecting a defined shape like a circle, for instance. Then the user would click the center point on the map and then click a second time some distance away to define the radius.

I've not seen anything like this from other plugins and it would be a fantastic addition to the great functionality you already have. Great work!

@sandropibia
Copy link
Owner

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

@Alex870
Copy link
Contributor Author

Alex870 commented Nov 29, 2017

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

@sandropibia
Copy link
Owner

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

@sandropibia
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants