aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/geopoint/Geopoint.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgeo/geocaching/geopoint/Geopoint.java')
-rw-r--r--src/cgeo/geocaching/geopoint/Geopoint.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cgeo/geocaching/geopoint/Geopoint.java b/src/cgeo/geocaching/geopoint/Geopoint.java
index 44aadcc..a8d7d37 100644
--- a/src/cgeo/geocaching/geopoint/Geopoint.java
+++ b/src/cgeo/geocaching/geopoint/Geopoint.java
@@ -1,5 +1,7 @@
package cgeo.geocaching.geopoint;
+import android.location.Location;
+
/**
* Abstraction of geographic point.
*/
@@ -60,6 +62,15 @@ public class Geopoint
}
/**
+ * Creates new Geopoint with given Location.
+ *
+ * @param gp the Location to clone
+ */
+ public Geopoint(final Location loc) {
+ this(loc.getLatitude(), loc.getLongitude());
+ }
+
+ /**
* Set latitude in degree.
*
* @param lat latitude