Search code examples
javaandroidlatitude-longitudegoogle-maps-api-2

Drag and Drop pin on google map manually and get Lon & Lat in google map APIV2


i'm new to google maps api V2. I want a functionality like, on the page it has to display the map and there has to be a marker in the map and the map has to be draggable and by dragging it has to display the dragged location's latitude and longitude.. Can anyone plz help me to solve


Solution

  • Take a look at the docs... https://developers.google.com/maps/documentation/android/marker#marker_drag_events

    To get the final position, just call marker.getPosition() in the onMarkerDragEnd method.