0

I need to get the coordinates after user move the map.

This is what I tried:

...

googleMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
    @Override
    public void onCameraIdle() {

        selectedLat = mMap.getCameraPosition().target.latitude;
        selectedLng = mMap.getCameraPosition().target.latitude;

        Log.d("maptest", "Coords: " + selectedLat + "," + selectedLng);

    }
});

...

It's returning some coordinates but they're wrong. Thousands of km away. It seems that it returns only the center of map, not the center of camera view.

How can I get the camera view center coordinates?

MrUpsidown
  • 21,592
  • 15
  • 77
  • 131
dm707
  • 352
  • 2
  • 15

0 Answers0