aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/googlemaps
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-09-08 00:00:58 +0200
committerSamuel Tardieu <sam@rfc1149.net>2011-09-08 11:32:14 +0200
commit39ec7accd759fd60706523b366977ba371efd168 (patch)
tree401ba08d9ec58e49d02ce614e12db5cf7b2b57bd /src/cgeo/geocaching/googlemaps
parent668472ec735f827a4741a971614596df02618689 (diff)
downloadcgeo-39ec7accd759fd60706523b366977ba371efd168.zip
cgeo-39ec7accd759fd60706523b366977ba371efd168.tar.gz
cgeo-39ec7accd759fd60706523b366977ba371efd168.tar.bz2
Refactoring to use Geopoint for coordinates
This uses the new Geopoint immutable class discussed in #58. No more independent longitude or latitude fields -- they are now treated and defined as a consistent pair.
Diffstat (limited to 'src/cgeo/geocaching/googlemaps')
-rw-r--r--src/cgeo/geocaching/googlemaps/googleCacheOverlayItem.java8
-rw-r--r--src/cgeo/geocaching/googlemaps/googleMapFactory.java5
2 files changed, 7 insertions, 6 deletions
diff --git a/src/cgeo/geocaching/googlemaps/googleCacheOverlayItem.java b/src/cgeo/geocaching/googlemaps/googleCacheOverlayItem.java
index 5546077..5f20dd4 100644
--- a/src/cgeo/geocaching/googlemaps/googleCacheOverlayItem.java
+++ b/src/cgeo/geocaching/googlemaps/googleCacheOverlayItem.java
@@ -1,17 +1,17 @@
package cgeo.geocaching.googlemaps;
-import com.google.android.maps.GeoPoint;
-import com.google.android.maps.OverlayItem;
-
import cgeo.geocaching.cgCoord;
import cgeo.geocaching.mapinterfaces.CacheOverlayItemImpl;
+import com.google.android.maps.GeoPoint;
+import com.google.android.maps.OverlayItem;
+
public class googleCacheOverlayItem extends OverlayItem implements CacheOverlayItemImpl {
private String cacheType = null;
private cgCoord coord;
public googleCacheOverlayItem(cgCoord coordinate, String type) {
- super(new GeoPoint((int)(coordinate.latitude * 1e6), (int)(coordinate.longitude * 1e6)), coordinate.name, "");
+ super(new GeoPoint(coordinate.coords.getLatitudeE6(), coordinate.coords.getLongitudeE6()), coordinate.name, "");
this.cacheType = type;
this.coord = coordinate;
diff --git a/src/cgeo/geocaching/googlemaps/googleMapFactory.java b/src/cgeo/geocaching/googlemaps/googleMapFactory.java
index ba62737..96f90f8 100644
--- a/src/cgeo/geocaching/googlemaps/googleMapFactory.java
+++ b/src/cgeo/geocaching/googlemaps/googleMapFactory.java
@@ -4,6 +4,7 @@ import android.content.Context;
import cgeo.geocaching.R;
import cgeo.geocaching.cgCoord;
import cgeo.geocaching.cgUser;
+import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.mapinterfaces.CacheOverlayItemImpl;
import cgeo.geocaching.mapinterfaces.GeoPointImpl;
import cgeo.geocaching.mapinterfaces.MapFactory;
@@ -29,8 +30,8 @@ public class googleMapFactory implements MapFactory{
}
@Override
- public GeoPointImpl getGeoPointBase(int latE6, int lonE6) {
- return new googleGeoPoint(latE6, lonE6);
+ public GeoPointImpl getGeoPointBase(final Geopoint coords) {
+ return new googleGeoPoint(coords.getLatitudeE6(), coords.getLongitudeE6());
}
@Override