我有我的移动应用程序,谷歌地图的Android的API V2的任务。现在,我需要得到纬度/经度跨度。我用 MapView.getLatitudeSpan()
和 MapView.getLongitudeSpan()
在previous版本的API。现在,我找不到这样的事情在V2。
I have a task for move my app to Google Maps Android APIs V2. Now, I need to get Latitude/Longitude span. I used MapView.getLatitudeSpan()
and MapView.getLongitudeSpan()
in previous version APIs. Now I can't find something like this in V2.
没有任何人有同样的问题?
Does anybody have the same problem?
您可以使用下面的code,以获得纬度/经度跨度:
You can use the following code to get the lat/lng span:
VisibleRegion vr = mMap.getProjection().getVisibleRegion();
double left = vr.latLngBounds.southwest.longitude;
double top = vr.latLngBounds.northeast.latitude;
double right = vr.latLngBounds.northeast.longitude;
double bottom = vr.latLngBounds.southwest.latitude;
我希望这有助于。
I hope this helps.