0

Here I am getting the location, by writing hardcoded latitude and longitude. I used map.setMyLocationEnabled(true);, it gives me the current location in map. But I also want marker to reach upto the my current location. Can you help to get latitude and longitude of my current position.

private final LatLng LOCATION = new LatLng(22.7515085,  75.8860726);

map = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

map.setMyLocationEnabled(true);

map.addMarker(new MarkerOptions().position(LOCATION).title("It is my current position"));

CameraUpdate update = CameraUpdateFactory.newLatLngZoom(LOCATION, 6);

map.animateCamera(update);
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
  • possible duplicate of [How do I get the current GPS location programmatically in Android?](http://stackoverflow.com/questions/1513485/how-do-i-get-the-current-gps-location-programmatically-in-android) – Siruk Viktor Mar 28 '14 at 09:34
  • Refer http://javapapers.com/android/markersgoogle-maps-android-api-v2/ – Santosh Kathait Mar 28 '14 at 09:34

0 Answers0