开发者

How to get diagonal co-ordinates for Google map view in android

开发者 https://www.devze.com 2023-03-06 16:50 出处:网络
In my android app, I am displaying a Google map for diff locations for which I have their lat & long. But now I am required to get diagonal co-ordinates i.e.ne_lat,ne_long,sw_lat and sw_long and d

In my android app, I am displaying a Google map for diff locations for which I have their lat & long. But now I am required to get diagonal co-ordinates i.e. ne_lat,ne_long,sw_lat and sw_long and display the v开发者_Python百科iew on map based on this. How to achieve this ? Please help.


GoogleMap map = // get reference to google map instance

if(map != null){
       LatLngBounds visibleBounds = map.getProjection().getVisibleRegion().latLngBounds;

       Log.i("SW", visibleBounds.southwest.toString());
       Log.i("NE", visibleBounds.northeast.toString());
}

Hope that helps

0

精彩评论

暂无评论...
验证码 换一张
取 消