diff options
Diffstat (limited to 'main/src/cgeo/geocaching/geopoint/Geopoint.java')
| -rw-r--r-- | main/src/cgeo/geocaching/geopoint/Geopoint.java | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/main/src/cgeo/geocaching/geopoint/Geopoint.java b/main/src/cgeo/geocaching/geopoint/Geopoint.java index dbe0aa4..e8a6dff 100644 --- a/main/src/cgeo/geocaching/geopoint/Geopoint.java +++ b/main/src/cgeo/geocaching/geopoint/Geopoint.java @@ -2,14 +2,8 @@ package cgeo.geocaching.geopoint; import cgeo.geocaching.ICoordinates; import cgeo.geocaching.R; -import cgeo.geocaching.geopoint.GeopointFormatter.Format; -import cgeo.geocaching.network.Network; -import cgeo.geocaching.network.Parameters; -import cgeo.geocaching.utils.Log; import org.apache.commons.lang3.StringUtils; -import org.json.JSONArray; -import org.json.JSONObject; import android.location.Location; import android.os.Parcel; @@ -297,7 +291,7 @@ public final class Geopoint implements ICoordinates, Parcelable { /** * Returns formatted coordinates with default format. * Default format is decimalminutes, e.g. N 52° 36.123 E 010° 03.456 - * + * * @return formatted coordinates */ @Override @@ -323,34 +317,6 @@ public final class Geopoint implements ICoordinates, Parcelable { } } - public Double getElevation() { - try { - final String uri = "http://maps.googleapis.com/maps/api/elevation/json"; - final Parameters params = new Parameters( - "sensor", "false", - "locations", format(Format.LAT_LON_DECDEGREE_COMMA)); - final JSONObject response = Network.requestJSON(uri, params); - - if (response == null) { - return null; - } - - if (!StringUtils.equalsIgnoreCase(response.getString("status"), "OK")) { - return null; - } - - if (response.has("results")) { - JSONArray results = response.getJSONArray("results"); - JSONObject result = results.getJSONObject(0); - return result.getDouble("elevation"); - } - } catch (Exception e) { - Log.w("cgBase.getElevation", e); - } - - return null; - } - @Override public Geopoint getCoords() { return this; |
