aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgeocoords.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-11-09 20:11:43 +0100
committerSamuel Tardieu <sam@rfc1149.net>2011-11-09 20:27:34 +0100
commit33ceb51ad3220bad6aaa6cb741d1365fcb061027 (patch)
treed59ba5dbadcbf79c3c2b50803fc8d81fc260e2e9 /main/src/cgeo/geocaching/cgeocoords.java
parent03a048d95b13021908ea6c66cb03dd11bf2364d5 (diff)
downloadcgeo-33ceb51ad3220bad6aaa6cb741d1365fcb061027.zip
cgeo-33ceb51ad3220bad6aaa6cb741d1365fcb061027.tar.gz
cgeo-33ceb51ad3220bad6aaa6cb741d1365fcb061027.tar.bz2
Accept any coordinate when creating a Geopoint
Google maps may return coordinates outside of our comfort zone. Also, we need to deal with viewports encompassing the 180° meridian. This fixes #771.
Diffstat (limited to 'main/src/cgeo/geocaching/cgeocoords.java')
-rw-r--r--main/src/cgeo/geocaching/cgeocoords.java15
1 files changed, 1 insertions, 14 deletions
diff --git a/main/src/cgeo/geocaching/cgeocoords.java b/main/src/cgeo/geocaching/cgeocoords.java
index aafe9ec..533dc23 100644
--- a/main/src/cgeo/geocaching/cgeocoords.java
+++ b/main/src/cgeo/geocaching/cgeocoords.java
@@ -3,7 +3,6 @@ package cgeo.geocaching;
import cgeo.geocaching.Settings.coordInputFormatEnum;
import cgeo.geocaching.activity.AbstractActivity;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.geopoint.Geopoint.MalformedCoordinateException;
import cgeo.geocaching.geopoint.GeopointFormatter;
import cgeo.geocaching.geopoint.GeopointParser.ParseException;
@@ -358,11 +357,6 @@ public class cgeocoords extends Dialog {
context.showToast(context.getResources().getString(R.string.err_parse_lat_lon));
}
return false;
- } catch (MalformedCoordinateException e) {
- if (signalError) {
- context.showToast(context.getResources().getString(R.string.err_invalid_lat_lon));
- }
- return false;
}
return true;
}
@@ -411,14 +405,7 @@ public class cgeocoords extends Dialog {
latitude *= (bLat.getText().toString().equalsIgnoreCase("S") ? -1 : 1);
longitude *= (bLon.getText().toString().equalsIgnoreCase("W") ? -1 : 1);
- try {
- gp = new Geopoint(latitude, longitude);
- } catch (MalformedCoordinateException e) {
- if (signalError) {
- context.showToast(context.getResources().getString(R.string.err_invalid_lat_lon));
- }
- return false;
- }
+ gp = new Geopoint(latitude, longitude);
return true;
}