Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Map Bounds Using Android Google Maps [duplicate]

Possible Duplicate:
How can I determine if a geopoint is displayed in currently viewable area?

I was wondering if there was any way (I'm somewhat a newbie at Java) to get the MapBounds of a Google MapView on Android.

Just to clarify, here's what I'd like to do.

Calculate the maximum and minimum long and lat whenever the map is moved, or zoomed and display those values in a Toast.

Is there any possible way to do this -- or am I in over my head?

like image 895
hwrdprkns Avatar asked Jul 31 '10 02:07

hwrdprkns


1 Answers

You should be able to use

mapView.getLatitudeSpan();
mapView.getLongitudeSpan();

in combination with

mapView.getMapCenter();

to figure out the visible area.

But I have noticed some users had issues with it.

Mapview getLatitudeSpan and getLongitudeSpan not working

You should check the android developer group as well maybe.

like image 145
Mathias Conradt Avatar answered Nov 01 '22 05:11

Mathias Conradt