In Google Maps for Android v1, MapView had a convenience method:
getMapCenter(). Now I cannot figure out how to get map center with v2 of this api. I have perused the API documentation, but there is no mention of such a feature. Please advise.
Thanks,
Igor
I had the same problem. It seems you can get the center this way:
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
GeoPointclass 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)