0

我正在将我的谷歌地图版本从 1 升级到版本 2,但是我遇到了一个问题,因为我曾经使用getMapCenter()但我无法在 v2 中使用它

任何帮助表示赞赏。提前致谢。

4

2 回答 2

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

于 2013-08-28T17:59:05.233 回答
0

很抱歉发布与此处已回答的相同问题如何获取 v2 android 地图的地图中心?但我错过了

这里的解决方案是mMap.getCameraPosition().target

谢谢你们

于 2013-08-30T18:51:36.597 回答