Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Draggable Marker onTouch event #5798

Closed
BharathMG opened this issue Jul 26, 2016 · 2 comments
Closed

Draggable Marker onTouch event #5798

BharathMG opened this issue Jul 26, 2016 · 2 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@BharathMG
Copy link
Contributor

I'm implementing a Draggable custom MarkerView in my application. The issue is, MarkerView does not delegate the touch events to my MapView touch listener. So when I click on the MarkerView and try to move it, no touch events are getting registered but if I move outside the marker area, I'm able to move MarkerView. Any solutions or hints to achieve this? @tobrun

I will be happy to implement a separate activity inside Test App to showcase this issue if needed. If this issue is solved, I will also implement a DraggableMarkerActivity inside Annotations package in the Mapbox Test App for developers looking to implement Drag feature #2450 .

Thanks!

@tobrun
Copy link
Member

tobrun commented Jul 26, 2016

@BharathMG thank you for you enthusiasm for getting draggable markers implemented!

The issue is, MarkerView does not delegate the touch events to my MapView touch listener.

Current implementation touch handling

Yes, touch events on MarkerViews are currently handled as finished when a click occurs because we are using an OnClickListener for it. OnClickListener interrupts the chain of the OnTouchListeners by returning true in the OnTouch method.

Next steps for touch handling

I need to note that we are currently working on removing the OnClickListener and moving the touch logic to core instead of the Android binding itself. This is what iOS is already doing since they introduced view annotations.

As a result of this change Draggable MarkerViews will need to be implemented in a slightly different way but we also give you the freedom to actual use that OnTouch event that you are requesting.

You can read about the issue here: #5388
And related pull request for it is here: #5639

Getting Draggable MarkerView implemented

The actual feature request for this is in #2450 and I'm going to close this in favour of that one. I will add some thoughts on how I think it could be implemented since you are not the only one requesting this.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Jul 26, 2016
@tobrun tobrun closed this as completed Jul 26, 2016
@Meerz
Copy link

Meerz commented Apr 19, 2018

i want to add draggable fuctionality in mapbox but there is no method like google provides buts its very neccessay for us to implement dragable marker or polyline???

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

3 participants