在 android 中不使用 javascript 获取 google 地图的纬度和经度

Getting lat and lng for google map without using javascript in android

如何在不使用 javascript 的情况下获取屏幕中心 google 地图上某个位置的纬度和经度。 很长一段时间以来,我一直在努力寻找这个答案。 到底有没有?

谢谢。

Point point = new Point();
point.set(x, y);
LatLng latLng = mMap.getProjection().fromScreenLocation(p);

您可以通过计算 screenWidth/2 和 screenHeight/2

找到您的 x 和 y