public LatLng getMapCenterPoint() {
int left = mMapView.getLeft();
int top = mMapView.getTop();
int right = mMapView.getRight();
int bottom = mMapView.getBottom();
// 获得屏幕点击的位置
int x = (int) (mMapView.getX() + (right - left) / 2);
int y = (int) (mMapView.getY() + (bottom - top) / 2);
Projection projection = mAMap.getProjection();
LatLng pt = projection.fromScreenLocation(new Point(x, y));
return pt;
}
本文介绍了一种通过屏幕中心位置来获取地图中心点经纬度坐标的方法。该方法首先确定屏幕的左、上、右、下边界,然后计算屏幕中心点,并使用地图投影将屏幕坐标转换为地理坐标。
2521





