谷歌地图获取(可视)边界区域,东北角和西南角的坐标
2019-02-25 本文已影响0人
Pino
try {
LatLngBounds curScreen = gmap.getProjection()
.getVisibleRegion().latLngBounds;
System.out.println(curScreen.toString());
//top-left corner
double topleftlatitude=curScreen.northeast.latitude;
double topleftlongitude=curScreen.southwest.longitude;
System.out.println("top left==>"+topleftlatitude+"" +topleftlongitude);
//bottom-right corner
double bottomrightlatitude=curScreen.southwest.latitude;
double bottomrightlongitude=curScreen.northeast.longitude;
System.out.println("bottom right==>"+bottomrightlatitude+"" +bottomrightlongitude);
} catch (Exception e) {
e.printStackTrace();
}