0

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.

2 Answers2

1

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."

Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
Julien
  • 2,256
  • 3
  • 26
  • 31
0

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

Community
  • 1
  • 1