How to get Latitude/Longitude span in Google Map V2 for Android

前端 未结 4 1133
旧时难觅i
旧时难觅i 2020-12-08 22:22

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.get

4条回答
  •  余生分开走
    2020-12-08 23:10

    First obtain a Projection using GoogleMap.getProjection(). Then you can call Projection.getVisibleRegion() to obtain a VisibleRegion which has a LatLngBounds.

    The reason why a LatitudeSpan and Longitude span no longer makes sense is because the map can now be rotated and tilted and so viewport is no longer a latitude/longitude aligned rectangle on the map.

提交回复
热议问题