0

What I want ?

When user taps on marker its image should change and user should be able to move the marker and I should be able to get the latitude and longitude . Below is a video of requirement .

What I have tried so far ?

I tried to implement default marker drag listener but it only works with long press .

I looked on similar questions on stack overflow but no luck .

Tried with ground overlay but not had much luck .

enter image description here

So how can I achieve this behaviour , Any hint is appreciated . There is already an app out there which does it so this should be possible .

Manohar
  • 22,116
  • 9
  • 108
  • 144

1 Answers1

0

As per documentation you are required to use:

GoogleMap.OnMarkerClickListener
public static interface GoogleMap.OnMarkerClickListener

Which Defines signatures for methods that are called when a marker is clicked or tapped.

With public method:

abstract boolean onMarkerClick(Marker marker)

Called when a marker has been clicked or tapped.

INSTEAD OF

GoogleMap.OnMapLongClickListener
public static interface GoogleMap.OnMapLongClickListener

with Public method:

public abstract void onMapLongClick (LatLng point) Called when the user makes a long-press gesture on the map, but only if none of the overlays of the map handled the gesture. Implementations of this method are always invoked on the Android UI thread.

eli
  • 8,571
  • 4
  • 30
  • 40