diff options
| author | Michael Keppler <michael.keppler@gmx.de> | 2014-04-23 13:22:26 +0200 |
|---|---|---|
| committer | Michael Keppler <michael.keppler@gmx.de> | 2014-04-23 13:22:26 +0200 |
| commit | adbf5b5aad167cdd126b4fa3bead52456d0560d1 (patch) | |
| tree | 10d3e6f4076e20df91c56467a79856b8418d4ff0 /main/src | |
| parent | 9c3d2794cfcedb7f24b4e7413a356c4592eb0766 (diff) | |
| download | cgeo-adbf5b5aad167cdd126b4fa3bead52456d0560d1.zip cgeo-adbf5b5aad167cdd126b4fa3bead52456d0560d1.tar.gz cgeo-adbf5b5aad167cdd126b4fa3bead52456d0560d1.tar.bz2 | |
fix #3731: use formatted numbers when calling navigation
Until now we used the raw number to string conversion, therefore giving
much more than the usual 6 digits after the comma to other applications.
Diffstat (limited to 'main/src')
| -rw-r--r-- | main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java b/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java index 819638c..6c184ce 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java @@ -5,6 +5,8 @@ import cgeo.geocaching.R; import cgeo.geocaching.Waypoint; import cgeo.geocaching.activity.ActivityMixin; import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.geopoint.GeopointFormatter; +import cgeo.geocaching.geopoint.GeopointFormatter.Format; import cgeo.geocaching.utils.Log; import android.app.Activity; @@ -29,8 +31,10 @@ class GoogleMapsApp extends AbstractPointNavigationApp { private static void navigate(Activity activity, Geopoint point, String label) { try { - final String geoLocation = "geo:" + point.getLatitude() + "," + point.getLongitude(); - final String query = point.getLatitude() + "," + point.getLongitude() + "(" + label + ")"; + String latitude = GeopointFormatter.format(GeopointFormatter.Format.LAT_DECDEGREE_RAW, point); + String longitude = GeopointFormatter.format(Format.LON_DECDEGREE_RAW, point); + final String geoLocation = "geo:" + latitude + "," + longitude; + final String query = latitude + "," + longitude + "(" + label + ")"; final String uriString = geoLocation + "?q=" + Uri.encode(query); activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uriString))); return; |
