Android - dragging a marker without saving on the map api v2

I implement a function in my application that allows the user to manually find themselves on the map. So I use pin to represent their location and let the user drag it to where they are now. A simple solution is to use setDraggable(true) on the marker, but this requires users to hold the marker for 3 or 5 seconds until it is dragged. I think it is rather confusing for many users to use this feature. This way, I want the drag and drop to become more receptive, allowing users to drag and drop them right away without holding it for a while - like Foursquare does!

enter image description here

What should I do to implement my own drag and drop function? If you have any suggestions, please help me and thanks.

+8
android android-maps-v2 draggable marker
source share
1 answer

Check out the Hailo app. They have a neat workaround for this. It only works when dragging one marker.

The trick is to pan the map instead of moving the marker. They simply hold the marker in the view on top of the MapFragment (this is not really a marker on the map).

You can then use the cameraPosition.target map as the location of your marker.

+1
source share

All Articles