final float minDelta = 0.00122f;
final float maxCombo = 1464.1f;
final float sqrtMaxCombo = 38.26355968803739f;
if (delta.getLatitude() < minDelta || delta.getLongitude() < minDelta)
return new GeoDelta(minDelta, minDelta);
float combo = delta.getLatitude() * delta.getLongitude() * 10000000;
if (combo > maxCombo)
{
float lat = delta.getLatitude();
float lng = delta.getLongitude();
if (lat > sqrtMaxCombo)
lat = sqrtMaxCombo;
if (lng > sqrtMaxCombo)
lng = sqrtMaxCombo;
return new GeoDelta(lat, lng);
}
return delta;
}