-
Notifications
You must be signed in to change notification settings - Fork 120
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
AnnotationManager drag event also firing a long-click on the map #1162
Comments
For the benefit of anyone else hitting this, I've worked around this with the following horrible hack. This updates a global timestamp whilst the drag is taking place, and then checks to see if that timestamp is less than 500ms old when a map long-click event fires. If less than 500ms has elapsed since the last drag and the long-click, then the long-click is ignored.
|
A simple boolean does the trick instead of timestamp. Edit: Sorry you're right. If the drag/drop is done quickly, the long click event will be fired. So the timestamp method is mandatory to workaround this issue. |
Just by curiosity, which version of the mapbox-plugins-android are you using ? It seems to me that this problem has been fixed in v0.9.0 by #1141. |
I was using v0.9.0, it still occurred for me with this version. |
After watching your code with more attention, I might have found something. Your are adding your initMapClicks();
initCircleManager(style); I'm not sure that those changes will solve your problem, but it is worth to give it a try. |
After some more digging, I think that this might happen due to the way If you have a look at the method |
Thanks for investigating! I've tried your suggested change and I'm afraid it makes no difference. The long-click event on the map is still fired when I drag the circle marker. |
I'm using the latest 9.6.0 Mapbox SDK and the latest annotation plugin too. I'm creating some circles on my map (using CircleManager) and have setup a drag listener for them. This all works fine, but when dragging a circle it also seems to fire a long-click event on the map as well.
I note that dragging a circle does not fire a regular click event on the map. It only fires a long-click event.
This minimal code example reproduces the issue:
This results in the following output:
My expectation is that dragging the circle should not result in any events being fired at the map level.
Am I doing something wrong or is this a bug? I can't find any issue that matches this.
The text was updated successfully, but these errors were encountered: