How to load only the markers that are currently visible on the screen (Google maps on Android)

Using Google Maps on Android, does anyone have any ideas on how to load only the markers that will be displayed on the current screen?

I am going to send a request to a web service that returns lat / lng for the corresponding tokens. But what would be the parameters that I could use to calculate if the given lat / lng is inside the screen?

What would be ideal would be something like a Gowalla implementation

Any ideas?

Mike

+3
source share
1 answer

, , ( - SDK Level 7)

mapView MapView

mapView.getLatitudeSpan();

: ( ) , .

mapView.getLongitudeSpan();

: ( ) , .

.

mapView.getLocationInWindow(location);
mapView.getLocationOnScreen(location);
mapView.getZoomLevel();
0

Source: https://habr.com/ru/post/1758288/


All Articles