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 h
I have been messing around with this... and having a mapview in a tabbed activity... the values are not initialized until onResume()... I verified this by putting:
final Handler mHandler = new Handler();
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
latSpan = mapView.getLatitudeSpan();
lngSpan = mapView.getLongitudeSpan();
if ((latSpan == 0) && (lngSpan == 360000000)) {
count++;
System.out.println("here we go again! " + count);
mHandler.postDelayed(this, 100);
}
}
}, 100);
In Various locations... in onCreate() and onStart() it will go indefinitely (until I switch to that tab), in onResume() it gets correct values immediately.