I am upgrading my google maps version from 1 to version 2, but I have a problem as i used to use the getMapCenter() but i am not able to use it in v2
Any help is appreciated. Thanks in advance.
I am upgrading my google maps version from 1 to version 2, but I have a problem as i used to use the getMapCenter() but i am not able to use it in v2
Any help is appreciated. Thanks in advance.
You can use gMap.getCameraPosition().target
where gMap
is the GoogleMap instance from your activity.
This will return a LatLng object which is the coordinate of the center of the map.
According to this, the target is "The location that the camera is pointing at."
Sorry for posting the same question as it was already answered here How to get center of map for v2 android maps? but i missed that
The solution here is mMap.getCameraPosition().target
Thank you, All