Android 高德地图获取屏幕中心的坐标

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;

}

你可能感兴趣的:(Android 高德地图获取屏幕中心的坐标)