Mapview getLatitudeSpan and getLongitudeSpan not working

Posted by janfsd on Stack Overflow See other posts from Stack Overflow or by janfsd
Published on 2010-04-19T12:37:24Z Indexed on 2010/04/19 13:53 UTC
Read the original article Hit count: 416

Hi! Sometimes when trying to get the Latitude span or Longitude span of a mapview with getLatitudeSpan() and getLongitudeSpan() I get 0 and 360*1E6 respectively. This doesn't happen always but it is a problem, has anybody got this problem? Any workarounds? I tried using getProjection() too but I get the same problem. Here is the piece of code:

MapView mapView = (MapView) findViewById(R.id.mapview);
int lat = mapView.getLatitudeSpan(); // sometimes returns 0
int long = mapView.getLongitudeSpan(); // sometimes returns 360*1E6

© Stack Overflow or respective owner

Related posts about android

Related posts about mapview