Android的谷歌地图获得边界坐标 [英] Android Google Maps get Boundary Co-ordinates
问题描述
我使用的谷歌地图V2在我的应用程序。当用户平移或缩放屏幕上我想获得地图的基础上,我想获取的POI,只有在屏幕视图的一部分的区域。
我经历了文档,但找不到任何帮助。
I am using Google Maps v2 in my application. When the user pans or zooms on the screen I would like to get the area of the map based on which I want to fetch the POI only in the screen view part.
I went through the documentation but could not find any help.
推荐答案
您需要使用<一个href="https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/Projection"><$c$c>Projection$c$c>和<一href="https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/VisibleRegion"><$c$c>VisibleRegion$c$c>类,以获得可见经纬度区。
所以,你的code看起来是这样的:
You need to use Projection
and VisibleRegion
classes in order to get visible LatLng region.
So your code would look something like:
LatLngBounds curScreen = googleMap.getProjection()
.getVisibleRegion().latLngBounds;
这篇关于Android的谷歌地图获得边界坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!