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

Implement cancel draggable during onAnnotationDrag #1129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ph0tonic
Copy link
Contributor

While using this plugin, I needed to cancel a drag event when my point was further apart from another location. The way I solved this was by deleting the point and repainting it so that cancel the drag event. The problem is that it's not efficient at all.

Here is a proposal to allow a drag event to be canceled directly in the dragEventListener. I would be pleased to have your feedback @langsmith and @LukasPaczos.

Thanks in advance

@LukasPaczos
Copy link
Contributor

Thanks @Ph0tonic, the idea and the implementation look good to me. Would you be able to add a unit test?

@langsmith could you help with merging this when ready?

@Ph0tonic
Copy link
Contributor Author

Ph0tonic commented May 19, 2020

You're welcome. Hum yes I will try to add some test but I not sure any more of my implementation. In the present case when a drag is cancel then the annotation stay still and if we continue our movement then the map moves. I think that this should not happen and could be very strange to the user has he was moving an annotation and suddenly he is moving the map.

What do you think about cancelling the drag but still consuming the event such as to prevent the map to take back the event until the user end is drag ?

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

Successfully merging this pull request may close these issues.

2 participants