How to get center of map for v2 android maps?

I had the same problem. It seems you can get the center this way:

mMap.getCameraPosition().target

where mMap is the GoogleMap instance from your activity. This will return a LatLng object which basically represents the center of the map.

Note that the GeoPoint class is not available anymore.

According to http://developer.android.com/reference/com/google/android/gms/maps/model/CameraPosition.html

target is “The location that the camera is pointing at.” (I tested it with the sample code and it worked okay for me)

Leave a Comment