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

When both Draw and Edit are simultaneously enabled, a few problems occur. #1031

Open
EliezerB123 opened this issue Nov 8, 2021 · 4 comments

Comments

@EliezerB123
Copy link

EliezerB123 commented Nov 8, 2021

Hello! It's me again. This library is really, really good. But.... I've noticed two issues when attempting to have both Draw and Edit active simultaneously. JsFiddle: https://jsfiddle.net/e8fcduyg/1/
I'm not sure if this is something you will fix, because users can fix it themselves and it's a niche case. (I've fixed these in my projects using rather messy hacks.) But anyway, I thought I ought to mention it.

Issue one:
When both Draw and Edit are simultaneously active, when dragging a vertex and snapping it to another vertex, the user accidentally starts drawing.

To reproduce:
1a. Enable snap.
1b. Enable drawing of Polyline.
1c. Enable Editing.
1d. Draw two Polylines.
1e. Drag one line and snap it to the other line. Notice that when you do, Geoman automatically starts drawing a new line. (because there's no vertex underneath the cursor when you let go of the vertex?)

Expected behavior: Once I start dragging a vertex, drawing should be disabled until I finish dragging it.


Issue two:
When both Draw and Edit are simultaneously active, the user can't draw a line to a pre-existing vertex. If he tries to draw a line to that location, the marker is dragged instead.

To reproduce:

2a. Enable snap.
2b. Enable drawing of Polyline.
2c. Enable Editing.
2d. Draw a Polyline.
2e. Draw another polyline, and attempt to draw to one of the vertexes belonging to the first line. Notice that we can't, because when we click on a vertex, it attempts to drag instead of drawing.

Expected behavior: When both drawing and editing are active, once a user has started drawing and added his first vertex, dragging should be disabled until the user finishes drawing his current line. If a user clicks on a vertex, we should draw to that location.

JsFiddle (For both): https://jsfiddle.net/e8fcduyg/1/

@Falke-Design
Copy link
Collaborator

We currently not support the use of both modes togheter. I'm very suprised that it works so good.

I've fixed these in my projects using rather messy hacks.

What have you changed? Would be interessting if we decide to implement this in future.
Until then please upvote the existing Feature Request: #317

@sbahr001
Copy link

sbahr001 commented Jan 3, 2022

@EliezerB123 is it possible to share your messy hacks?

I am working on a project where I am expected to add a similar feature and it would save me some time. :). Thank you for the current share :)

@EliezerB123
Copy link
Author

EliezerB123 commented Jan 4, 2022

@EliezerB123 is it possible to share your messy hacks?

I am working on a project where I am expected to add a similar feature and it would save me some time. :). Thank you for the current share :)

@sbahr001 Sorry, I can't share the code for... reasons, but I assure you, you're not missing out. The hack was really, really messy.

@sbahr001
Copy link

sbahr001 commented Jan 6, 2022

Haha, thank you anyway. 😄

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

3 participants