美文网首页
谷歌地图获取(可视)边界区域,东北角和西南角的坐标

谷歌地图获取(可视)边界区域,东北角和西南角的坐标

作者: Pino | 来源:发表于2019-02-25 11:54 被阅读0次
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();
        }

相关文章

网友评论

      本文标题:谷歌地图获取(可视)边界区域,东北角和西南角的坐标

      本文链接:https://www.haomeiwen.com/subject/mciwyqtx.html